LDAP
See Chapter 15 for information on LDAP and Postfix. This add-on depends on LDAP libraries, which you must install first if they’re not already on your system. There are commercial libraries available as well as an open source package from website. This example assumes that you have LDAP libraries installed in /usr/local/lib/ and LDAP header files in /usr/local/include. If your instal- lation differs, adjust the example accordingly. There is an LDAP_README file that comes with the Postfix distribution with information about building Postfix with support for LDAP.
To build Postfix with LDAP support, you must define the HAS_LDAP macro and specify the directories for the LDAP libraries and header files. You must link against the libldap.so library file and also the liblber.so library file, which defines encoding routines for the LDAP protocol. Run make tidy if necessary. Build your Makefile with the following options:
$ make makefiles CCARGS='-I/usr/local/include -DHAS_LDAP' \
AUXLIBS='-L/usr/local/lib -lldap -L/usr/local/lib -llber'
Remember that if you must provide the path to your libraries to the runtime linker, include the correct runtime search path argument:
$ make makefiles CCARGS='-I/usr/local/include -DHAS_LDAP' \
AUXLIBS='-L/usr/local/lib -lldap -L/usr/local/lib -llber \
-rpath /usr/local/lib'
If your linker uses an argument other than rpath , be sure to specify the correct one.