Postfix - LUV Presentation


Introduction

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

Outgoing Mail

Incoming Mail

Aliases

Mail aliases provide:

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

root: jeremy
postmaster: root
www-data: root
joe.bloggs: joe@joesmachine.internal.net

Installation

Debian:

  1. apt-get install postfix

Red Hat:

  1. Red Hat doesn't come with Postfix but you can get RPMs from: http://www.pobox.com/~sjmudd/postfix/
  2. rpm -i postfix-xxxxxxxx-plyy.rpm

Other distributions:

Installation From Souce

  1. Download source e.g. from http://postfix.planetmirror.com.au/
  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 ./INSTALL.sh
  9. make install

Configuration

Edit /etc/postfix/main.cf:

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

Fetchmail configuration (~/.fetchmailrc):

set postmaster "foo"
poll mail.sub.net.au with proto POP3 user "bar" there with password "secret" is foo here

Testing

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 = 127.0.0.0/255.0.0.0

If you also connected to private LAN:

mynetworks = 127.0.0.0/255.0.0.0, 192.168.1.0/255.255.255.0

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/sendmail.cf /etc/sendmail.cw /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: