Tuesday, September 2, 2008

Postfix on FreeBSD - Maildir delivery

Suppose you have a clean FreeBSD install and you want to get Postfix as your MTA.

Current setup:

  • OS: FreeBSD 7.0-RELEASE
  • SHELL: bash
  • no previously installed MTA present on the system

Create a system user, say test. Then create the Maildir for this user:

# su test
$ cd ~
$ mkdir -p Maildir/{cur,new,tmp}
$ chmod -R 700 Maildir
$ exit
#

Then let's get on with the Postfix thing:

# pkg_add -rv postfix

If this line is not present in /etc/rc.conf:

# echo 'sendmail_enable="YES"' >> /etc/rc.conf
# /usr/bin/newaliases
# postconf -e home_mailbox="Maildir/"
# postfix start

You're done. Now every mail sent to a user (who of course has his "Maildir/" in place) will arrive in the /home/user/Maildir/new directory.

1 comment: