Posted by: jasonk2600 | November 10, 2009

Postfix SMTP Server with SASL


Install Postfix from the ports collection.  Be sure to select the Dovecot SASL options when configuring the port. At the end of the installation, be sure to answer YES to enable Postfix as the default mailer.

# cd /usr/ports/mail/postfix
# make config
# make install clean
# rehash



Set Postfix and Dovecot to automatically start at system boot and convert the Sendmail aliases file to the Postfix format.

# echo "postfix_enable=YES" >> /etc/rc.conf
# echo "dovecot_enable=YES" >> /etc/rc.conf
# newaliases

Modify /etc/rc.conf and disable sendmail by adding/changing the following settings:



Edit /usr/local/etc/postfix/ to reflect the following. NOTE: Replace with your email’s domain name.

mydomain =
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_authenticated_header = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth


Edit /usr/local/etc/dovecot.conf to reflect the following. You may change other settings for Dovecot, but the lines below are required.

auth default {
  mechanisms = plain login
  passdb pam {
  userdb passwd {
  socket listen {
    client {
      path = /var/spool/postfix/private/auth
      mode = 0660
      user = postfix
      group = postfix


Restart Postfix and Dovecot. Postfix and Dovecot are now configured to use SMTP authentication.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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 )

Google+ photo

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

Connecting to %s


%d bloggers like this: