LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 01-27-2010, 02:03 PM   #1
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Rep: Reputation: 16
Routing incoming mail to another SMTP server


Hi,

I have CentOS 5.4 installed with Postfix/Webmin. This server currently receives mail successfully for the following 3 domains:

domain1.com
domain2.com
domain3.com

I recently set up 2 MS Exchange servers (to accommodate calendaring and shared mailboxes) behind the CentOS server.

exchange1.mydomain.local
exchange2.mydomain.local

These two exchange servers have been set to accept incoming mail from my CentOS server only.

Essentially, what I want to do is configure my Centos box to forward any and all mail incoming to domain1.com to exchange1.mydomain.local, and have all mail incoming to domain2.com forward to exchange2.mydomain.local.

Essentially, I want the linux box to act as a front-end spam firewall. So far, I've been unable to do this successfully with Postfix and I'm willing to try any other MTA's in order to get this working.

Any suggestions would be much appreciated. Thank you.
 
Old 01-27-2010, 02:07 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
postfix's relayhost setting, and possibly telling it that it is NOT the final destination for domain[1-3].com
 
Old 01-27-2010, 03:40 PM   #3
never say never
Member
 
Registered: Sep 2009
Location: Indiana, USA
Distribution: SLES, SLED, OpenSuse, CentOS, ubuntu 10.10, OpenBSD, FreeBSD
Posts: 195

Rep: Reputation: 37
Actually, I think he needs transport maps. They allow you to define a forward for each domain, where as relay host basically says if you don't know what to do send it here.

Quote:
# TRANSPORT(5) TRANSPORT(5)
#
# NAME
# transport - Postfix transport table format
#
# SYNOPSIS
# postmap /etc/postfix/transport
#
# postmap -q "string" /etc/postfix/transport
#
# postmap -q - /etc/postfix/transport <inputfile
#
# DESCRIPTION
# The optional transport(5) table specifies a mapping from
# email addresses to message delivery transports and/or
# relay hosts. The mapping is used by the trivial-rewrite(8)
# daemon.
#
# This mapping overrides the default routing that is built
# into Postfix:

...
open /etc/postfix/transport in your favorite editor scroll to the bottom and add line like this:

Quote:
domain1.com smtp:exchange1.mydomain.local
domain2.com smtp:exchange2.mydomain.local
next run:
Quote:
postmap /etc/postfix/transport
reload postfix and you should be ready.

Now for a couple of notes.

If your exchange server is sending mail out, please use a real domain and not .local otherwise you may have problems with mail being blocked RFCs require you to use a valid domain name.

If your exchange servers are forwarding outgoing mail to the postfix server, this shouldn't be a problem as long as postfix has a valid domain name.

Personal comment:
Quote:
exchange YUK! (Sorry, hard core Groupwise man here.) My Groupwise server was up for 3 years with ZERO downtime, until a prolonged power outage took the server down. Just can't do that with exchange.
 
  


Reply



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
Change Incoming and Outgoing Mail Server (Redhat Linux) Njabulo Linux - Newbie 1 06-29-2009 09:19 AM
eth0: incoming, eth1: outgoing on mail server ryanz Linux - Networking 1 12-28-2005 07:50 PM
Cron mail sending using outside SMTP mail server Utah Linux - Software 6 08-24-2005 07:44 PM
Postfis SMTP forwarding and Incoming SMTP pheasand Linux - Software 0 04-27-2005 05:32 PM
Postfix mail server not accepting incoming mail from the external interface rexmundi Linux - Networking 7 12-22-2003 03:41 PM

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

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