Operating System - Tru64 Unix
1752596 Members
5525 Online
108788 Solutions
New Discussion юеВ

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 5
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