I need to configure alternative smarthosts for the same domain with a
defined order of preference (and different smarthosts for other
domains).

One solution is to not use smarthosts in Postfix but instead configure
MX records in the local DNS server, as suggested by Viktor here:
http://postfix.1071664.n5.nabble.com/Postfix-and-multiple-smarthosts-td29123.html

That doesn't work for me because I need to support multiple smarthosts
on different port numbers.

A possible alternative solution:

1. Define a smtp transport service in master.cf for each domain that
needs smarthosts (~20 max).
2. Configure a different fallback list for each transport using -o
smtp_fallback_relay, specifying the non-primary smarthosts for the
domain, in priority order.
3. Add a transport table entry for each domain that specifies the
correct transport name for the domain and the primary smarthost as the
nexthop.

Would this work?

Some smarthosts may require authentication and some not, but I think I
can configure that globally in main.cf using smtp_sasl_password_maps
indexed by host name.  (Not sure if I could select different
credentials for different smarthosts that have the same host name but
different ports, but that's a tiny corner case hopefully.)

TIA,
Rob

Reply via email to