Postfix, "From:" address, command line

Bruno Wolff III bruno at
Fri Dec 16 15:05:30 UTC 2005

On Fri, Dec 16, 2005 at 15:51:06 +0100,
  Rakotomandimby Mihamina <mihamina.rakotomandimby at> wrote:
> Hi,
> I sometimes send mail through command line interface this way:
> $ print "short message" | mail -s "your log/pass" test at isp.tld
> The problem is the "From:" address: it is a bit ugly.
> I would like to set the "From:" address of that system user to be a more
> esthetic one.
> I am running Fedora Core 4, and postfix-2.2.2 (Fedora build)
> I heard about a file named /etc/mailaddress or something like that but I
> cant find it out on google, or in the archives (I dont remember the
> exact name). I think in that file I just have to fill it like this:
> [...]
> user1 : localpart at isp.tld
> [...]
> And then it's OK. But i really lost the file name, and dont know if it
> would be efficient on my Fedora.

You could inject the mail using postfix's injection program. (The equivalent
of sendmail or qmail-inject.) This allows you to include headers along
with the body of the message.
The other option is to use a more powerful mail client such as mutt to send
the message. Something like:
print "short message" | mutt -e 'set from="This is a test <test>"'  -s "your log/pass" test at isp.tld

More information about the fedora-list mailing list