LinuxQuestions.org
Review your favorite Linux distribution.
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-03-2006, 07:07 AM   #1
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 670
Blog Entries: 7

Rep: Reputation: 31
Redirect SMTP Requests


Hi
I use outlook on my laptop to send an receive emails, however when Iam at work I have to setup a certain smtp A in hte account options when I go home i have to setup another smtp B. So what I would like to do is to keep smtp A in my outlook options, and to use the DEBIAN box I have at home to redirect traffic going sent to smtp A from my laptop to smtp B.

I have tried the following, but it does not seem to work

iptables -t nat -A PREROUTING -i eth1 -s $MY_IP -p tcp --dport 25 -j REDIRECT --to "smtpB":25
 
Old 08-03-2006, 07:11 AM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Does smtp A have an AUTH option to allow authorised smtp?

telnet smtpA 25
ehlo somename


and look for a 250 AUTH response.

This way you can use just 1 smtp server.

REDIRECT sends to localhost not externally.
You need to use DNAT instead.

Last edited by peter_robb; 08-03-2006 at 07:13 AM.
 
Old 08-03-2006, 08:41 AM   #3
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 670
Blog Entries: 7

Original Poster
Rep: Reputation: 31
Thanks Peter

iptables -t nat -A PREROUTING -i eth1 -s $MY_IP -p tcp --dport 25 -j DNAT --to "smtpB":25

Worked quite well for me
 
  


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
How can I redirect all requests for 1 ip to a different IP? with iptables abefroman Linux - Networking 1 08-31-2005 02:09 PM
Postfis SMTP forwarding and Incoming SMTP pheasand Linux - Software 0 04-27-2005 06:32 PM
Server refusing SMTP connection requests Lunch Linux - Networking 3 03-16-2004 10:06 AM
Change / Redirect SMTP Port Kernel_Sanders Red Hat 0 11-13-2003 09:42 AM
SMTP and KMail and SMTP and Netscape Mail jazz... Linux - Newbie 5 10-11-2003 04:49 AM

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

All times are GMT -5. The time now is 12:38 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration