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 include:_spf.google.com ~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 ip4:xxx.xxx.xxx.xxx include:_spf.google.com ~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?

  • 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

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 _spf.google.com TXT +short
"v=spf1 include:_netblocks.google.com ?all"
sh-3.2$ dig _netblocks.google.com 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 ip4:xxx.xxx.xxx.xxx ~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

  • I tested adding ip4 but I got this: Received-SPF: softfail (google.com: domain of transitioning info@example.com 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 include:_spf.google.com ~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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.