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 = 1.2.3.4
(And there's another one I can't remember that does hostname) But that only lets me bind to one IP/hostname.
Example;
I have these IP's:
1.1.1.1 => mail1.mydomain.com
1.1.1.2 => mail2.mydomain.com
1.1.1.3 => mail3.mydomain.com
[etc]
The first message should be sent from 1.1.1.1, second from 1.1.1.2, third from 1.1.1.3 etc. so just round-robin balancing the avaliable IPs
Is this possible with Postfix?
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:
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.
No syneticon-dj, you are wrong, of course that postfix can do that:
see below examples:
http://marinovl.blogspot.com/2012/09/postfix-how-to-balance-outgoing-emails.html
http://www.kutukupret.com/2010/12/06/postfix-randomizing-outgoing-ip-using-tcp_table-and-perl/