What is postfix?

Well, I think the postfix website gives a good enough definition for our purposes.

"Postfix attempts to be fast, easy to administer, and secure, while at the same
time being sendmail compatible enough to not upset existing users. Thus, the
outside has a sendmail-ish flavor, but the inside is completely different."
-- http://www.postfix.org/

Goals

The goal of this how to is to setup postfix for local mailbox delivery only.

Required packages:

postfix

Postfix Installation

Step 1: Install Postfix

[root@computer]# pacman -Sy postfix

Step 2: Check /etc/passwd, /etc/group

Make sure that the following shows up in /etc/passwd

postfix:x:73:73::/var/spool/postfix:/bin/false

Make sure that the following shows up in /etc/group

postdrop:x:75:
postfix:x:73:

Note: Postfix can be made to run in a chroot. This document does not currently cover this. Might be added later.

Postfix Configuration

Step 1: Edit /etc/postfix/main.cf

The only things you need to change are as follows. Uncomment them and modify them to the specifics listed below. Everything else can be left as installed by pacman.

If you want to control where the mail gets delivered and which mailbox format is to be used, you can do this by setting

home_mailbox = /some/path

or

mail_spool_directory some/path

mail_spool_directory is an absolute path where all mail goes, while home_mailbox specifies a mailbox relative to the user's home directory. If the path ends with a slash ('/'), messages are stored in Maildir format (direcory tree, one message per file); if it doesn't, the mbox format is used (all mail in one file).

Examples:

mail_spool_directory = /var/mail (1)
home_mailbox = Maildir/ (2)

1) All mail will be stored in /var/mail, mbox format

2) Mail will be saved in ~/Maildir, Maildir format

Step 2: Edit /etc/rc.conf

Add postfix to the daemons list. Make sure you put it after the network has started.

Step 3: Edit /etc/postfix/aliases

Namely, put a username in for the the following, substituting the correct username you desire (actual system account required) for USER