2008/12/01

Postfix with multiple relay hosts

As I have my mailbox collected in home server, I also have setup SMTP service using postfix on the home server for outgoing email.
Netvigator limited the outgoing SMTP port connectivity, I can only connect to smtp.netvigator.com, but for company email, I have to use the company SMTP server in order to send to mailing list addresses.
After some trial and error, I failed to set multiple outgoing relay hosts, but finally found a method to do that, by "transpot_maps" parameters and define some addresses/domain vs smtp server hosts, so that postfix will connect to different hosts according to the receiver addresses.

http://www.postfix.org/postconf.5.html#transport_maps