> qmail can replace the traditional Pop3 authentication of / etc / passwd through LDAP, in order to improve the efficiency of authentication and effectively support large-volume mail customers. In order to enable qmail to obtain LDAP support, it is necessary to add a LDAP authentication patch on the basis of qmail Package, it is best to use the new compressed package of qmail, specific operations use the following command:
#rm -rf qmail-1.03
#zip-zxvf qmail-1.03.tar.gz
#gunzip qmail-ldap-1_03-20010301_patch.gz
#cd qmail- 1.03
#patch -p1 <../ qmail-ldap-1.03-20010501.patch
After the patch package is printed , you need to modify the qmail
🦑 Makefile to configure the corresponding LDAP information, as follows (here only explain what must be modified, the rest For options, please refer to the QLDAPINSTALL.TXT document):
1) -LDAPFLAGS = -DCLEARTEXTPASSWORD
Configure whether to use a clear text password in the LDAP directory.
2) -LDAPLIBS =
LDAP interface library configured, in this case:
LDAPLIBS = -L / usr / local / lib -L / usr / X11R6 / lib / modules -lldap -llber -lldap_r -lpthread -lresolv
4) -SHADOWLIBS = -lcrypt -lshadow
-SHADOWOPTS = -DPW_SHADOW
Configure the password authentication method used.
After the Makefile settings are modified, recompile the qmail source file, then overwrite and install qmail, use the following command:
#make setup check
install openldap
zip -zxvf openldap-2.07.tgz
cd openldap-2.07
./configure
make depend
make
make test
su root -c '' make install ''
such that openldap installation is completed
Create the corresponding LDAP support file under / var / qmail / control /:
#cat ldapserver
172.18.6.111
#cat ldapbasedn
dc = longshine, dc = com
#cat ldapobjectclass
qmailUser
copies qmail.schema to the corresponding directory of openldap
cp /usr/local/src/qmail/qmail-1.03/qmail.schema / usr / local / etc / openldap / schema /.
Edit the configuration file / usr / local / etc / openldap / slapd.conf)
database ldbm
suffix ""dc=longshine,dc=com""
rootdn ""cn=Manager,dc= longshine ,dc=""
rootpw secret
directory / usr / local / var / openldap-ldbm
add the corresponding shema file
include /usr/local/etc/openldap/schema/cosine.schema
include /usr/local/etc/openldap/schema/nis.schema
include /usr/local/etc/openldap/schema/inetorgperson.schema
include /usr/local/etc/openldap/schema/qmail.schema
start SLAPD.
su root -c / usr / local / libexec / slapd in
order to detect whether openldap is running And configured correctly. You can execute the ldapsearch command to check. By default, ldapsearch is installed in / usr / local / bin / ldapsearch:
ldapsearch -x -b '' '' -s base '' (objectclass = *) '' namingContexts
should see
dn:
namingContexts: dc = longshine,
dc = com increases the initial population of the directory.
Is divided into two steps:
generating an LDIF file
running ldapadd
#rm -rf qmail-1.03
#zip-zxvf qmail-1.03.tar.gz
#gunzip qmail-ldap-1_03-20010301_patch.gz
#cd qmail- 1.03
#patch -p1 <../ qmail-ldap-1.03-20010501.patch
After the patch package is printed , you need to modify the qmail
🦑 Makefile to configure the corresponding LDAP information, as follows (here only explain what must be modified, the rest For options, please refer to the QLDAPINSTALL.TXT document):
1) -LDAPFLAGS = -DCLEARTEXTPASSWORD
Configure whether to use a clear text password in the LDAP directory.
2) -LDAPLIBS =
LDAP interface library configured, in this case:
LDAPLIBS = -L / usr / local / lib -L / usr / X11R6 / lib / modules -lldap -llber -lldap_r -lpthread -lresolv
4) -SHADOWLIBS = -lcrypt -lshadow
-SHADOWOPTS = -DPW_SHADOW
Configure the password authentication method used.
After the Makefile settings are modified, recompile the qmail source file, then overwrite and install qmail, use the following command:
#make setup check
install openldap
zip -zxvf openldap-2.07.tgz
cd openldap-2.07
./configure
make depend
make
make test
su root -c '' make install ''
such that openldap installation is completed
Create the corresponding LDAP support file under / var / qmail / control /:
#cat ldapserver
172.18.6.111
#cat ldapbasedn
dc = longshine, dc = com
#cat ldapobjectclass
qmailUser
copies qmail.schema to the corresponding directory of openldap
cp /usr/local/src/qmail/qmail-1.03/qmail.schema / usr / local / etc / openldap / schema /.
Edit the configuration file / usr / local / etc / openldap / slapd.conf)
database ldbm
suffix ""dc=longshine,dc=com""
rootdn ""cn=Manager,dc= longshine ,dc=""
rootpw secret
directory / usr / local / var / openldap-ldbm
add the corresponding shema file
include /usr/local/etc/openldap/schema/cosine.schema
include /usr/local/etc/openldap/schema/nis.schema
include /usr/local/etc/openldap/schema/inetorgperson.schema
include /usr/local/etc/openldap/schema/qmail.schema
start SLAPD.
su root -c / usr / local / libexec / slapd in
order to detect whether openldap is running And configured correctly. You can execute the ldapsearch command to check. By default, ldapsearch is installed in / usr / local / bin / ldapsearch:
ldapsearch -x -b '' '' -s base '' (objectclass = *) '' namingContexts
should see
dn:
namingContexts: dc = longshine,
dc = com increases the initial population of the directory.
Is divided into two steps:
generating an LDIF file
running ldapadd