Skip to main content

Postfix use outgoing IP based on incoming IP used [Resolved]

I am using Digital Ocean's Floating IPs on my mail server. So I have two publicly available IPs that the server can use, and I would like to use whichever IP was used to reach the Postfix server as the identifying IP when Postfix relays the email. I found this answer, which is close, but it chooses which IP to use as the outgoing IP based on the domain of the email it's sending, not the IP address that was used to access the machine. Does anyone know if this is possible?


Question Credit: srchulo
Question Reference
Asked June 8, 2016
Posted Under: Network
20 views
1 Answers

I'm going to assume that you have looked into running multiple postfix instances?

There are variations you could do (this for example), but they'll involve using the different IPs with different domain names (so you can assign SSL certs to them), and either running one instance which submit internally to different ports in amavisd, then re-injects to different internal ports in postfix, and using these "pathways" you can ensure that mail that comes in on one IP gets sent via that IP. The other option is running two sepearate instances of postfix on the machine, with separate mailqueues, so each postfix instance just deals with its own IP.


credit: NickW
Answered June 8, 2016
 
Thanks! I think that running two separate postfix instances is the easiest/cleanest way to do this. – srchulo May 31 at 19:17
 CanDoerz  3 years ago
Your Answer
D:\Adnan\Candoerz\CandoProject\vQA