Operating System - HP-UX
1752707 Members
5718 Online
108789 Solutions
New Discussion юеВ

How to remove host part in the "To" field in sendmail

 

How to remove host part in the "To" field in sendmail

Hi,

I have a hpux server that relays mail to an exchange server with sendmail.
If you send a mail from this server with eg. mailx and skip the @domain.com in the "To" field, sendmail adds @hostname.domain.com to the "To" field.
How do I configure sendmail not to insert the hostname part.
If you send mail with address user@domain.com, then sendmal doesn't apply it's host name in the "to" field.
3 REPLIES 3
Rick Garland
Honored Contributor

Re: How to remove host part in the "To" field in sendmail

In the sendmail.cf file is a feature to MASQUERADE AS. Search the sendmail.cf file for 'masquerade' and this will get you to the DM setting.

DMyourhost.com

This will remove the host name.

Rick Garland
Honored Contributor

Re: How to remove host part in the "To" field in sendmail

Forgot, make sure you bounce the sendmail daemon after making the changes.
Steven E. Protter
Exalted Contributor

Re: How to remove host part in the "To" field in sendmail

sendmail is accepting the default @hostname.domain.com on the emails because it has not been told to do anything else.

There is a directive in the sendmail.cf file that will let you change it.

Djdomain.com

save the file.

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

done.

It can also be corrected in a more automated way with a sendmail .mc macro file. Let me know if you are interested in that procedure.

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