1

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?

srchulo
  • 317

1 Answers1

4

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.

NickW
  • 10,289