wiki:postfix-multi-relay

Version 3 (modified by Ross, 11 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:

  • leslie.mayfirst.org (lists.mayfirst.org)
  • assata.mayfirst.org (lists.people-link.net)
  • morales.mayfirst.org (lists.portside.org)
  • mx3.mayfirst.org (listas.laneta.apc.org)

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 => "216.66.22.61",
    multi_instance_directories => [ "postfix-a" ]
  }
  m_postfix::multi_relay_instance { "postfix-a":
   smtp_bind_ip => "216.66.23.37",
   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. rustin.mayfirst.org <=> 216.66.23.37).
  • Create an A record set to a.rustin.mayfirst.org (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.:

hotmail.com	smtp:a.rustin.mayfirst.org

The line above says: relay all mail destined for hotmail.com through a.rustin.mayfirst.org.

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.

Note: See TracWiki for help on using the wiki.