Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mailx - how to change mail from address?

Status
Not open for further replies.

wallst32

MIS
Apr 14, 2003
545
US
When I send e-mails using mailx, the "mail from" address is username@hostname.mydomain.com. While this works fine internally, many e-mail servers on the public internet will drop these messages since @hostname.mydomain.com is not a registered domain. How can I change the "mail from" address to username@mydomain.com?

Thanks.
 
By the way, if there is a command line switch I can use to change it only for specific emails that would be great; or a global setting would work as well.
 
try:

mailx -r username@mydomain.com recipient@domain.com

Regards,
Chuck
 
cspilman - Great, that works; thanks. I did find the "-r" option searching online, but I think what I had done wrong before was not specify "-r sender recipient" in one continous string.
 
You can also play with the DM option in /etc/mail/sendmail.cf.

# who I masquerade as (null for no masquerading) (see also $=M)
DM

I used to mess with friends from other companies by changing this. I'd send them email that looked like it was from themselves. Ah, the good old days...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top