Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

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
add comment

1 Answer

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 _spf.google.com TXT +short
"v=spf1 include:_netblocks.google.com ?all"
sh-3.2$ dig _netblocks.google.com TXT +short
"v=spf1 ip4:216.239.32.0/19 ip4:64.233.160.0/19 ip4:66.249.80.0/20 ip4:72.14.192.0/18 ip4:209.85.128.0/17 ip4:66.102.0.0/20 ip4:74.125.0.0/16 ip4:64.18.0.0/20 ip4:207.126.144.0/20 ip4:173.194.0.0/16 ?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

share|improve this answer
    
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 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 Dec 13 '12 at 14:28
add comment

Your Answer

 
discard

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.