Postfix relays a few domains to a fixed IP address, or its failover address.
1.2.3.4 and 11.12.13.14 (failover)
These two IP addresses are where the relay should occur.
Currently, transport_map
exemple1.com relay:[1.2.3.4]:587
exemple2.com relay:[1.2.3.4]:587
Is there a way, in case [1.2.3.4] times out, to use the failover automatically, like
exemple1.com relay:[1.2.3.4]:587
exemple2.com relay:[1.2.3.4]:587
exemple1.com relay:[11.12.13.14]:587
exemple2.com relay:[11.12.13.14]:587
Would that work?
(There is this question which is a tad different. Adding multiple IPs to /etc/hosts (or DNS if that was possible) would use either IP. In my case the failover should only be used if the main one times out)
Excerpt from Postfix 3.5 release notes
Examples:
If you don't have Postfix 3.5 you can specify the destination as a domain name without brakets - postfix will do MX lookups for that domain name and use MX to send the email.