I want to loadbalance outbound emails via multiple IPs, is there any built-in tool or some easy way to do it with postfix, sendmail or exim? for example if I assign three IPs to the email server and emails are sent via all the ips one by one.
If you want send mails from different Ip's from a single mail server than you should think about postfix multiple instance on a single host. And you can assign a different Ip address for each instance and your null instance will submit mails for each instance. for more detail you may refer these links This one for how to assign Ip and all http://souptonuts.sourceforge.net/postfix_sbr.html and this for all basic information how we create and how instance works http://www.postfix.org/MULTI_INSTANCE_README.html
With Postfix 2.7 or later it's pretty easy.
First create one entry for each IP in master.cf, like this:
Then create a sender dependent transport map in main.cf, like this:
Comment out all the other transport_maps in main.cf, like this:
Now here is the trick, this transport table will be using RAND() to randomize usage of all the out[1..n] transports listed in master.cf.
In /etc/postfix/config/transport_roundrobin.cf write:
Finally, create a table called 'transport_roundrobin' on db 'dbname' running on 'dbhost' and insert one row for each transport:
Postfix will select a random row from the transport_roundrobin mysql table and then use the value obtained to select the corresponding transport in master.cf. Each transport will use a different ip address, according to -o smtp_bind_address