Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 main.cf these lines are set:


myhostname = mail.example.com
mydomain = example.com
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 'mail.example.com' or 'mail.example2.com' 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 mail.receivingserver.com

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

1 Answer 1

Received: from localhost

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

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

share|improve this answer

Your Answer

 
discard

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.