In Debian you can use the following packages (version number is at time of writing):
courier-authdaemon 0.45.2-2 Courier Mail Server - Authentication daemon courier-base 0.45.2-2 Courier Mail Server - Base system courier-imap 3.0.2-2 Courier Mail Server - IMAP server courier-imap-ssl 3.0.2-2 Courier Mail Server - IMAP over SSL courier-ldap 0.45.2-2 Courier Mail Server - LDAP support courier-pop 0.45.2-2 Courier Mail Server - POP3 server courier-pop-ssl 0.45.2-2 Courier Mail Server - POP3 over SSL courier-ssl 0.45.2-2 Courier Mail Server - SSL/TLS Support
Courier needs PAM turned off for authentication in /etc/courier/authdaemonrc. If pam is turned on, it will break the userPassword lookup set in the authldaprc file.
Configuration Specifics:
First you need to edit the file authdaemonrc (usualy located in /etc/courier). Simply set the following directive:
authmodulelist="authldap" |
This option tells the courier auth daemon where to look for authentication information. Everything else in that file can be set as appropriate for your personal preferences.
The crucial part comes with editing the authldaprc (also in /etc/courier) file. Several of the configuration directives that go into this file (server and port for example) are intuitively clear, others need some explanation:
LDAP_BASEDN dc=dot |
Clearly this one has to be set to reflect our tree.
Then we need to define the vmail user as the system account that checks data in the LDAP direrctory for Courier.
LDAP_BINDDN uid=vmail,ou=system-users,dc=dot LDAP_BINDPW XXXX |
LDAP_AUTHBIND 1 |
LDAP_MAIL uid |
LDAP_HOMEDIR homeDirectory |
If not commented out, comment out this line:
#LDAP_MAILDIR mailbox |
LDAP_MAILDIRQUOTA mailQuota |
LDAP_CRYPTPW userPassword |
LDAP_UID uidNumber LDAP_GID gidNumber |
LDAP_TLS 0 |
Add this to /etc/courier/pop3d
POP3AUTH_TLS="LOGIN PLAIN" |
You can use the SSL certificated you created for apache for pop3 and imap:
cat /etc/apache/ssl/domain/server.pem /etc/apache/ssl/domain/server.crt >> /etc/courier/pop3d.pem cat /etc/apache/ssl/domain/server.pem /etc/apache/ssl/domain/server.crt >> /etc/courier/imapd.pem |