LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-06-2007, 03:58 PM   #1
izghitu
Member
 
Registered: Oct 2005
Location: localhost.localdomain
Distribution: CentOS
Posts: 109

Rep: Reputation: 16
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
 
Old 08-06-2007, 05:22 PM   #2
dimavo
LQ Newbie
 
Registered: Apr 2001
Location: Sydney, Australia
Distribution: CentOS
Posts: 17

Rep: Reputation: 0
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
 
Old 08-07-2007, 12:41 PM   #3
izghitu
Member
 
Registered: Oct 2005
Location: localhost.localdomain
Distribution: CentOS
Posts: 109

Original Poster
Rep: Reputation: 16
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
 
Old 08-08-2007, 04:00 AM   #4
gani
Member
 
Registered: Jun 2004
Location: Metro Manila, Philippines
Distribution: Linuxmint, Slackware
Posts: 356

Rep: Reputation: 34
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.

-------
 
Old 08-08-2007, 04:04 AM   #5
izghitu
Member
 
Registered: Oct 2005
Location: localhost.localdomain
Distribution: CentOS
Posts: 109

Original Poster
Rep: Reputation: 16
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
 
Old 08-08-2007, 04:22 AM   #6
gani
Member
 
Registered: Jun 2004
Location: Metro Manila, Philippines
Distribution: Linuxmint, Slackware
Posts: 356

Rep: Reputation: 34
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.

-------
 
Old 08-08-2007, 11:45 AM   #7
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
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.
 
Old 08-08-2007, 10:04 PM   #8
gani
Member
 
Registered: Jun 2004
Location: Metro Manila, Philippines
Distribution: Linuxmint, Slackware
Posts: 356

Rep: Reputation: 34
Yes you are right.

-----
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception in thread "main" java.lang.ClassFormatError: onmyown.Main (unrecognized cla zimboney Fedora 4 07-20-2007 01:00 PM
How do you setup dansguardian/squid to redirect to main acceptance page? blkcamarozr28 Linux - Software 0 07-02-2007 01:57 PM
redirect the default main website cccc Linux - Networking 1 08-11-2006 11:52 AM
Redirect SMTP Requests ALInux Linux - Networking 2 08-03-2006 07:41 AM
Change / Redirect SMTP Port Kernel_Sanders Red Hat 0 11-13-2003 08:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration