1

I currently have multiple network interfaces on my server. When I try to send mail, through telnet, the IP which i connect to, isn't showing up as the source ip, but the ip of eth0 is showing. I have set up multiple IP's like this: eth0:0, eht0:1 etc. When i changed the smtp_bind_address i actually got the ip which i connected through as the source ip of the email, but when i added multiple entries to this setting it couldn't send. Also when changing inet_interfaces it only works with one ip.

Anyone who can help me make it set the source IP to the one i connect to, when sending emails?

Patrick
  • 11
  • 1
  • 2
  • I assume you don't want to bind it to all interfaces? Can we get the output of `/sbin/ip address`, `/sbin/ip route` & `/usr/bin/postconf` please. – Martin May 12 '11 at 07:52

1 Answers1

2

If you are sending mails to Postfix (via one IP) it gets queued in the spooler. Then the destination is calculated and Postfix sends out the mail via the IP configured by smtp_bind_address. At this point Postfix doesn't know on which IP it was received and makes no attempts to use that (unknown) IP for outgoing mails.

When you really need a setup where the incoming IP is the outgoing IP, then you need a "multi-instance" setup of Postfix. Each instance then has to be configured for each single IP. See http://www.postfix.org/MULTI_INSTANCE_README.html

If it does not depend on the incoming IP, but the outgoing domain(s), then you can use transport maps and separate "smtp" processes in master.cf.

mailq
  • 17,023
  • 2
  • 37
  • 69