Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 7:52

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.