Postfix - LUV Presentation


Postfix is a Mail Transfer Agent (MTA) that is:

Outgoing Mail

Incoming Mail


Mail aliases provide:

Aliases are stored in /etc/aliases. They look like:

root: jeremy
postmaster: root
www-data: root



  1. apt-get install postfix

Red Hat:

  1. Red Hat doesn't come with Postfix but you can get RPMs from:
  2. rpm -i postfix-xxxxxxxx-plyy.rpm

Other distributions:

Installation From Souce

  1. Download source e.g. from
  2. untar the Postfix tar.gz file
  3. go into the directory that was created
  4. read the README and INSTALL files first!
  5. make
  6. create a user called postfix
  7. in /etc/aliases:
    root: <username> postfix: root postmaster: root
  8. run ./
  9. make install


Edit /etc/postfix/

myhostname = hostname.domainname
myorigin = $myhostname
mydestination = $myhostname, localhost.$mydomain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

Dialup Configuration

If you are unfortunate enough to be on dialup:

Apply Configuration

If you updated /etc/aliases you'll first need to run:

To apply the changes you made to the configuration:


Fetchmail configuration (~/.fetchmailrc):

set postmaster "foo"
poll with proto POP3 user "bar" there with password "secret" is foo here


Some suggestions for testing your MTA:

Advanced Configuration

It is possible that by default Postfix will allow mail to be relayed from through it by default.

This could be abused by spammers

On a stand alone host set:

mynetworks =

If you also connected to private LAN:

mynetworks =,

Removing sendmail

In Debian when you install Postfix through apt-get you don't need to remove sendmail manually.

Under Red Hat you will have to remove sendmail manually. Here's what to do (as root):

  1. mkdir /root/sendmail-old
  2. cp /etc/aliases /etc/ /etc/ /etc/mail/* /root/sendmail-old/
  3. rpm -e sendmail sendmail-doc sendmail-cf --nodeps
  4. killall sendmail

Where to now?

Where to go for more information:

For general Linux Documentation:

The End

To contact me by electronic mail: