Note

Instructions are for debian (and probably works for ubuntu and friends too). Easiest way to getting it to work in fedora is through dovecot’s sasl2. See dovecot configuration and postfix configuration

Install sasl dependencies

sudo apt-get install libsasl2-modules sasl2-bin

Create /etc/postfix/sasl/smtpd.conf:

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN

Create /etc/default/saslauthd-postfix

cp /etc/default/saslauthd /etc/default/saslauthd-postfix

Edit /etc/default/saslauthd-postfix

START=yes
DESC="SASL Auth. Daemon for Postfix"
NAME="saslauthd-postf"      # max. 15 char?
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"

Create subdirs:

dpkg-statoverride --add root sasl 710 /var/spool/postfix/var/run/saslauthd

Add group (maybe not required?)

adduser postfix sasl

Reset and enable saslauthd

sudo systemctl restart saslauthd
sudo systemctl enable saslauthd

Config postfix

sudo postconf -e 'smtpd_sasl_local_domain = $myhostname'
sudo postconf -e 'smtpd_sasl_auth_enable = yes'
sudo postconf -e 'broken_sasl_auth_clients = yes'
sudo postconf -e 'smtpd_sasl_security_options = noanonymous'
sudo postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination'

Reset postfix

sudo systemctl restart postfix