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.
Showing results for 
Search instead for 
Did you mean: 

mailx override of return address ???

Rob Marshall_2
Occasional Contributor

mailx override of return address ???

I need to modify my return address as it currently gives, where the host is not our mail server and therefore the mails can never be responded to.

I need to override this to be

How can this be done?
Sridhar Bhaskarla
Honored Contributor

Re: mailx override of return address ???

Hi Rob,

Use "-r" flag with mailx.

If you are the SA of the box and you want to globalize it, then edit file to use the masquerade (DM) option. Search for ^DM and replace it with

The users that are specified with "CE" macro will be exempted from masquerading. So, look for the option also.

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

Re: mailx override of return address ???

On the command line..
mailx -r -s "Subject" email_address

In, check DM macro.

Now email will appear as from

There is no substitute to HARDWORK
Steven E. Protter
Exalted Contributor

Re: mailx override of return address ???

For more on sendmail config that can help with this:

If you need macro scripting:

That last link is specifically for HP-UX's sendmail implementation.

Steven E Protter
Owner of ISN Corporation
Dave La Mar
Honored Contributor

Re: mailx override of return address ???

Rob -
Ran into this a few years back. Wanted users to send out mail but have the return point to their outlook address.
Did so with two steps -
1. Modified the to reflect the outlook server adressing.
2. created a user db to convert the unix user name to outlook user name.
Snip of bothe below.

Best of luck.


dl snipet

# masquarade as, aka site hiding(null for no masquerading)

userdb entries snipit

# run makemap -r btree /etc/mail/userdb.db < /etc/mail/userdb
# /sbin/init.d/sendmail stop
# /sbin/init.d/sendmail start
andyimm: mailname andy.imm
andy.imm:maildrop andyimm
dlamar: mailname dave.lamar
dave.lamar:maildrop dlamar
"I'm not dumb. I just have a command of thoroughly useless information."