LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-03-2009, 12:25 AM   #1
dEM0nsTAr
LQ Newbie
 
Registered: Nov 2009
Posts: 28

Rep: Reputation: 15
Question Forward port 25 to another IP to send emails


I have just installed a Debian Lenny system with Postfix and Dovecot (used http://www.debianadmin.com/debian-ma...rrel-mail.html).
The machine is a member of the Active Directory (used http://awayand.wordpress.com/2009/02...y-w2k3-server/) and it can receive emails from the Microsoft Exchange Server 2007 in the network.
The problem is that it cannot answer or send new emails to users from the Active Directory because it tries to find the Exchange Server on the same IP as the domain controller.
Is it possible to route all outgoing traffic with port 25 to another IP?
Then it should be possible to reach the Exchange Server.
 
Old 11-03-2009, 02:59 AM   #2
ptemmerman
Member
 
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75

Rep: Reputation: 15
Quote:
Originally Posted by dEM0nsTAr View Post
I have just installed a Debian Lenny system with Postfix and Dovecot (used http://www.debianadmin.com/debian-ma...rrel-mail.html).
The machine is a member of the Active Directory (used http://awayand.wordpress.com/2009/02...y-w2k3-server/) and it can receive emails from the Microsoft Exchange Server 2007 in the network.
The problem is that it cannot answer or send new emails to users from the Active Directory because it tries to find the Exchange Server on the same IP as the domain controller.
Is it possible to route all outgoing traffic with port 25 to another IP?
Then it should be possible to reach the Exchange Server.
Sure. iptables and natting is what you need here.
More precisely DNAT (destination natting).

It would look more or less like:

iptables -t NAT -A OUTPUT -p tcp --sport 25 -d any -j DNAT --to-destination DEST_IP
 
Old 11-03-2009, 04:02 PM   #3
dEM0nsTAr
LQ Newbie
 
Registered: Nov 2009
Posts: 28

Original Poster
Rep: Reputation: 15
Question

Thanks for the fast reply but it doesn't work.
But it worked with

Quote:
iptables -t nat -A OUTPUT -p tcp --dport 25 -j DNAT --to-destination IPOFEX
where IPOFEX is the IP from the Exchange Server.

Last edited by dEM0nsTAr; 11-03-2009 at 04:37 PM.
 
  


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
Any email clients which can encrypt and then forward emails based on a rule/filter? curtisa Linux - Software 1 02-01-2009 08:03 AM
Forward Emails ccarminati Linux - Server 3 07-31-2008 09:29 AM
Exim: forward sent emails to Gmail mrtwice Linux - Software 0 09-08-2007 04:17 PM
Forward emails to several local users hypernetics Linux - Software 0 11-04-2004 05:25 AM
forward emails in sendmail turbo_acura Linux - Networking 1 10-06-2004 08:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:09 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