TIP: Use a random IP address from an pool of addresses with Exim

April 21, 2012 at 08:21 AM | categories: Tips, Exim, Linux | View Comments

Create a lookup file /etc/exim/ips.txt with

1: xxx.xxx.xxx.1
2: xxx.xxx.xxx.2
3: xxx.xxx.xxx.3
4: xxx.xxx.xxx.4

Set the transport to:

remote_smtp:
  driver = smtp
  interface = "${lookup {${randint:5}} lsearch {/etc/exim/ips.txt}}"

randint will return a random number between 1-4 which is then looked up in the file and used if you have more ip's just add to the list and increment the randint value to number ips + 1


blog comments powered by Disqus