Use a different IP for sending mail

If you find yourself in a pinch and you need a temporary fix when your primary IP is blacklisted, use the following iptables rule:

/sbin/iptables -t nat -A POSTROUTING -p tcp --dport 25 -j SNAT --to-source [desired outgoing ip]

Keep in mind, however, that you will need to adjust any applicable SPF records for your domains since your e-mail will appear to be leaving via one of the secondary IP's on your server. Also, remember that this is only a temporary fix - you should find out why you were blacklisted and eliminate that problem as soon as possible. :-)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Printed from: http://rackerhacker.com/2007/08/27/use-a-different-ip-for-sending-mail/ .
© Major Hayden 2010.

1 Comment   »

  • Ashutosh says:

    Hello sir,
    I want to use a different IP for sending mail. But i don't know where and how to use that code (/sbin/iptables -t nat -A POSTROUTING -p tcp --dport 25 -j SNAT --to-source [desired outgoing ip]) in asp.net.

    Please HELP !!!

RSS feed for comments on this post , TrackBack URI

Leave a Reply