Changing Postfix Outbound IP Address

Published on: Mon, Jan 25, 2016 at 4:30 pm EST
FAQ Linux Guides Server Apps

When a server has more than one IP address assigned to it, Postfix randomly selects an IP address for outbound emails. This default Postfix behavior can result in emails being listed as spam due to the sending IP not matching the IP address to which the server hostname is resolving.

The solution is to bind Postfix to the server's primary IP, or the IP to which the server's hostname is resolving.

Using your favorite text editor, open the Postfix configuration file:

vim /etc/postfix/main.cf

Add the line:

smtp_bind_address = 192.168.0.1

Where 192.168.0.1 has to be replaced with the primary IP address of the server.

Then, restart Postfix:

/etc/init.d/postfix restart

Want to contribute ?

You could earn up to $300 by adding new articles