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: 

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 user@host.domain.com, where the host is not our mail server and therefore the mails can never be responded to.

I need to override this to be user@domain.com.

How can this be done?
4 REPLIES
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 sendmail.cf file to use the masquerade (DM) option. Search for ^DM and replace it with

DMdomain.com

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

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

Re: mailx override of return address ???

On the command line..
mailx -r xxx@yyy.com -s "Subject" email_address

In sendmail.cd, check DM macro.

Now email will appear as from xxx@yyy.com

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

http://www.sendmail.org/virtual-hosting.html

http://www.sendmail.org/

If you need macro scripting: http://www.hpux.ws/buildmail.hpux.text

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

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
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 sendmail.cf 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.

Regards,

dl
sendmail.cf snipet

# masquarade as, aka site hiding(null for no masquerading)
DM gottschalks.com


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