Server Fault is a question and answer site for system and network administrators. 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

I've just setup djbdns and qmail on a debian lenny server. I test sending to my gmail account with qmail-inject, the mail gets there but is in the spam folder. How can I fix this?

share|improve this question

It will depend a lot on why it was classified as spam. Here are a couple of things to look at:

  • Is the "from" address you're sending from valid? E.g., could you send back to it from GMail? GMail may be checking to see if there's a route back.
  • Does the domain that the "from" address references use SPF? If so, is this server allowed to send email for the domain?
  • If this is a server you've acquired recently from a hosting company, is the IP address you're assigned a known "spam source" address? (E.g., because someone was using that address to send spam before the hosting company shut them down.) If you search for "spam blacklist" and such you'll find links helping you check that.
share|improve this answer
In addition to SPF, it's always a good idea to configure DomainKeys (DKIM) to sign all outgoing mail for your domain. It can significantly reduce chances of correspondence originating from your server to be sent to Junk folder by any properly configured mail service (including GMail). – Ilya Zakreuski Oct 11 '09 at 15:21
  1. Check if your IP is blacklisted in
  2. Check if your IP has a proper Reverse DNS
  3. If it goes to SPAM folder sometimes and goes to Inbox other times, and if you are sending HTML emails, check if HTML formatting is ok.

This would be in addition to the checks mentioned above.

share|improve this answer

Check the headers of your message in Gmail, with the "Show original" option of the dropdown menu next to the "Reply" button.
The Gmail SMTP server adds headers to your message ("Received", "Received-SPF", "Authentication-Results", ...) that can provide useful information.

share|improve this answer
same problem here, although SPF=pass and reverse DNS is also set up correctly – solsol Nov 11 '10 at 17:33

Your Answer


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