Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

So here's the problem: I have a webserver that's currently serving quite a number of different domain names as virtual hosts for apache. Lets say the default domain is

When I use sendmail (via PHPMailer) from, the mail that is sent has the header Received: from, even though I set the From header to

I suspect the mismatch is why these emails are being filtered as spam (from what I've read on the gmail spam filter)

What configuration in the email headers, sendmail, or postfix do I need to change to ensure emails from other virtual hosts are actually sent from their respective domain names, and thus no longer filtered as spam?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.