The following steps can be used to replace sendmail with postfix on FreeBSD.
Notes: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
Stop sendmail:
# /etc/rc.d/sendmail stop
Disable sendmail:
Disable starting sendmail on boot:
# echo 'sendmail_enable="NONE"' >> /etc/rc.conf
Disable building sendmail during buildworld:
# echo "NO_SENDMAIL=true" >> /etc/make.conf
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"
Enable postfix:
# cd /usr/local/etc/rc.d # ln -s /usr/local/sbin/postfix postfix.sh
Configure postfix. The following entries in the Postfix FAQ are useful:
Update the aliases db:
# /usr/local/bin/newaliases
Start postfix:
/usr/local/etc/rc.d/postfix.sh start