Simpler Navigation for Servers and Operating Systems
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.
Showing results for 
Search instead for 
Did you mean: 

change sendmail's from address

Go to solution
Jenni Wolgast
Regular Advisor

change sendmail's from address


I am trying to figure out how to change how the from address comes through when we send email using sendmail/mailx on our HP-UX servers... Right now when we use sendmail/mailx the from address comes though as @ and I want to replace with our normal email address suffix. I have been searching around and trying differnt things so this is what I have tried so far...

I first tried modifying /etc/rc.config.d/mailservs so that SENDMAIL_SERVER_NAME had our normal email suffix (it was blank) then restarted sendmail. That didn't work so I found instructions on creating a /etc/mail/userdb.db file and configuring /etc/mail/ That didn't work either and I am not at all familiar with configuring sendmail so any suggestions will be greatly appreciated and rewarded with points. :)
David Child_1
Honored Contributor

Re: change sendmail's from address


If I understand correctly you want to have your mail delivered from instead of jenni@servername (or

Try making the following change to /etc/mail/ (then restart sendmail);



Jenni Wolgast
Regular Advisor

Re: change sendmail's from address

Wow, that was really easy! I have been fighting with this off and on for year now because sometimes the messages were being caught by spam filters and we had trouble adding the system name to the safe list since it didn't end in one of the common suffixes like .com or .org... Thanks so much for your quick response!!
Tim Nelson
Honored Contributor

Re: change sendmail's from address

As mentioned the masquerade setting will take care of this.

It will change the aliased "from:" address but not the real address.

If spam filters are an issue then I suggest setting the smart relay. "DS" macro. And relay all your system emails though your real mail server ( need to tell your mail admin to allow this ).

I had to do this to get the pager and cell phone text messages to fly as all vendors do a domain lookup on the real address and typically cannot find in DNS land even though you have a spoofed address of

Honored Contributor

Re: change sendmail's from address

ya only write your domain name in the DM option.


then restart the sendmail daemon.

Thanks & Regards

Sam McKnight
Frequent Advisor

Re: change sendmail's from address

As a next step, in email you might want the external world to see your user names as something other than their login names. For instance, might be seen as You have to do is enable the userdb which you already have investigated. See hp docid UMAILKBRC00007291

The entries are of the form:

jwolqast:maildrop jenni

In order for the first "From" line to have the alias jsmcknight appear instead of the username jsm, the local delivery agent must have access to the user database. For Mlocal in, the F=@ flag allows all addresses for the local delivery agent to be written by the User Database. The F=i flag suppresses the rewrite for the sender envelope if absent or allows the rewrite for the sender envelope if present. On the Mlocal line, P=...@qm9... should be P=...@qm9i...