Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

Does anyone know how to change "From:" address in mailx command

SOLVED
Go to solution
John Jimenez
Super Advisor

Does anyone know how to change "From:" address in mailx command

We send out files daily to an ftp server and email our customers using mailx. The subject of the email lets the customer know who to call back or e-mail, but the customers still try and "reply" back to these e-mails. I modified /etc/mail/aliases so I can re-route it if it is sent through our internal network, but since it is not a registered name the outsied world cannot resopn.
Does anyone know of a way to modify this field to a real e-mail address so that when someone clicks reply it actually finds a real e-mail address on out network?
Hustle Makes things happen
3 REPLIES
Steven E. Protter
Exalted Contributor

Re: Does anyone know how to change "From:" address in mailx command

John,

I don't know how to fufill your request with mailx, but I do have a sendmail script that allows you to punch in valid email addresses so that replies to the email go somewhere real.

I'm attaching it. Its poorly documented, but it works good. It's a mod of something I got from HP, so they are partially responsible for the lack of documentation.

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
Patrick Wallek
Honored Contributor
Solution

Re: Does anyone know how to change "From:" address in mailx command

Check out the '-r' option to mailx.

# mailx -s "test" -r from@somewhere.com to@somewhere.com


Will create a message to to@somewhere.com from from@somewhere.com I just test this on HP-UX 11i, 11.0 and 10.20 and it seems to work.
John Jimenez
Super Advisor

Re: Does anyone know how to change "From:" address in mailx command

the -r option did the trick :) Thanks for the script too....
Hustle Makes things happen