2010年6月3日 星期四

Replacing Sendmail with Postfix on FreeBSD

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

Notes:
These steps seem to work on FreeBSD 5.2.1. They should work on other versions as well.
The ports collection needs to be installed.
Steps:
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:

Running Postfix inside an intranet
Delivering some users locally while sending mail as user@domain
Using Procmail for system-wide local delivery
Root's mail is delivered to nobody
Update the aliases db:

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

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

摘自:http://www.csua.berkeley.edu/~ranga/notes/freebsd_postfix.html

沒有留言:

wibiya widget