title: Gmail doesn't consider valid SPF
body: <p>According to SPF validation tool available on <a href="http://www.kitterman.com/spf/validate.html" rel="nofollow noreferrer">http://www.kitterman.com/spf/validate.html</a> my domain has correctly configured SPF record: <code>v=spf1 ip4:111.222.333.444 include:zoho.com ~all</code></p>
  
  <p>I'm sending emails from:</p>
  
  <ul>
  <li>zoho.com (this validates in Gmail and email comes immediately)</li>
  <li>my server via PHP using <code>sendmail</code> (this doesn't validate and email comes with about 122 seconds delay)</li>
  </ul>
  
  <pre>
  
      Delivered-To: my-email@gmail.com
      Received: by 10.107.31.138 with SMTP id 123xxx123xxx123;
              Sun, 9 Apr 2017 04:10:44 -0700 (PDT)
      X-Received: by 10.28.40.198 with SMTP id 567xxx567xxx.567.567567567;
              Sun, 09 Apr 2017 04:10:44 -0700 (PDT)
      Return-Path: 
      Received: from sd-111111.dedibox.fr ([111.222.333.444])
              by mx.google.com with ESMTPS id 12345678.12.2017.04.09.04.13.25
              for 
              (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
              Sun, 09 Apr 2017 04:10:44 -0700 (PDT)
      Received-SPF: neutral (google.com: 111.222.333.444 is neither permitted nor denied by best guess record for domain of www-data@sd-111111.dedibox.fr) client-ip=111.222.333.444;
      Authentication-Results: mx.google.com;
             spf=neutral (google.com: 111.222.333.444 is neither permitted nor denied by best guess record for domain of www-data@sd-111111.dedibox.fr) smtp.mailfrom=www-data@sd-111111.dedibox.fr
      Received: from sd-111111.dedibox.fr (localhost [127.0.0.1]) by sd-111111.dedibox.fr (8.15.2/8.15.2/Debian-3) with ESMTP id xxxxxxxxxxx for ; Sun, 9 Apr 2017 13:11:24 +0200
      Received: (from www-data@localhost) by sd-111111.dedibox.fr (8.15.2/8.15.2/Submit) id v39BBO6a028991; Sun, 9 Apr 2017 13:11:24 +0200
      Date: Sun, 9 Apr 2017 13:08:42 +0200
      Message-Id: 
      To: my-email@gmail.com
      Subject: the subject
      X-PHP-Originating-Script: 1000:mail.php
      From: webmaster@my-domain.com
      Reply-To: webmaster@my-domain.com
      X-Mailer: PHP/7.1.3-3+deb.sury.org~xenial+1
  
      hello
  
  </pre>
  
  <p>How can I fix this?</p>
  
  <p>The message is <code>Gmail couldn't verify that my-domain.com actually sent this messages (and not a spammer).</code> and it links to <a href="https://support.google.com/mail/answer/180707" rel="nofollow noreferrer">https://support.google.com/mail/answer/180707</a></p>
  
  <p>(I should point out that I made the SPF record correct many days ago and all DNS servers have surely been updated by now. It currently has TTL set to 30 seconds anyway for several weeks.)</p>
  
  <p>UPDATE: I just noticed that GMail is seeing that the email is sent from <code>sd-11111.dedibox.fr</code> and not from <code>111.222.333.444</code> but doing <code>ping sd-11111.dedibox.fr</code> returns this exact ip: <code>Reply from 111.222.333.444: bytes=32 time=38ms TTL=52</code> so I'm still clueless why it doesn't consider the IP?</p>