[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: set from: address in standard command-line mailer (/usr/bin/mail)



On 10/18/2005 04:20 PM, Cameron Matheson wrote:
> Hi,
> 
> On Tue, Oct 18, 2005 at 11:04:17AM +0900, Miles Bader wrote:
>> When I send mail using /usr/bin/mail, the From: address is wrong; it's
>> apparently just prepending my user-id to my domainname.
>> 
>> How can I tell mail to use a different From: address?  I've trawled
>> through the docs, but not found an answer... [the docs are pretty weird
>> to tell the truth -- they're a flashback to about 1983, and make it
>> sound like network email is something of a novelty.]
> 
> The documentation (man page) is actually very well written and clear:
> 
>      -a      Specify additional header fields on the command line such as "X-
>              Loop: foo@bar" etc.  You have to use quotes if the string con-
>              tains spaces.  This argument may be specified more than once, the
>              headers will then be concatenated.
> 
> so.. 'mail -s "blah" -a "From: my.address@foobar.org" to.whoever@something.com


Actually, I've had frustration with this, too, before discovering that:

Exim will insert username, and not FirstName LastName, if you only have
the username field completely in /etc/passwd.  So back when I installed
debian, I had not entered first/last names.  When exim4 rewrites the
"from" using /etc/email-addresses, it prepends username as Miles describes.

Solution:  Use  /etc/email-addresses  and also the command  chfn to
CHange Full Name in /etc/passwd.  Cameron's suggestion provides another
approach, but it won't help for programs that use exim directly, like
reportbug, for example.

Regards,
Ralph



Reply to: