2009-03-27

Using Linux Mail command to send out "Display Name"

When sending out email through Linux mail command, the program will fetch the user information through options or configuration files. A typical scenario is the user's description in /etc/passwd ( or a central NIS server passwd file), will be include in the email header "From=user@domain.com (user description)". And in a outlook client, the "user description" will be display in "From" colum.

Here is the problem, sometimes, the user description in password file is not for a good summary for the user, it may contain some other inforamtion for the administrators. Then the user need change this field manually when sending out email.

Two options to do that,

mail -r "123@123.com (I am 123)" 456@456.com
or
env from="123@123.com (I am 123)" mail 456@456.com

Then the receiver will see a email from "I am 123" in Outlook.

No comments: