Posted by: jasonk2600 | November 10, 2009

Postfix SMTP Server with SASL

Installation

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

 

Configuration

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:

sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

 

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

mydomain = yourdomain.com
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.

 

 [EoF]
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

Categories

%d bloggers like this: