Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is it possible to rewrite in postfix the local user that is sending email from the shell. I'm able to masquerade root@localhost to using smtp_generic_maps without a problem.

Unfortunately if I email somewhere like gmail the email is coming from "root (". What would be the best way to manipulate root to something like "User Name"?

share|improve this question

2 Answers 2

It depends on how you "send mail from the shell."

You're looking at a message From: header, which is part of the e-mail message, and hence not of interest to an MTA like postfix.

When using sendmail(1), set a proper sender address in the RFC822 message you pass to it.

FOr details on how to provide a proper sender address in your chosen mail program, consult its documentation.

share|improve this answer

Postfix us getting 'root' from /etc/passwd. Type vipw and change the 5th field.

share|improve this answer
Changing the root entry in /etc/passwd does not sound like the best idea. Especially since the email is not even intended to be send with root as the sender adderss. – kasperd Jun 13 at 22:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.