Operating System - Linux
1834220 Members
2948 Online
110066 Solutions
New Discussion

Can I make "sendmail" use another name != 'hostname` ?

 
SOLVED
Go to solution
John McKiernan
Advisor

Can I make "sendmail" use another name != 'hostname` ?

We have several systems behind firewalls or using private (RFC-1918; 192.168.x.y) addresses on some interfaces. The system name as seen via "hostname" is often using these private addresses and DNS staff don't want those names/addresses in DNS. But if
the same system sends mail, it goes out as if it was from a system not in DNS , and reverse lookup from relays fails. When that fails, the message is refused, and mail is blocked.

How can I get "sendmail" to send messages using another source address/name which is in DNS but is *NOT* the "hostname" ? I created a "Dj" record in "sendmail.cf" and set a FQDN for the outgoing interface in /etc/hosts . But the messages in local logs and the returned mail still show "sendmail" used the
"hostname" data.

4 REPLIES 4
Stuart Browne
Honored Contributor
Solution

Re: Can I make "sendmail" use another name != 'hostname` ?

MASQUERADE_DOMAIN(`your.external.domain')

in your MC file, re-make your CF files and try again.
One long-haired git at your service...

Re: Can I make "sendmail" use another name != 'hostname` ?

The correct sendmail.cf code is DM{FQDN} not Dj. And is not normally setup in the default cf files on Redhat.. Use the mc file and ADD the code in the previous post..
Steven E. Protter
Exalted Contributor

Re: Can I make "sendmail" use another name != 'hostname` ?

You can do a manual edit of sendmail.cf or you can do it with sendmail macros.

Attaching the script to let you follow Stuart's recommendation.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
John McKiernan
Advisor

Re: Can I make "sendmail" use another name != 'hostname` ?

Never found a solution, so we added the required source names to DNS as a (bad) workaround.