Configuring Sendmail to pass all mail for a domain to an Exchange server

Running Sendmail 8.12.10 on a Redhat Linux 9.0 Enterprise machine. This server sits in a DMZ. Its hostname is "ns1priv" in the local domain "priv.local". We have masqueraded the domain so that outgoing mail shows as "user@domain.com". Now we need to have this box accept all mail for "domain.com" and route it to an Exchange server that sits on the inside network.
At this point, testing mail sent from the Internet to "user@domain.com" returns a "user unknown" message as the user doesn't exist on the localhost.
How can we configure Sendmail to pass all the mail that is for our "domain.com" into the Exchange server? Without becoming an open relay, of course.
Thanks,
Jeff
SysdeathAsked:
Who is Participating?
 
jlevieCommented:
There are three ways to have the Sendmail box forward mail it receives for your domain to your exchange server, as follows:

1. You can use virtusertable or aliases to explictly forward mail for each user to their account on the  exchange server. This has the disadvantage of requiring you to maintain a user list on the Sendmail server but has the advantage of reducing the load caused by spammers since Sendmail will reject mail for accounts that don't exist.

2. Use mailertable

3) Include "define(`LUSER_RELAY', `smtp:xchange.domain.com') in your sendmail.mc.

(2) and (3) both will relay everything that is addressed to user@domain.com, whether the address is valid or not.
0
 
owensleftfootCommented:
You need to look at the Smarthost option in sendmail.cf
0
 
SysdeathAuthor Commented:
Thank you.
Used # 2, but had to empty the local-host-names file so it receives no mail locally, but relays all the mail for domain.com.

Jeff
0
 
JohnnyLingoCommented:
Yeah, mailertable is the best way to go.  The rule in /etc/mail/mailertable would be:

domain.com <tab> relay:exchange.domain.com

And domain.com would be in /etc/mail/relay-domains (not /etc/mail/local-host-names).  If you're running the relay_based_on_mx feature, both files can be empty.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.