Scott Hurring » HOWTO » Debian: Setting up postfix + SASL

HOWTO
info
Revision: 2
Released: Nov 06, 2005
Updated: Jul 12, 2006

Problem

You want SASL authentication to work with Postfix on a Debian install.

Solution

If you get the "fatal: no SASL authentication mechanisms" error message from postfix, install "libsasl2-modules"


1(a). Modify /etc/init.d/saslauthd

Modify the file /etc/init.d/saslauthd and add the following lines

# Modify saslauthd to work within postfix's chroot jail.
DEB_WDIR="/var/spool/postfix/var/run/saslauthd/"
PARAMS="-m ${DEB_WDIR}"

1(b). Copy sasl into postfix' chroot jail

This way is more of a pain and is more prone to errors and problems through system upgrades... but as far as i know, it will work.

Copy /var/run/saslauthd/ to /var/spool/postfix/var/run/saslauthd/
Symlink old location to new location.
Check that ownership is root:sasl
Add user postfix into sasl group so that postfix can read the .pid file in the saslauthd directory.


Notes

Thanks to Jeremy Avnet for a suggestion on wording #1 more clearly.


Comments

From on Mar 13, 2006:

I think the better way is to modify the /etc/default/saslauthd file, which is imported by the startup script. This has the advantage of making any upgrades a little less painful.

I also made hard links of the contents of /var/spool/postfix/var/run/saslauthd/ back to /var/run/saslauthd/, otherwise I can't use startup script to restart the saslauthd.

But those a nits I'm picking at. The steps outlined where spot-on in getting my authenticating SMTP server working. Thanks greatly!