Original of this document is available from

Note that I am not an LDAP expert, so some of the terminology used within this guide may not be 100% correct. I wrote this guide because many people on the vchkpw mailing list had questions about how to get vpopmail/ldap running. The docs we had so far (below) were a little difficult to understand and follow for an LDAP beginner, so I decided to put together this doc in the hope of presenting an easy-to-follow installation guide.

OpenLDAP can operate with a number of database filesystems. For this example we are going to use the bdb database system.

Download/compile BDB

cd /usr/local/src
tar xzf db-4.2.52.tar.gz
cd db-4.2.52
cd build_unix
make install
cd ..

Download/compile OpenLDAP
tar xzf openldap-2.1.23.tgz
cd openldap-2.1.23
env CPPFLAGS=-I/usr/local/BerkeleyDB.4.2/include \
LDFLAGS=-L/usr/local/BerkeleyDB.4.2/lib \
make depend
make install
cd ..

Download/configure/compile vpopmail

Make the user accounts

# If you are using RH8.0, you will probably need to run this following command,
# because RH8.0 comes preconfigured with UID/GID 89 allocated to postfix
# userdel postfix

groupadd -g 89 vchkpw
useradd -g vchkpw -u 89 -d /home/vpopmail vpopmail
# We recommend you use the user and group id's of 89. The FreeBSD folks
# have reserved 89 for the group and 89 for the user for vpopmail. Feel
# free to have the OS assign the group/user id (for example, Solaris won't 
# allow gid 89).

Download and unpack the source

cd /usr/local/src
tar xzf vpopmail-5.4.4.tar.gz
chown -R root.root vpopmail-5.4.4
cd vpopmail-5.4.4

Setup the LDAP support in the vpopmail sources

vi vldap.h
#define VLDAP_SERVER "localhost"
#define VLDAP_USER "cn=vpopmailuser, o=vpopmail"
#define VLDAP_PASSWORD "vpoppasswd"
#define VLDAP_BASEDN "o=vpopmail"

Compile vpopmail

./configure --enable-auth-module=ldap
make install-strip

Configure/start the OpenLDAP server

Copy the vpopmail ldap schema into the OpenLDAP schema directory

cd ldap
cp qmailUser.schema /usr/local/etc/openldap/schema

Configure OpenLDAP to host the vpopmail database

cp slapd.conf /usr/local/etc/openldap
chmod 600 /usr/local/etc/openldap/slapd.conf
chown root.root /usr/local/etc/openldap/slapd.conf

Start the OpenLDP server


If all goes well, 'ps axf' should give something like this :

18415 ? S 0:00 /usr/local/libexec/slapd
18416 ? S 0:00 \_ /usr/local/libexec/slapd
18417 ? S 0:00 \_ /usr/local/libexec/slapd

Now create the vpopmail database in the LDAP system

ldapadd -f vpopmail.ldif -x -w vpoppasswd -D'cn=vpopmailuser,o=vpopmail'

If all goes well you will see something like :

adding new entry "o=vpopmail"

Get the ldap server to confirm that the vpopmail database exists

ldapsearch -x -b 'o=vpopmail'

Now you should be right to go!

As you start adding domains and users, the ldap directory tree will eventually look like this :

vpopmail (o) (ou)
someuser3 (ou)

Other useful references I found on the net :

need to bump up the softlimit for the pop3d script..

[root@syringe root]# telnet 110
Connected to
Escape character is '^]'.
+OK <>
pass xxxx
/home/vpopmail/bin/vchkpw: error while loading shared libraries: failed to map segment from shared object: Cannot allocate memory
-ERR authorization failed