LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-13-2011, 01:50 PM   #1
rsduhamel
LQ Newbie
 
Registered: Apr 2011
Posts: 5

Rep: Reputation: 0
Using postfix to relay to MS Exchange allowing only mail to my domain


I'm using Ubuntu Server 10.04 and I can successfully relay mail generated by php scripts through an Exchange server.

What I want to do is accept incoming mail from the Internet through postfix and relay it to the Exchange server but I want all mail that is not addressed to ...@mydomain.edu to be discarded.
 
Old 05-13-2011, 02:51 PM   #2
tva
Member
 
Registered: Jul 2010
Location: Finland
Distribution: Open SUSE 13.1
Posts: 83

Rep: Reputation: 8
Well, you only need to relay .@mydomain.edu to your exchange so other domains remain for postfix to decide whether discard or what to do to them.

So basically you need

entry in /etc/postfix/transport
Code:
mydomain.edu smtp:ip.address.of.your.exchange.server
entry in /etc/postfix/main.cf

Code:
transport_maps = hash:/etc/postfix/transport
I also have

Code:
relay_domains = $mydestination, hash:/etc/postfix/relay
And in /etc/postfix/relay I have

Code:
mydomain.edu OK
Then you need to
Code:
postmap /etc/postfix/transport
postmap /etc/postfix/relay
and reload postfix.
 
Old 05-13-2011, 05:34 PM   #3
rsduhamel
LQ Newbie
 
Registered: Apr 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the quick reply. I'll try that ASAP.

My goal is to prevent Exchange from being an open relay. Yes, I know that you can configure Exchange not to be an open relay but my server doesn't seem to get the message (got blacklisted once already). I don't want postfix to be an open relay either. I would just as soon have it dump any mail not to my domain. Any further advice, if necessary, would be greatly appreciated. Thanks.
 
Old 05-13-2011, 11:24 PM   #4
tva
Member
 
Registered: Jul 2010
Location: Finland
Distribution: Open SUSE 13.1
Posts: 83

Rep: Reputation: 8
If exchange isn't getting mail from other sources than your postfix you should add postfix-servers ip to allowed sender ip's and deny all others on that machine. Can't really remember exact place from top of my head, somewhere in SMTP connector IIRC. Might depend on exchange version, but I could look that up if you need help on that and tell me your server version. (2003/2007/2010)
 
  


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
how to make postfix only relay certain domain mail? jimmyjiang Red Hat 7 02-06-2013 06:08 AM
Postfix+Dovecot error : RELAY ACCESS DENIED when send mail out to Other domain simon.unix Linux - Networking 6 09-16-2009 10:54 AM
Postfix user@domain restricted mail relay configuration bntawil Linux - Server 1 07-22-2008 05:35 PM
Sendmail to relay domain specific mail to internal MS Exchange 2003??? Wolfy Linux - Networking 4 06-22-2007 10:23 PM
Postfix - Allowing Mail Only to Specific Domain zok Linux - Networking 1 04-22-2007 03:18 AM

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

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