Version 3 (modified by Ross, 9 years ago) (diff)


Postfix Multi Relay

We are running two servers (rustin in Telehouse and cleveland in XO) that are configured to run multiple instances of postfix.

These servers relay mail on behalf of our servers that send bulk mail:

  • (
  • (
  • (
  • (

The relays

Currently, there is only one relay setup on rustin. The setup is handled in puppet by the following lines in rustin's pp file:

 class { "m_postfix::multi":
    smtp_bind_ip => "",
    multi_instance_directories => [ "postfix-a" ]
  m_postfix::multi_relay_instance { "postfix-a":
   smtp_bind_ip => "",
   mynetworks => $::mfpl_relaying_ips

The first stanza should be included once for each host.

The second stanza should be repeated for each relay instance on that host.

When adding a new instance:

  • Create a DNS Host record that associates the IP address to the host (e.g. <=>
  • Create an A record set to (or b or c, etc corresponding to how you have named the instance).

Using the relay

To use a relay, add an entry to /etc/postfix/transport.relay, e.g.:

The line above says: relay all mail destined for through

You will then need to run the commands:

# postmap transport.relay
# postfix flush

These commands say respectively, convert the transport.relay into transport.relay.db (so postfix can use it) and flush the mailq.

At the moment this must be done by hand on each individual server. Once fully tested, it will be handled by puppet.