Operating System - HP-UX
1830039 Members
1738 Online
109998 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.
10 REPLIES 10
Steven E. Protter
Exalted Contributor
Solution

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

Two possible ways that I can think of:

1) hostname slight of hand
servera becomes servera.your.net in /etc/rc.config.d/netconf

That will have all outbound mail be fully qualified unless relayed.

Problem is hpux does not support more than 8 characters that way. server1.investmenttool.com won't work.

2) Use DNS slight of hand to do the job. Server's nsswitch.conf file will have to be set to dns first. /etc/resolv.conf must point to valid dns servers.

Take out the Dj directive and the hostname will be the sender. username@yourhostname.com

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
Sridhar Bhaskarla
Honored Contributor

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

John,

Configure a mailx exchanger/Smart relay host so that it will take care of hand-shaking with the remote hosts. Specify it in your sendmail.cf file (DS Macro).

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
John McKiernan
Advisor

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

System has three interfaces :
IF#1 : forward facing, default route
IF#2 : backward facing to application
IF#3 : Management, including e-mail

"hostname" = IP address of IF#1, not in DNS
"hostname-m" = IP addr of IF#3 ; is in DNS

DS record in sendmail.cf is set; relay gets message from "hostname" of IF#1 , but that is not in DNS . Even though mail passed over IF#3 and could have used a name in DNS, it still used the name for IF#1 .
Mail relay rejects message since the noted source (in headers) is a name not in DNS .
I can't ask relay to turn off reverse lookup.
Steven E. Protter
Exalted Contributor

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

So you can't relay. Too bad. Sri's solutions are usally easier to implement than mine.

Based on your last post I'd recommend you set up a local dns server for each interface.
You need to be very, very careful that nobody uses that server except the server.

Here is my idea:

IF#1 : forward facing, default route
IF#2 : backward facing to application
IF#3 : Management, including e-mail

Make this server a relay server. You'll still need DNS entries to support the hostnames. You'll need to set up public dns entries in your forward facing DNS server to allow servers (like mine) that reject without reverse lookup.

Designate one of the interfaces as the primary mail exchanger and have that one relay mail for the other two interfaces.

This is a complex solution, but I can't think of anything else now that relaying won't work.

Lets say IF#3 is the primary mail interface. It relays mail for the other two. The trick here is to make sure all mail goes through interface 3 and it can resolve public names.

It might be easier to take an old hp-ux server that you were planning to take out of service and do this:

1) One NIC internal. One NIC external, with a DNS entry that is fully qualified and supported on the public internet.

2)All needed hp-ux servers relay their mail through this special mail server.

This last idea seems to take the complexity out of my earlier ideas. All you need is hardware. Doesn't take much server do to this, an entry level box can do the job.

Fascinating situation, a real brain stretcher.

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
Sridhar Bhaskarla
Honored Contributor

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

Hi,

Did you try masquerading with 'hostname-m' (DM macro) in sendmail.cf?.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

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

I believe it may work if you set both your Djhostname-m.FQDN and 'DMhostname-m.$FQDN' in your sendmail.cf because hostname-m is in deed a legal DNS entry.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Steven E. Protter
Exalted Contributor

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

Bingo Sridar,

masquerading might actually work here.

Here is a script to let you utilize the macro database with hp-ux

http://www.hpux.ws/buildmail.hpux.text

May need work on 11i v1.6 and v2

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` ?

In review, the HP-UX systems work fine without any changes except the "Dj" option.
I'm still trying to get our Red Hat RHEL 3.0 systems with similar setup to work,
an none of the options any have suggested
have worked. When I find a solution, I
will post it.
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.
John McKiernan
Advisor

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

See notes.