postfix - weakish/cheat GitHub Wiki

Basic postfix setup

On Debian:

apt-get install postfix

During configuration, select "internet site" (the default).

Email forwarding

We will forward all mail to root to an external address. Sadly, this is not allowed for security reasons. So we first forward mails to a local user. And forward this local user's mail to an external address, which is allowed.

echo 'root:    foo@localhost' >> /etc/aliases

Update the alias database:

newaliases

Forward to external address:

echo [email protected] >> ~/.forward
chown foo ~/.foddrward