Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

DNS Overriding External Gateway for Sendmail

Don Ritchey
Frequent Advisor

DNS Overriding External Gateway for Sendmail

I have a system that provides monitoring services and needs to send pages to our paging service via e-mail. I had set the system up to send any mail outside our company's domain to the external firewall's mail gateway, while all internal mail is processed through the company's internal mail system (which is subject to intermittent delays due to volume).

I am now finding that sendmail is ignoring the specified gateway and sending all mail, regardless of destination (internal or external) through the internal mail system as specified in the MX records in our DNS.
If I disable DNS and add all the needed addresses for the monitored systems into the /etc/hosts file, I can get sendmail to behave as expected.

How do I get sendmail to do what is specified in the HostName.cf and sendmail.cf files (send all mail not in my company's domain to the external gateway)?

Thanks,

Don
5 REPLIES
Ivan Ferreira
Honored Contributor

Re: DNS Overriding External Gateway for Sendmail

Run mailsetup again, like this example:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=972928
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ivan Ferreira
Honored Contributor

Re: DNS Overriding External Gateway for Sendmail

Also, the smart host is used only when the server cannot resolve the MX for the tomain, if you server can resolve the MX for all domains, then the smart host won't be used.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Don Ritchey
Frequent Advisor

Re: DNS Overriding External Gateway for Sendmail

I need to override the mail routing provided by the MX records for external e-mail destinations. I have used mailsetup to create a gateway destination to handle those external addresses. Why is sendmail overriding the explicit instructions to use that gateway address?
Ivan Ferreira
Honored Contributor

Re: DNS Overriding External Gateway for Sendmail

As I said before, if you can resolve the MX, you won't use the general purpose relay or smart host.

If you want to ignore MX records returned by DNS, you need to use mailertable.

I never done this on Tru64 Unix, but should be something like:

Edit the mc file for your host:

vi hostname.m4

Add:

FEATURE(`mailertable',`hash -o /var/adm/sendmail/mailertable.db')dnl

Create the .cf file:

m4 -D_Configfile=hostname.m4 sendmail m4 > sendmail.cf

Add the following to the mailertable:

domain.com smtp:[your_mail_server]

Restart the service
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Don Ritchey
Frequent Advisor

Re: DNS Overriding External Gateway for Sendmail

I am disappointed that there doesn't appear to be a clean way to override the MX records from the local DNS zone to permit a system to route mail directly for specialized purposes. I have found a work-around that appears to do the trick for this system, but I am reluctant to trust this as a permanent solution to the issue.

I modified the "_RelayAll" variable to true in the HostName.m4 file, rebuilt, and restarted sendmail. This yields the desired result (mail to our paging providers goes directly out to the firewall and bypasses our glacial Microsoft Exchange system).

Thanks to all for the advice and pointers, since it led me to the workaround.

Don