• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 728
  • Last Modified:

How to force Sendmail to send outbound email from a list of multiple source IP addresses bound to one Interface so the received from header is different with each outbound email.

I want the received from source IP address to be different each time, not just after failover.  Assume I setup a list of 127 IP addresses bound to 1 NIC and that each time I send an email through Sendmail I want it to select the IP to use for delivery either randomly or run through a list of IP addresses serially.
0
dmaislin
Asked:
dmaislin
  • 2
  • 2
2 Solutions
 
aa789Commented:
If you have access to your DNS server (or you can set one up on the same system), I would set up a DNS entry for outgoing.<yourdomain> with 127 A records in it, and a very short TTL (time to live). DNS tends to go through the A records sequentially. Thenyou set your outgoing sever to that outgoing.<yourdomain> address.
0
 
jar3817Commented:
Sendmail doesn't work that way. You can have it listen on all 127 addresses, but it is always going to send out mail on the primary address on the interface (not the 126 aliases).

You can however do this with iptables on the mailserver:

iptables t nat A POSTROUTING s 1.2.3.4 j SNAT -to 1.2.4.2-1.2.4.128

This basically says if the source address (-s) is 1.2.3.4, whatever the primary address sendmail uses for sending out, rewrite it to an address in the range of 1.2.4.2 to 1.2.4.128 (your 127 aliases). I've only ever SNAT'd to 1 address, not a range, but I saw a few webpages that say you can do it. Give it a shot.

http://www.web-articles.info/e/a/title/SNAT-with-iptables/ 

0
 
jar3817Commented:
arg, pasted from a website with an obviously different character encoding....

iptables -t nat -A POSTROUTING -s 1.2.3.4 -j SNAT --to 1.2.4.0-1.2.4.32
0
 
dmaislinAuthor Commented:
Let me discuss these options with others and see which option is the best option.  The Sendmail is installed on a custom kernel.  Not sure which option will be supported until I login tomorrow.
0
 
dmaislinAuthor Commented:
As we all know, the best option would be not to mess with IP, employ DKIM, SPF, Queue Groups, Rate Throttling, etc., but I did think that this is one of the more creative option I have seen to date.
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now