Postfix OpenLDAP LMDB Howto


Introduction

Postfix uses databases of various kinds to store and look up information. Postfix databases are specified as "type:name". OpenLDAP LMDB (called "LMDB" from here on) implements the Postfix database type "lmdb". The name of a Postfix LMDB database is the name of the database file without the ".lmdb" suffix.

This document describes:

Building Postfix with LMDB support

Postfix normally does not enable LMDB support. To build Postfix with LMDB support, use something like:

% make makefiles CCARGS="-DHAS_LMDB -I/usr/local/include" \
    AUXLIBS="-L/usr/local/lib -llmdb"
% make

Solaris may need this:

% make makefiles CCARGS="-DHAS_LMDB -I/usr/local/include" \
    AUXLIBS="-R/usr/local/lib -L/usr/local/lib -llmdb"
% make

The exact pathnames depend on how LMDB was installed.

When building Postfix fails with:

undefined reference to `pthread_mutexattr_destroy'
undefined reference to `pthread_mutexattr_init'
undefined reference to `pthread_mutex_lock'

Add the "-lpthread" library to the "make makefiles" command.

% make makefiles .... AUXLIBS="... -lpthread"

Configuring LMDB settings

Postfix provides one configuration parameter that controls LMDB database behavior.

Supported minimum LMDB patchlevel

Currently, Postfix supports LMDB 0.9.11 or later. The supported minimum LMDB patchlevel has evolved over time, as the result of deployment experience with Postfix.