Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 '15 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.