Linode Forum
https://forum.linode.com/

Command line sending mail with different "From"?
https://forum.linode.com/viewtopic.php?f=11&t=7900
Page 1 of 1

Author:  devon [ Tue Oct 11, 2011 12:09 am ]
Post subject:  Command line sending mail with different "From"?

I followed the linode library article of setting up Exim4 on Ubuntu 10.04. I am able to send e-mail out fine.

My question is how do I specify a different "From" address for the e-mail on the command line?

I am doing this for simple testing purposes and the fact that I have multiple domains pointing to the same server.

Author:  tonyyarusso [ Tue Oct 11, 2011 12:19 am ]
Post subject: 

mail -a "From: Fake Person <fakey@gmail.com>"

Author:  devon [ Tue Oct 11, 2011 1:01 am ]
Post subject: 

Thank you! That worked. After testing this it brought up another question. When viewing the raw text of the e-mail message sent using this it will show it came from my original domain name (what is displayed by hostname -f):
Received: from mydomain.com ([72.14.xxx.xxx])

Is it possible for it to show the domain that I am actually sending from? I have two virtual hosts/domains served by Apache and the "Received: from" would always indicate the hostname -f even when I send an e-mail that is supposed to appear from the other domain. The From field displayed in the e-mail client does display correctly.

Author:  hoopycat [ Tue Oct 11, 2011 8:46 am ]
Post subject: 

Not generally; your system has one hostname, which is used to identify itself whenever it needs to know its name. The best workaround might be to use a hostname under another, neutral domain (like a domain for your company/department, if other companies or departments are your "customers"). If worse comes to worse, the default lixxx-yyy.members.linode.com hostname works too.

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/