Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

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