Nasser Heidari


SMTP Auth – Postfix and SASL (Debian)

Filed under: Linux — Nasser Heidari @ 07:06
# apt-get install sasl2-bin libsasl2 libsasl2-modules

Now edit /etc/default/saslauthd:


Now we should create /etc/postfix/sasl/smtpd.conf :

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN

Ok, let’s add some lines in /etc/postfix/ to enable SASL:

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination

postfix does a chroot so it can’t communicate with saslauthd. This is the tricky part:

# rm -r /var/run/saslauthd/
# mkdir -p /var/spool/postfix/var/run/saslauthd
# ln -s /var/spool/postfix/var/run/saslauthd /var/run
# chgrp sasl /var/spool/postfix/var/run/saslauthd
# adduser postfix sasl 

Now restart postfix and start saslauthd

# invoke-rc.d postfix restart
# invoke-rc.d saslauthd start

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: