I got a server with 8 IP addresses to use as a mail server (With PostFix). I want PostFix to rotate the IP and hostname for each message. I found the config parameter

smtp_bind_address =

(And there's another one I can't remember that does hostname) But that only lets me bind to one IP/hostname.

I have these IP's: => mail1.mydomain.com => mail2.mydomain.com => mail3.mydomain.com

The first message should be sent from, second from, third from etc. so just round-robin balancing the avaliable IPs

Is this possible with Postfix?

  • What problem are you trying to solve?
    – HTTP500
    Jul 8, 2011 at 16:30
  • @Jason It's to do with our internal mail servers. I'm not sure why but our incoming mail server will only accept a maximum of 100 emails from a single IP address per hour and the admins of that server aren't prepared to change that or white-list my servers. My application is a helpdesk app and needs to send a lot more than that so I just got a load of IPs to get around their block.
    – user80776
    Jul 8, 2011 at 16:40
  • @Jason I should probably have said, this is only for use on our internal network and will only send emails to people with email addresses on our domain
    – user80776
    Jul 8, 2011 at 16:41
  • 5
    This sort of of administrative stupidity (rate-limiting legitimate internal senders) pisses me off. You're not dealing with a technical problem here, you're dealing with a management one. I wouldn't try to fix a management problem with a technical kludge.
    – womble
    Jul 8, 2011 at 23:55

3 Answers 3


Postfix can't do that, but you could use iptables' SNAT target in conjunction with the statistics module to rotate your addresses. Something like this should do:

iptables -t nat -A POSTROUTING -p tcp --dport 25 -d <your_dest_mailserver> -m statistic --mode nth --every 8 -j SNAT --to
iptables -t nat -A POSTROUTING -p tcp --dport 25 -d <your_dest_mailserver> -m statistic --mode nth --every 8 -j SNAT --to
iptables -t nat -A POSTROUTING -p tcp --dport 25 -d <your_dest_mailserver> -m statistic --mode nth --every 8 -j SNAT --to

Take a look at the "Sender reputation" section of the Postfix 2.7 release notes. You might be able to bodge up something from it.

Otherwise, this post from the Postfix mailing list contains a statement from Wietse Venema stating that it will never be supported in Postfix. I agree with him, too -- if a recipient has put limits in place, you shouldn't try and work around them. If that causes the recipient problems, that's their problem.

  • Yes, but what if a server has to send any appreciable amount of mail to an org like AOL who sets ridiculously low rate limits and is too monolithic to ever listen to any complaints from either their users or other service providers?
    – Sammitch
    Sep 5, 2013 at 23:26
  • 2
    @Sammitch: "If that causes the recipient problems, that's their problem". You have the right to send e-mail, you do not have the right to force the recipient to receive it, and doing dodgy things like using round-robin IP addresses to get around the recipient's wishes counts as "forcing it" in my book.
    – womble
    Sep 6, 2013 at 6:08

No syneticon-dj, you are wrong, of course that postfix can do that:
see below examples:

  • 3
    Please do not post "link only" answers. Over time those sites might disappear and the answer becomes useless.
    – faker
    Aug 27, 2013 at 11:13
  • Also, this is not "postfix can do that".
    – Orphans
    Apr 19, 2021 at 14:03

You must log in to answer this question.