Prerequisites:
FreeBSD 8.2-RELEASE
Author: Ren Blevins
This is a real basic setup to get things up and working. Once they are, then we'll add spam and AV to it. One thing at a time.
Postfix is an MTA used everywhere. It’s easy to use, configure, and stable. You can read more about it by visiting http://www.postfix.org/.
This tutorial installs Postfix version 2.8.2,1.
Install Postfix via ports:
1. Become super user.
prompt# cd /usr/ports/mail/postfix
prompt# make install && make clean
Select [X] PCRE, [X] DOVECOT 1.x, [X] TLS, and [X] MYSQL from the menu.
Note:
After the Postfix application is finished building and starts
installing, it will prompt you with a question similar to:You need user "postfix" added to group "mail".
Would you like me to add it [y]? “y”Would you like to activate Postfix in /etc/mail/mailer.conf [n]? “y”
Press “y” and then continue with the install.
Shut down Sendmail:
prompt# /etc/rc.d/sendmail forcestop
NOTE:
If the above command doesn’t not shut down Sendmail, you’ll have to manually kill the PIDs. You can either find the PIDs and kill them (2) individually or you can run the following command:
prompt# for i in `ps auxwww|grep sendmail|awk '{print $2}'`;do kill $i;done && exit
Edit /etc/rc.conf to disable Sendmail and start Postfix at boot:
Add these lines to the bottom of the file:
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
postfix_enable="YES"
And you can disable some sendmail specific daily maintenance routines in your /etc/periodic.conf file:
daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"
If /etc/periodic.conf does not exist please create it and add those values.
Edit /etc/aliases file:
Change "root" to an email address you want system messages to be mailed to: root: you@your-domain.tld
I do know /etc/aliases is a sim link to /etc/mail/aliases and there are two aliases.db files.
One in /etc and one in /etc/mail.. So I delete the one in /etc and sim link it to /etc/mail.
prompt# ln -s /etc/mail/aliases.db /etc/aliases.db
Postfix was looking in /etc should just have one file anyway.
re-hash the aliases.db file:
prompt# /usr/bin/newaliases
READ the Basic Postfix config guide first. Then continue.
Edit /usr/local/etc/postfix/main.cf
myhostname = host.domain.tld ... mydomain = domain.tld ... mydestination = localhost.$mydomain, localhost
Start it up and test it out.
prompt # /usr/local/etc/rc.d/postfix onestart
Check the maillog for any issues.
All done. Good Luck.
Originally all Howto, config, setups, and supporting documentation was researched and compiled so we could find working solutions for our particular environment. We primarily run and develop FreeBSD 7.2, 8.2, and Mac OS X 10.6 Clients and servers.

Post new comment