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

I am having some issues with emails getting sent from one of my websites using the PHP mailer. When I am using my own email server with spamassassin the emails come through without a problem, but with gmail and hotmail they go straight to the junk box! I can't for the life of me figure out why.

I've tried several things including setting up SPF (no idea if I did it properly though).

I used the Brandon Checketts website to run an email test and the SpamAssassin score from the email came back as 1.1 which indicates it is okay... I've run out of ideas!

Here is the full report from Brandon Checketts.


I tried to use DKIM as a way of resolving this issue but I'm now having a problem with that. I'm getting this error message from Brandon Checketts:

result = fail
Details: message has been altered
share|improve this question
if you set up SPF for, you didn't do it properly ;) – Mathias R. Jessen Jul 30 '12 at 17:17
I did an allaboutspam report as well… – nmford Jul 30 '12 at 17:21
What do the headers look like after the message is scanned? What rules got triggered? – Grant Keller Jul 30 '12 at 18:13
Hi grant, I posted an update in the post. Please let me know if this provides some more insight. – nmford Jul 30 '12 at 18:22

Well, the obvious answer is that spamassassin, gmail and hotmail all have different criteria for deciding what's spam and what isn't. Because the criteria are different, the way any given email is handled may be different. It's really as simple as that.

It's probably going to take a bit of tweaking and experimentation to come up with one that doesn't trip the junk mail flag in gmail and hotmail, but this is definitely not the best place to ask for advice about that.

share|improve this answer

Well, they do sort of look like junk at first glance. Likely Gmail and Hotmail have seen so many of that sort of message that they automatically consider any similar messages junk.

The first thing I would do is fix the mailing list software so that it's sending both HTML and plain text in the message.

share|improve this answer
Here's the allaboutspam report by the way… – nmford Jul 30 '12 at 17:17
Hey Michael, I did some reading and found out that using DKIM is a good way to fix the issue with the major mail hosts. I attempted this but hit a stumbling block, I posted an update to my main post with the info from it. – nmford Jul 30 '12 at 18:23

It looks to me like you are failing rDNS validation. The PTR record for your IP address should return the domain address of your server. Your server should use its FQDN (Fully Qualified Domain Name) in the HELO message.

Get your IP provider to change the PTR record to return PTR records that contain their IP address in the name are a very good indicator of SPAM.

share|improve this answer

Make sure your DKIM and SPF stuff is set up right. Gmail's headers are useful for this, but much better is setting up DMARC, whereupon gmail and hotmail will start sending you reports about how your mail is being handled.

The reports you receive will be in XML. You can benefit from just eyeballing a few, but you'll get more out of it with some sort of reporting tool.

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.