Postfix on Ubuntu sending email from [email protected] instead of [email protected]

Postfix doesn't send mail.

It transfers mail to other servers and receives mail from other servers.

Sender is specified by the Mail User Agent, not the Mail Transfer Agent. Set whatever sender you want in whatever software you use to send the e-mail to Postfix for handling.

For mailutils' mail command, a man mail is suggested reading:

from The address (or a list of addresses) to put into the `From:' field of the message header. If replying to a message, these addresses are handled as if they were in the alternates list. If the machine's hostname is not valid at the Internet (for example at a dialup machine), either this variable or hostname have to be set to get correct Message-ID header fields. If from contains more than one address, the sender variable must also be set.

Try mail -a FROM:[email protected] [email protected] as a test of how to set the sender.


If you're really set on fixing this in the wrong place, you can always have a look at how Postfix can rewrite e-mail addresses. Masquerade is probably what you want:

masquerade_domains = example.com

should strip foo.example.com to example.com. But please; don't go this route. Fix the problem at the origin; the MUA that sends the e-mail to Postfix.