Send all outgoing email trough one IP address in postfix

When a server has more than one IP address, then postfix will use all IP addresses randomly to send out emails. This can cause your emails to be listed as SPAM on other servers because the sending IP does not match the reverse IP of the server hostname. The solution is to bind postfix to the primary IP address of the server.

Edit the postfix file:

nano /etc/postfix/

and add the line:

smtp_bind_address =

were has to be replaced with the primary IP address of the server. Multiple IP addresses can be separated by comma, example:

smtp_bind_address =,

Then restart postfix:

service postfix restart

7 thoughts on “Send all outgoing email trough one IP address in postfix”

  1. Leider ist die Lösung hier überhaupt nicht hilfreich. Wenn man unter ISPConfig 3 den Postfix wie angegeben konfiguriert werden die Mails von AMAVIS nicht mehr angenommen und es geht gar nichts mehr raus.

    Sinnvoller ist die folgende Anpassung in der /etc/postfix/

    smtp unix – – – – – smtp
    -o smtp_bind_address= unix – – – – – smtp

  2. I need to do this (staring to get blocked by hotmail, aol, yahoo, etc – no reverse found, even though I have set it), and did it yesterday. Then I had no working mail. No mail was being processed or delivered. I also tried modifying the /etc/postfix/, which contained smptd_bind_address= to our principal server IP, and that did not help either. Connections were “lost” immediately after connection the logs show. Additionally amavis could not connect.

    In the file there is a line: for smptd, and there are lines referring to amavis with see in both files, I believe. I don’t know if all references to need to be changed to our main IP in both files, or not?

    Can you give any further advice on this, please? I have the “perfect server deb squeeze, courier postfix, fail2ban … set up the way your tutorial describes it with ISPConfig3.

    Thanks for any further advice.

    • The lost error is from Amavis, as it wants to talk through and not your smtp IP.

      In Debian the easiest way to fix this is by adding this to main.cnf:

      inet_interfaces =,
      smtp_bind_address =

      And create a file in /etc/amavis/conf.d/ (ie 60-custom) with is in it:

      @inet_acl = qw( [::1] );

      (where is the IP you have postfix sending from)

      Restart Postfix and Amavis, and it should all work 🙂

  3. Hi,

    instead of a primary ip address from the web server, could be a secondary ip address? I just do it and at the first sight, everything works well.


Leave a Comment