Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

At the moment, I have a RHEL6 monitoring server that sends out emails with postfix. Originally it was sending them out as user@host.localhost.

I've used the mapping file /etc/postfix/generic to get the emails sent out now as monitoringuser@domain.com, however when the email client receives the email, there is no longer a name attached to the email address.

Originally, with the default configuration, emails would come in with the sender as this -
user <user@host.localhost>
Now when I recevied the emails, they come in with just the email address -
monitoringuser@domain.com - there is no longer a name displayed.

I've googled and looked at docs but can't seem to figure out the way to do this.

Is there a way for postfix to fix that or append the name that I want ? Or is it up to the script calling mail to append a name to the sender ?

share|improve this question
Just a guess: does user exist as a real user (/etc/passwd) on the system with a GECOS field of user and maybe there is no monitoringuser entry in /etc/passwd? – Anthon Nov 28 '13 at 5:56
user does exist, but monitoringuser doesnt. So maybe if I add a monitoringuser into /etc/passwd, it would add a name ? – Lawrence Nov 28 '13 at 6:08
I would try to do so. user has to come from somewhere, either stripping the address from @ onwards, or (more likely IMHO) from the GECOS field (5th, comment field in /etc/passwd), did you check the value of the field? – Anthon Nov 28 '13 at 6:40
I've updated /etc/passwd but still don't get the name when receiving emails from the monitoringuser – Lawrence Nov 28 '13 at 7:53
Did you include the gecos field? What script is sending the mail? Can you share that? – Anthon Nov 28 '13 at 8:34
up vote 1 down vote accepted

Turns out the GECOS field needs to be filled in for the original user, not the user that the emails are being masqueraded to appear to be from.

share|improve this answer

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.