Messaging
cancel
Showing results for 
Search instead for 
Did you mean: 

Sendmail configuration problems

SOLVED
Go to solution
jacks0n
Occasional Contributor

Sendmail configuration problems

Hi,

I'm currently in the process of building a new bastion host to handle all incoming mail for the company.

Essentially, it will live in the DMZ and perform some high level, basic checks on the emails like:
Size is < 100MB, mail is destined for either domain1.com, domain2.com, domain3.com or else discard i.e. no relaying, and basic reverse lookup of originating sender to ensure it's a valid host

All mail that passes these checks is forwarded on to a windows mail server on the internal network which does all of the spam filtering, lower level stuff. None of the mail will be delivered to the local host, all passed on to the windows mail server for processing.

I'm having trouble making sendmail accept mail for these three domains and then relaying all mail to the windows server... it's trying to deliver all mail locally.

I've tried using relay-domains file and defining the domains in this file but no luck.

I've tried defining LOCAL_DOMAIN(`domain1.com'), LOCAL_DOMAIN(`domain2.com') etc. in sendmail.mc (Or C{w}domain1.com in old sendmail.cf speak).
This appeared to work as sendmail was then accepting mail which was destined for these domains and rejecting any mail destined for other domains but still it was trying to deliver mail locally.
I've got the windows server setup as the smart relay and I've removed the MAILER(`local') entry from sendmail.mc, leaving only MAILER(`smtp') so I would expect everything to be being passed through to the relay?

Sendmail version is 8.12.10

What am I missing?
5 REPLIES
Ermin Borovac
Honored Contributor

Re: Sendmail configuration problems

Have you tried using access database from allow relaying to/from these domains?

/etc/mail/access
domain1.com RELAY
domain2.com RELAY
domain3.com RELAY

You should also have FEATURE(`access_db', `hash /etc/mail/access') in your m4 file.

# makemap hash /etc/mail/access < /etc/mail/access
jacks0n
Occasional Contributor

Re: Sendmail configuration problems

Looks like it's working now but it doesn't reject attempts to relay emails which aren't addressed to either Domain(1,2,3).com

Am I able to add an entry which rejects all mail addressed to any other domain?
Ermin Borovac
Honored Contributor
Solution

Re: Sendmail configuration problems

Try changing /etc/mail/access as follows

To:domain1.com RELAY
To:domain2.com RELAY
To:domain3.com RELAY

See /usr/newconfig/etc/mail/cf/README for more examples.
jacks0n
Occasional Contributor

Re: Sendmail configuration problems

Works like a charm!

Thanks!
Bejoy C Alias
Respected Contributor

Re: Sendmail configuration problems

U can also use FEATURE(`nullclient', `server') in ur sendmail.mc to relay all the mails to the machine 'server'
Be Always Joy ......