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

To support more domain names and non-system accounts we have recently reconfigured postfix to use virtual domains.

For receiving mail this is working well but when mail is sent it is often marked as spam by receiving mail servers because the mail is marked as coming from 'localhost' rather than the real host/domain name as it was prior to the change to virtual domains.

In these lines are set:

myhostname =
mydomain =
myorigin = $mydomain
+ other settings for virtual domains
mydestination is commented out as all domains are virtual.

These seem to make no difference to the sending domain.

Ideally mail should be marked as coming from '' or '' depending on the sending domain. If that is not possible then marking it as coming from anything other than 'localhost' would be fine. Could anyone point out the settings that are missing or wrong please?

EDIT In the received email the 'return path' is correct, 'localhost' occurs in the line:

Received: from localhost ([a.b.c.d]) by

share|improve this question
What is sending the mails? – mgorven Jul 16 '12 at 6:01
It is a standard postfix/dovecot setup – blankabout Jul 16 '12 at 6:44
No, I mean what is the mail client which is submitting these mails to Postfix to be sent. – mgorven Jul 16 '12 at 6:45
Various clients, including Mac Mail and Outlook. Postfix is also invoked by several programs to send reports etc. – blankabout Jul 16 '12 at 8:31
are you sure your problem is myorigin? is 'localhost' in the From header or somewhere else? sounds more like broken rDNS or wrong HELO. – Gryphius Jul 16 '12 at 8:44

Received: from localhost

sounds like your smtp HELO is not configured correctly. from your description you have set the myhostname parameter in , but didn't reload postfix after that

try running postfix reload and confirm with postconf myhostname. If this doesn't return now you are probably editing the wrong in that case run postconf -e 'myhostname =' and postfix reload

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.