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
  • 306
  • 1
  • 2
  • 10
  • 1
    Do you mean that your senders will be relaying via the IP they connect to? – NickW May 31 '16 at 08:57
  • 1
    Yes. I have two IPs on the server, and whichever IP the senders send to I would like to be the IP used publically when relaying. – srchulo May 31 '16 at 19:16

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,263
  • 1
  • 20
  • 27
  • 1
    Thanks! I think that running two separate postfix instances is the easiest/cleanest way to do this. – srchulo May 31 '16 at 19:17