UserPreferences

Exim4CourierSetupForOx


Befor you begin, you should have a working OX (I have OX 0.7.5) with at least one user (here: testuser.test), a working Courier-IMAP server and a working Exim4-SMTP server. Only the modifications listed here you have to make to configure everithing to use the existing OX LDAP directory for user authentication.

for Exim4 and Courier IMAP configartion see the excelent installation guide: http://talk.trekweb.com/~jasonb/articles/exim_maildir_imap.shtml

1. Create the "vmail" group, virtual user and folders

groupadd -g 5000 vmail 
useradd -g vmail -u 5000 vmail -d /home/vmail -m

2. Create the users and mail directories in the "vmail" folder

mkdir /home/vmail/testuser.test 
maildirmake /home/vmail/testuser.test/Maildir
(maildirmake comes with Courier)
chown vmail:vmail -R /home/vmail 
3. Prepare the LDAP:
include         /etc/ldap/schema/qmail.schema
/etc/init.d/slapd restart

4. Prepare the LDAP directory for Courier. For every user do the followings (try to use phpldapadmin or an .ldif file):

5. Install Courier-LDAP if you don't have it:

apt-get install courier-ldap
6. Configure Courier-IMAP to use the OX LDAP directory:
                LDAP_SERVER             localhost
                LDAP_PORT               389
                LDAP_PROTOCOL_VERSION   3
                LDAP_BASEDN             ou=Users,ou=OxObjects,dc=example,dc=org
                LDAP_BINDDN             uid=mailadmin,dc=example,dc=org
                LDAP_BINDPW             mailadmin-password
                LDAP_TIMEOUT            5
                LDAP_AUTHBIND           1
                LDAP_MAIL               uid
                LDAP_FILTER             (&(objectClass=OxUserObject)(mailEnabled=OK))
                LDAP_GLOB_UID           5000
                LDAP_GLOB_GID           5000
                LDAP_HOMEDIR            mailMessageStore
                LDAP_MAILDIR            mailMessageStore
                LDAP_FULLNAME           cn
                LDAP_CRYPTPW            userPassword
                LDAP_DEREF              never
                LDAP_TLS                0
authmodulelist="authldap authpam"
Notice that if the LDAP authentication fails it falls back to PAM.
/etc/init.d/courier-authdaemon restart

7. Configure Exim4 SMTP to use the OX LDAP directory:

    ldap_lookup:
    debug_print = "R: ldap_lookup for $local_part@$domain"
    driver = redirect
    allow_fail
    allow_defer
    user = vmail
    group = vmail
    file_transport = address_file
    pipe_transport = address_pipe
    directory_transport = address_directory
    data = ${extract{1}{\n}{ \
           ${lookup ldap \
           {user="uid=mailadmin,dc=example,dc=org" pass=mailadmin-password \
           ldap://localhost/uid=${local_part},ou=Users,ou=OxObjects,dc=example,dc=org?mailMessageStore?sub}} }}
                address_directory:
                debug_print = "T: address_directory for $local_part@$domain"
                driver = appendfile
                envelope_to_add = true
                return_path_add = true
                check_string = ""
                escape_string = ""
                maildir_format
update-exim4.conf
kill -HUP `pidof exim4`
exim4 -bt testuser.test

And test webmail now if it works and sends and receives emails! Good luck :))) AktuelleÄnderungen AktuelleÄnderungen