Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

When I send a mail via php mail then postfix rewrites the from address like this.

For example:

From: info@mydomain

The from becomes: username@myhosthame

How can I stop this from happening? I want postfix to preserve the from address.

share|improve this question
up vote 1 down vote accepted

To fix the domain, you have to set the myorigin paramater in It defaults to myhostname.

As to why the user is rewritten, by default local_recipient_maps is set to only allow mail from users with an account on the machine, or a defined alias. From

local_recipient_maps = proxy:unix:passwd.byname $alias_maps
share|improve this answer
Thx, setting myorigin = $mydomain works. I am halfway there. I am just trying to figure out now how to replace "username" with ïnfo, so I get the "info@mydomain" email instead of "username@mydomain" – giorgio79 Aug 29 '13 at 4:00
Found this… – giorgio79 Aug 29 '13 at 6:15

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.