September 23rd, 2010, 01:49 AM
Secondary mailserver and e–mail forwards
Hello, I think I'm in a unique situation where I am trying to setup a secondary mail server which will forward most e-mail traffic to the commercial internet(gmail/hotmail/etc) but will send some email to the primary mail server when it comes back online.
One concern I have is with mailing lists (GNU Mailman) which users can make changes to via the web interface, where e-mail messages are archived, and the fact that some users receive only the daily digest option. I would ideally like to setup the secondary/backup mail server to forward certain e-mail accounts to the internet and other e-mail accounts to the primary mail server, which will be sent once the primary mail server actually comes back online.
Currently we use Postfix but I’m open to any mail server that can support my needs.
Thanks for any ideas and suggestions!
September 23rd, 2010, 11:09 AM
This shouldn't really be a big problem to do both, especially since you are using Postfix. The big question I have is this. You say you want messages being forwarded out to the internet; where are these messages coming from? A process on the same machine? An internal network? You aren't setting this up as an open relay, are you?
Now really, the only thing that should be going to the primary mail server are emails for domains that it is authoritative for; i.e. the primary MX record destination.
The relay portion from my first paragraph needs answers before anyone can help you with that part of the config. As far as being the secondary mx for domains, that's as simple as setting them in the relay_domains parameter:
It is recommended to also specify a relay_recipient_maps entry if at all possible to go with relay_domains. This is a list of all the valid addresses for each recipient. That way, you won't be a source of backscatter since, with just the relay_domains specified, Postfix will accept mail for any address at the domain and then end up bouncing the message if the user doesn't exist. See "man 5 postconf" and read the section for "relay_domains" and "relay_recipient_maps" for more info.
relay_domains = example.com , example2.com ,
hash:/path/to/file/of/domains , ldap:/path/to/ldap/config
badger badger badger badger
badger badger badger badger
September 23rd, 2010, 03:22 PM
Hi, thanks for your reply.
The messages will come from the internet as well as from users sent from inside the LAN.
We have about 5 domains which we are the primary MX for.
So for example the primary MX is down. Someone on the internet sends a message to user1(at)mydomain.com which is actually an alias to forward to some_user(at)gmail.com The message will go to the secondary MX since the primary is down. The secondary MX gets the message, sees that primary MX is down, sees the user1(at)mydomain is just a forward to gmail, and sends it off to gmail.
The other example would be
Someone on the internet sends a message to list1(at)mydomain.com which is list which is handled through GNU Mailman. Secondary MX gets the message, and holds on to it until primary MX is online for delivery.
Hope this makes sense! Thanks for any help.