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 have a website in a Linode VPS in Linode.

The email address to receive emails is hosted in Google Apps, but I send emails from postfix.

For that to work and not cause problems with spam folders, I have created this SPF record:

v=spf1 ~all

Unfortunately all email gets into the spam folder, especially on Hotmail.

Reading guides and answers here in serverfault, I concluded that I need to add the ip4 info in my SPF record, like this:

v=spf1 ~all

My emails contain a header image, that is loaded remotely from the same domain. Obviously ISPS hide automatically this image, but is it a factor to classify the email as spam? Do I need anything else taking into account my setup? Is DKIM absolutely necessary?

share|improve this question
You should absolutely implement DKIM. Images in e-mail are a factor, but not a particularly big one, and generally can be worth the trade-off. Getting mail delivered to Hotmail users is very difficult. – ceejayoz Dec 11 '12 at 18:51
up vote 0 down vote accepted

You definitively need an ip4 mechanism on your record including the IP address of your server, since it is from there that you send email.

A SPF record basically says: 'The servers whose IP are listed here can send email for this domain'

Since you listed only gmail servers but are not using them to send your email but instead sending using postfix, everyone is understandably judging your email as spam. (you said your email would come from google but sent it from elsewhere).

To clarify, those are the servers your record says can send email for your domain:

sh-3.2$ dig TXT +short
"v=spf1 ?all"
sh-3.2$ dig TXT +short
"v=spf1 ip4: ip4: ip4: ip4: ip4: ip4: ip4: ip4: ip4: ip4: ?all"

It would in fact be better if you didn't have an SPF record at all instead of having the record above.

I suggest you change your record to something like:

v=spf1 ~all

DKIM is helpful, specially with Hotmail but you will get an improvement already if you fix your SPF (and if your email volumes are not too high and your email content is not spammy).

Wikipedia article on SPF may be helpful

share|improve this answer
I tested adding ip4 but I got this: Received-SPF: softfail ( domain of transitioning does not designate xxxx:xxxx::xxxx:xxxx:xxxx:xxxx as permitted sender). It seems like an ip6 address. Wouldn't be better to configure SPF like this? -> v=spf1 a ~all (I also will be sending manual emails from Gmail) – David Morales Dec 12 '12 at 12:31
So Google is picking up that IPv6 address as the address of your server? Can you paste the whole email headers? It looks like your postfix server may be misconfigured. ~all leaves the choice on the hands of the receiving ISP. If you send from both google and your server, include both IP4 address of your server and google's spf include. – Cleber Goncalves Dec 13 '12 at 11:06
I have had many problems delivering to Hotmail. I have accepted your answer, but I have switched to Amazon SES, and no problems since! – David Morales Dec 13 '12 at 14:28

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.