Nachdem auf dem frisch installierten Zarafa Server einige Benutzer Ihre Emails auch per POP3 / SMTP nutzen wollten, musste eine Authentifizierung her, die den Benutzer an der Active Directory authentifiziert, sobald die Email nicht aus dem internen Netzwerk verschickt wird.
Voraussetzungfür diese Anleitung ist, dass Postfix bereits installiert ist.
Zuerst wird saslauthd installiert, was für die Authentifizierung am LDAP (in meinem Fall die Active Directory) zuständig ist:
sudo apt-get install saslauthd Nun muss dieser Dienst konfiguriert werden:
#
# Settings for saslauthd daemon
# Please read /usr/share/doc/sasl2-bin/README.Debian for details.
#
# Should saslauthd run automatically on startup? (default: no)
START=yes
# Description of this saslauthd instance. Recommended.
# (suggestion: SASL Authentication Daemon)
DESC="SASL Authentication Daemon"
# Short name of this saslauthd instance. Strongly recommended.
# (suggestion: saslauthd)
NAME="saslauthd"
# Which authentication mechanisms should saslauthd use? (default: pam)
#
# Available options in this Debian package:
# getpwent -- use the getpwent() library function
# kerberos5 -- use Kerberos 5
# pam -- use PAM
# rimap -- use a remote IMAP server
# shadow -- use the local shadow password file
# sasldb -- use the local sasldb database file
# ldap -- use LDAP (configuration is in /etc/saslauthd.conf)
#
# Only one option may be used at a time. See the saslauthd man page
# for more information.
#
# Example: MECHANISMS="pam"
MECHANISMS="ldap"
# Additional options for this mechanism. (default: none)
# See the saslauthd man page for information about mech-specific options.
# MECH_OPTIONS=""
MECH_OPTIONS="/etc/saslauthd.conf"
# How many saslauthd processes should we run? (default: 5)
# A value of 0 will fork a new process for each connection.
THREADS=5
# Other options (default: -c -m /var/run/saslauthd)
# Note: You MUST specify the -m option or saslauthd won't run!
#
# WARNING: DO NOT SPECIFY THE -d OPTION.
# The -d option will cause saslauthd to run in the foreground instead of as
# a daemon. This will PREVENT YOUR SYSTEM FROM BOOTING PROPERLY. If you wish
# to run saslauthd in debug mode, please run it by hand to be safe.
#
# See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
# See the saslauthd man page and the output of 'saslauthd -h' for general
# information about these options.
#
# Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
# OPTIONS="-c -m /var/run/saslauthd"
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"In dieser Config wird definiert, dass zum einen der Dienst startet und welche Art der Authentifizierung genutzt wird. Hier wird die Config-Datei angegeben, in der die Verbindung zur AD/LDAP hergestellt wird (/etc/saslauthd.conf).
ldap_servers: ldap://192.168.1.100/
ldap_search_base: OU=Benutzer,OU=Company,DC=firma,DC=local
ldap_bind_dn: CN=AuthUser,OU=Benutzer,OU=Company,DC=firma,DC=local
ldap_bind_pw: secret
ldap_filter: (sAMAccountName=%u)Nach dem Starten von saslauthd sollte die Verbindung mit testsalsauthd getestet werden:
root@mail:~# testsaslauthd -u user -p wrongpass
0: NO "authentication failed"
root@mail:~# testsaslauthd -u user -p secret
0: OK "Success."Wenn hier ein “OK” zurückkommt, ist alles okay. Ansonsten ist in der /var/log/auth.log eventuell ein Ansatz zur Fehlersuche.
Am Schluss muss nur noch in der Postfix main.cf die Authentifizierung angestellt werden:
....
# SASL Config
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
....
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination
....Das Testen kann dann z.B. per Telnet gemacht werden. Sollten jetzt noch Fehler auftreten, hilft die /var/log/mail.log oder die /var/log/auth.log







On debian squeeze (6.0) package “sasl2-bin” must be installed to get saslauthd.