I'm currently using a postfix server with 4 IP (relay1, relay2, relay 3, relay4) for outgoing emails I'm using transport_maps to define for each email domain (outlook.fr, orange.fr ...) the relay to use It works well but I just realized that my postfix active queue was full, having mostly orange.fr emails, it gets quickly full as only 1 relay is defined to send emails for that domain.
What I'm trying to do is to load balance orange.fr emails between the 4 IP while keeping transport_maps to manage other email domains
I tried using sender_dependent_default_transport_maps = randmap:{relay1,relay2,relay3,relay4}
for load balancing and it works but for all domains.
In postfix release notes a solution seems given but I cannot have it to work: http://postfix.cs.utah.edu/source/official/postfix-3.0.0-RC1.RELEASE_NOTES
/etc/postfix/main.cf:
transport_maps =
# Deliver my own domain as usual.
hash:/etc/postfix/transport
# Deliver other domains via randomly-selected relayhosts
randmap:{smtp:smtp0.example.com, smtp:smtp1.example.com}
From my understanding postfix should read first transport_maps and if the domain is not found send using randmap. But in this case only randmap is working.
Summary:
If I use only transport file = emails are sent to specific relays but can't have one or more relays for a given domain If I use only randmap = emails are sent using the 4 IP but i cant specify relays for specific domains If I use transport and randmap = transport file seems ignored, only randmap is effective
Any idea how to do that?