Postfix mails goes to hotmail junk

bindemailoutlookpostfixspf

I have a problem that I can't solve which is whenever I send an email from my mail server to Hotmail, it gets into the Junk folder.

I'm using CentOS 6.3, SELINUX is disabled.

Here are my named zone file entries:

$ORIGIN egycart.com.
$TTL 86400
@   IN   SOA    dns1.egycart.com.   hostmaseter.egycart.com. (
    2001062501  ; serial
    21600       ; refresh after 6 hours
    3600        ; retry after 1 hour
    604800      ; expire after 1 week
    86400    )  ; minimum TTL 1 day

             IN      NS     dns1.egycart.com.
             IN      MX     10  mail.egycart.com.
             IN      A      41.41.68.66

dns1         IN      A      41.41.68.66
dns2         IN      A      216.224.167.54
egycart.com. IN      A      41.41.68.66
mail         IN      A      41.41.68.66
egycart.com. IN      TXT    "v=spf1 a mx -all"
mail         IN      TXT    "v=spf1 a mx -all"
mail         IN      SPF    "v=spf1 a mx -all"
www          IN      CNAME  egycart.com.

When using SPF testing tool everything looks good.

Using kitterman tool, I get:

SPF record lookup and validation for: egycart.com
SPF records are primarily published in DNS as TXT records.
The TXT records found for your domain are:
v=spf1 a mx -all 

SPF records should also be published in DNS as type SPF records.
No type SPF records found.

Checking to see if there is a valid SPF record. 

Found v=spf1 record for egycart.com: 
v=spf1 a mx -all 

evaluating...
SPF record passed validation test with pySPF (Python SPF library)!

After checking the /var/log/messages:

Apr 14 16:21:26 egycart named[18441]: error (network unreachable) resolving '145.235.135.197.in-addr.arpa/PTR/IN': 2001:43f8:110::10#53
Apr 14 16:21:26 egycart named[18441]: error (network unreachable) resolving '145.235.135.197.in-addr.arpa/PTR/IN': 2001:dd8:6::101#53
Apr 14 16:21:26 egycart named[18441]: error (network unreachable) resolving '145.235.135.197.in-addr.arpa/PTR/IN': 2001:500:13::73#53
Apr 14 16:21:26 egycart named[18441]: error (network unreachable) resolving '145.235.135.197.in-addr.arpa/PTR/IN': 2001:13c7:7010::53#53
Apr 14 16:21:27 egycart named[18441]: error (network unreachable) resolving 'ns2.lacnic.net/A/IN': 2001:13c7:7002:3000::11#53
Apr 14 16:21:27 egycart named[18441]: error (network unreachable) resolving 'ns2.lacnic.net/A/IN': 2001:13c7:7002:3000::10#53
Apr 14 16:21:27 egycart named[18441]: error (network unreachable) resolving 'sns-pb.isc.org/A/IN': 2001:500:60::30#53
Apr 14 16:21:27 egycart named[18441]: error (network unreachable) resolving 'sns-pb.isc.org/AAAA/IN': 2001:500:60::30#53
Apr 14 16:21:27 egycart named[18441]: error (network unreachable) resolving 'sns-pb.isc.org/A/IN': 2001:4f8:0:2::19#53
Apr 14 16:21:27 egycart named[18441]: error (network unreachable) resolving 'sns-pb.isc.org/AAAA/IN': 2001:4f8:0:2::19#53
Apr 14 16:21:27 egycart named[18441]: error (network unreachable) resolving 'ns2.dns.br/A/IN': 2001:12ff::10#53
Apr 14 16:21:28 egycart named[18441]: error (network unreachable) resolving 'ns3.nic.fr/AAAA/IN': 2001:660:3006:1::1:1#53
Apr 14 16:21:28 egycart named[18441]: error (network unreachable) resolving '197.in-addr.arpa/DNSKEY/IN': 2001:500:13::c7d4:35#53
Apr 14 16:21:28 egycart named[18441]: error (network unreachable) resolving '197.in-addr.arpa/DNSKEY/IN': 2001:43f8:120::10#53
Apr 14 16:21:36 egycart named[18441]: error (network unreachable) resolving 'outlook.com/MX/IN': 2001:503:a83e::2:30#53
Apr 14 16:21:36 egycart named[18441]: error (network unreachable) resolving 'outlook.com/MX/IN': 2001:503:231d::2:30#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse5.msft.net/A/IN': 2404:f800:2003::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse5.msft.net/A/IN': 2a01:111:200f:1::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse5.msft.net/A/IN': 2a01:111:2006:6::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse4.msft.net/A/IN': 2404:f800:2003::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse3.msft.net/A/IN': 2404:f800:2003::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse4.msft.net/A/IN': 2a01:111:200f:1::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse3.msft.net/A/IN': 2a01:111:200f:1::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse4.msft.net/A/IN': 2a01:111:2006:6::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse3.msft.net/A/IN': 2a01:111:2006:6::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse1.msft.net/A/IN': 2404:f800:2003::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse1.msft.net/A/IN': 2a01:111:200f:1::1:1#53
Apr 14 16:21:38 egycart named[18441]: error (network unreachable) resolving 'nse1.msft.net/A/IN': 2a01:111:2006:6::1:1#53
Apr 14 16:21:41 egycart named[18441]: error (network unreachable) resolving 'com/DS/IN': 2001:500:2f::f#53
Apr 14 16:21:41 egycart named[18441]: error (network unreachable) resolving './NS/IN': 2001:500:2f::f#53
Apr 14 16:21:41 egycart named[18441]: error (network unreachable) resolving './NS/IN': 2001:500:1::803f:235#53
Apr 14 16:21:41 egycart named[18441]: error (network unreachable) resolving 'com/DS/IN': 2001:500:1::803f:235#53
Apr 14 16:21:42 egycart named[18441]: error (network unreachable) resolving 'outlook.com.dlv.isc.org/DLV/IN': 2001:502:ad09::23#53
Apr 14 16:21:43 egycart named[18441]: error (network unreachable) resolving 'mx3.hotmail.com/A/IN': 2a01:111:2005::1:1#53
Apr 14 16:21:43 egycart named[18441]: error (network unreachable) resolving 'mx3.hotmail.com/A/IN': 2a01:111:2020::1:1#53
Apr 14 16:21:47 egycart named[18441]: error (network unreachable) resolving 'mx3.hotmail.com/AAAA/IN': 2a01:111:2006:6::1:1#53
Apr 14 16:21:47 egycart named[18441]: error (network unreachable) resolving 'mx3.hotmail.com/AAAA/IN': 2404:f800:2003::1:1#53
Apr 14 16:21:47 egycart named[18441]: error (network unreachable) resolving 'mx3.hotmail.com/AAAA/IN': 2a01:111:200f:1::1:1#53
Apr 14 16:21:47 egycart named[18441]: error (network unreachable) resolving 'mx3.hotmail.com/AAAA/IN': 2a01:111:2005::1:1#53
Apr 14 16:21:47 egycart named[18441]: error (network unreachable) resolving 'mx3.hotmail.com/AAAA/IN': 2a01:111:2020::1:1#53
Apr 14 16:21:50 egycart named[18441]: error (network unreachable) resolving 'mx2.hotmail.com/AAAA/IN': 2a01:111:2006:6::1:1#53
Apr 14 16:21:50 egycart named[18441]: error (network unreachable) resolving 'mx2.hotmail.com/AAAA/IN': 2404:f800:2003::1:1#53
Apr 14 16:21:50 egycart named[18441]: error (network unreachable) resolving 'mx2.hotmail.com/AAAA/IN': 2a01:111:200f:1::1:1#53
Apr 14 16:21:50 egycart named[18441]: error (network unreachable) resolving 'mx2.hotmail.com/AAAA/IN': 2a01:111:2005::1:1#53
Apr 14 16:21:50 egycart named[18441]: error (network unreachable) resolving 'mx2.hotmail.com/AAAA/IN': 2a01:111:2020::1:1#53

I think that the problem is that my BIND is resolving the incoming queries sender using IPv6, while I already disabled it in /etc/sysctl.conf.

Here is the test message header:

x-store-info:4r51+eLowCe79NzwdU2kRyU+pBy2R9QCj0/8P6fDMVulCVxfoM4J0/hDFgsaz/1dZ4krEGpsOr1icwjiSz83fyIxnKHjwvMf9gZrABAFMPMzLWaPZ3ymwetpRrUoMgP/xphHhXVNg4Q=
Authentication-Results: hotmail.com; spf=temperror (sender IP is 41.41.68.66) smtp.mailfrom=ahmed@egycart.com; dkim=none header.d=egycart.com; x-hmca=none
X-SID-PRA: ahmed@egycart.com
X-AUTH-Result: NONE
X-SID-Result: NONE
X-Message-Status: n:n
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MjtHRD0yO1NDTD02
X-Message-Info: M98loaK0Lo27IVRxloyPIWg7Ba4mw/CYhJZEioM5zp5OOkIH30VTbchHisdtHiz4N5JFkyhC3qUHFk7s7okKD4nHiJ97TgHwYS62hU6+0mZgKvZHoMwbFAdp76pIhoMDpdOL1VV/wWz9t9Fs9w3wYyX5FHRicyoL
Received: from egycart.com ([41.41.68.66]) by SNT0-MC1-F21.Snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4900);
     Sun, 14 Apr 2013 07:31:24 -0700
Received: from [10.220.59.163] (unknown [197.135.235.145])
    by egycart.com (Postfix) with ESMTPSA id 19CD764245
    for <ahmed.medhat2316@outlook.com>; Sun, 14 Apr 2013 16:31:07 +0200 (EET)
Message-ID: <516ABDA0.2090907@egycart.com>
Date: Sun, 14 Apr 2013 16:30:56 +0200
From: Ahmed Medhat <ahmed@egycart.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: ahmed.medhat2316@outlook.com
Subject: 1234
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: ahmed@egycart.com
X-OriginalArrivalTime: 14 Apr 2013 14:31:25.0047 (UTC) FILETIME=[BE094870:01CE391C]

Why are my emails ending up in the junk folder?

Best Answer

You're receiving a temperror on the SPF check by Hotmail... http://www.openspf.org/FAQ/Hotmail_and_TempError is a good page for info about what do to - either wait for the DNS update or try to get them to do it faster.