LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   redirect SMTP from main IP to secondary (https://www.linuxquestions.org/questions/linux-networking-3/redirect-smtp-from-main-ip-to-secondary-575187/)

izghitu 08-06-2007 03:58 PM

redirect SMTP from main IP to secondary
 
Hi,

I have the following issue:

My main IP is blacklisted at hotmail.com because of the previous owner of the IP. Trying to get delisted from hotmail did not help.

Is it possible to redirect SMTP going out through the main IP to go out through a secondary IP using iptables?

If yes, can someone please tell me how?

Please help

Thanks

dimavo 08-06-2007 05:22 PM

Is there a server managing the secondary connection? If yes, does it do routing for you already?
If both links are connected to the same server, it is very easy, something along the lines of
Code:

/sbin/iptables --table nat --append POSTROUTING --out-interface eth1 -j
MASQUERADE /sbin/iptables -A PREROUTING -t nat -p tcp -s 10.1.1.2/32 --dport
25 -j DNAT --to 192.168.0.4


izghitu 08-07-2007 12:41 PM

Hi,

THanks for your reply

Everything is happening on the same server

I have the primary IP 2.2.2.2
the secondary IP 2.2.2.3

I ran the following:
/sbin/iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
/sbin/iptables -A PREROUTING -t nat -p tcp -s 2.2.2.2 --dport 25 -j DNAT --to 2.2.2.3

then ran sendmail mail@mail.com < /dev/null
looked at the headers and I see nothing related to 2.2.2.3

am I doing something wrong?

Thanks

gani 08-08-2007 04:00 AM

The easiest thing to do is use your ISP's smtp as your smtp relay for outgoing mails. I'm sure your ISP would permit you to do this since you are their subscriber.

Contact your ISP and get their smtp host.

-------

izghitu 08-08-2007 04:04 AM

If you read carefully you will see that not my PC's IP has problems, it's my server who is blacklisted by hotmail and I host multiple domains there. I can't tell my clients to use another SMTP

Thanks

gani 08-08-2007 04:22 AM

I'm sure we are talking about your public IP that has been blacklisted and this IP might have been through your router/firewall or your mail server is directly connected to the internet. Which ever the case, it is your public IP that has been blacklisted.

What I mean for using your ISP's smtp server is you would tell your sendmail server to relay through your ISP's smtp and not your local clients. Your local clients would still relay through your sendmail server and nothing would be changed on their MUA's settings.

In postfix there is a parameter in main.cf called "relay_host" that is used for this purpose and in sendmail, you have to look for its equivalent.

-------

rossonieri#1 08-08-2007 11:45 AM

Quote:

Originally Posted by gani
I'm sure we are talking about your public IP that has been blacklisted and this IP might have been through your router/firewall or your mail server is directly connected to the internet. Which ever the case, it is your public IP that has been blacklisted.

imho : will not be wise to block IPs right now - since IPs can be change overtime. but domain name will remain, and harder to change (from black-listed point of view).

the solution is implementing SMTP security both inbound and outbound - lets say doing cleaning-service in both direction :)

HTH.

gani 08-08-2007 10:04 PM

Yes you are right.

-----


All times are GMT -5. The time now is 04:36 AM.