Replacing Sendmail with Postfix on FreeBSD

The following steps can be used to replace sendmail with postfix on FreeBSD.

Notes: Steps:
  1. Install postfix from /usr/ports/mail/postfix-current:

    # cd /usr/ports/mail/postfix-current
    # make install

    The install will ask to create the postfix group and to enable postfix in /etc/mail/mailer.conf.

    The updated mailer.conf(5) should look like the following:

    # 
    # Execute the Postfix sendmail program, named /usr/local/sbin/sendmail
    #
    sendmail        /usr/local/sbin/sendmail
    send-mail       /usr/local/sbin/sendmail
    mailq           /usr/local/sbin/sendmail
    newaliases      /usr/local/sbin/sendmail
  2. Stop sendmail:

    # /etc/rc.d/sendmail stop
  3. Disable sendmail:

    1. Disable starting sendmail on boot:

      # echo 'sendmail_enable="NONE"' >> /etc/rc.conf
    2. Disable building sendmail during buildworld:

      # echo "NO_SENDMAIL=true" >> /etc/make.conf
    3. Disable sendmail's daily cron jobs by putting the following /etc/periodic.conf:

      daily_clean_hoststat_enable="NO"
      daily_status_mail_rejects_enable="NO"                                      
      daily_status_include_submit_mailq="NO"
      daily_submit_queuerun="NO"
  4. Enable postfix:

    # cd /usr/local/etc/rc.d
    # ln -s /usr/local/sbin/postfix postfix.sh
  5. Configure postfix. The following entries in the Postfix FAQ are useful:

  6. Update the aliases db:

    # /usr/local/bin/newaliases
  7. Start postfix:

    /usr/local/etc/rc.d/postfix.sh start

Valid HTML 3.2

$Id: freebsd_postfix.html 1023 2008-11-28 07:31:02Z ranga $