Question

Can postfix use floating IP for outgoing mail? Can a floating IP be added to /etc/network/interfaces?

  • Posted May 13, 2016
  • DNS

I’ve got DNS records pointing to the floating IP address, but my droplet’s postfix still sends email from the public IP address, resulting in some mail being rejected since the rDNS records do not match up. I have tried to set postfix to use the floating IP address but it doesn’t work, probably because that address isn’t attached to a network interface.

Any way to get postfix to use that floating IP address?

Subscribe
Share

Hi,

I have the same problem. I already try to add an ip table POSTROUTING clause, without any luck.
(https://www.digitalocean.com/community/questions/floating-ip-gateway-as-default-router-and-source-address-for-outbound-connections).

When I try this solution, postfix cant connect to Internet with “Network not reachable”.

I already try:

  • Changing smtp_bind_address to the anchor address
  • Changing smtp_bind_address to the public address, with the iptables trick
  • Changing smtp_bind_address to the floating ip (with the same results you get)

Its very important to have control over the ip used in the email. I am afraid we can lost the ip public droplet if we destroy it.

I hope someone from Digital Ocean can help us.

Best regards,

Roberto


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

There seem to be multiple problems with using floating IPs for outbound mail:

  1. You cannot set the PTR record for the floating IP
  2. There appears to be no way to route outbound traffic via the floating IP (with iptables or adding a default gw).