View Single Post
  #29 (permalink)  
Old 04-17-2009, 12:41 PM
fverbeek fverbeek is offline
New Member
 
Posts: 3
Talking another technique, for a slightly similar problem

I wanted postfix to send messages through a secondary IP address (failover address, not in a cluster, just a simple manual failover) instead of the primary address on the interface.
smtp_bind_address is not possible as explained above, and inet_addresses doesn't work for binding when sending, apparently.
After playing with postfix' config around for a while, I took the alternative route :

Code:
iptables -t nat -A POSTROUTING -o eth0 \
    -s the_primary_ip_addresses \
    -p tcp --dport 25 \
    -j SNAT --to  the_ip_address_you_want_used
kinda ugly, but does the trick. Still listening on all addresses (including localhost), always sending through the chosen address
Just got to make sure it's documented somewhere....
Reply With Quote