Installing Postfix and SASL for SMTP AUTH on OpenBSD

There are some Documentation around which describe how to setup Postfix and SASL with OpenBSD for SMTP authentification against /etc/passwd. None of them where bringing me to the result I want. The major problem is that postfix runs in chroot. I will describe how I got it running.

How-To:

  1. Install OpenBSD postfix-sasl package, enable postfix and configure it
  2. Let saslauthd start at boot and add the following to your /etc/rc.local
  3. # SASL2 Authentication Daemon
    # This configuration sets saslauthd to use the system password file.
    if [ -x /usr/local/sbin/saslauthd ]; then
       echo -n ' sasl2';/usr/local/sbin/saslauthd -a getpwent -m /var/spool/postfix/var/run/sasl2/
    fi
    
  4. Copy smtpdsasl2.conf to /etc/postfix and /usr/local/lib/sasl2/smtpd.conf. Both folders? I recommend to have it also in /etc/postfix for different reasons like backups, reinstallation etc.
  5. Create the directory /var/spool/postfix/var/run/sasl2
  6. Uncomment the smtps line in /etc/postfix/master.cf
  7. Add the following line in /etc/services:
  8. smtps           465/tcp
  9. Reload postfix with "sudo postfix reload"
  10. Start saslauthd with
    sudo /usr/local/sbin/saslauthd -a getpwent -m /var/spool/postfix/var/run/sasl2/
SSL encrypted SMTP Auth should work now.
uhrig.eu.org/openbsd/
$Id: index.html,v 1.5 2008-03-28 14:30:41 volker Exp $