如何设置正确的SPF记录

SwD*_*n81 4 email email-server spf godaddy

我正在尝试设置一个非常基本的 SPF 记录。我在 Godaddy 上托管我的网站并使用 Godaddy 的电子邮件服务器。我正在使用 php mail() 调用(我知道,我读过很多使用 PHP Mailer 或其他方法的地方,但我选择默认的 mail() 函数,这不是我的问题)。现在,电子邮件中的 spf 记录返回neutral如下行:

Delivered-To: person@gmail.com
Received: by 10.52.171.166 with SMTP id av6csp133324vdc;
        Tue, 16 Jul 2013 07:43:23 -0700 (PDT)
X-Received: by 10.49.104.180 with SMTP id gf20mr2338989qeb.59.1373985802775;
        Tue, 16 Jul 2013 07:43:22 -0700 (PDT)
Return-Path: <noreply@onlineserver.cc>
Received: from p3nlsmtp14.shr.prod.phx3.secureserver.net (p3nlsmtp14.shr.prod.phx3.secureserver.net. [72.167.234.239])
        by mx.google.com with ESMTP id d19si710455qey.143.2013.07.16.07.43.22
        for <person@gmail.com>;
        Tue, 16 Jul 2013 07:43:22 -0700 (PDT)
Received-SPF: neutral (google.com: 72.167.234.239 is neither permitted nor denied by best guess record for domain of noreply@onlineserver.cc) client-ip=72.167.234.239;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 72.167.234.239 is neither permitted nor denied by best guess record for domain of noreply@onlineserver.cc) smtp.mail=noreply@onlineserver.cc
Received: from P3NW8SHG339 ([184.168.27.44])
    by p3nlsmtp14.shr.prod.phx3.secureserver.net with 
    id 12jN1m0080x5yNo012jNyX; Tue, 16 Jul 2013 07:43:22 -0700
Date: Tue, 16 Jul 2013 07:43:21 -0700
Subject: Little Jaws Big Smiles Registration Confirmation
X-PHP-Originating-Id: [10610735]
To: "Person" <person@gmail.com>
From: "Little Jaws Big Smiles" <no-reply@littlejawsbigsmiles.com>
Reply-To: "Little Jaws Big Smiles" <no-reply@littlejawsbigsmiles.com>
Return-Path: "Little Jaws Big Smiles" <no-reply@littlejawsbigsmiles.com>
Message-ID: <51e55c0a.f351310a.61d2.ffffe3a0SMTPIN_ADDED_BROKEN@mx.google.com>
X-Mailer: PHP/5.2.17
MIME-Version: 1.0
Content-type: text/html; charset=ISO-8859-1
Organization: Little Jaws Big Smiles
Run Code Online (Sandbox Code Playgroud)

ip72.167.234.239对应于p3nlsmtp14.shr.prod.phx3.secureserver.net,我猜测是实际发送我的电子邮件的邮件服务器。

  • 我有一个 A(主机)记录设置,其中包含我的域的实际 IP 地址。
  • 我有提供的默认 CNAME(别名)列表
  • 我有两个提供的 MX(邮件交换器记录)
    • mailstore1.secureserver.net
    • smtp.secureserver.net
  • 有两个默认名称服务器设置
    • ns45.domaincontrol.com
    • ns46.domaincontrol.com
  • 我已经按照以下方式设置了 TXT SPF 记录(没有引号,因为 godaddy 让您输入的方式就是这样):
    • v=spf1 a mx ptr ip4:72.167.234.245 -all

然而,这仍然会产生中性的 SPF 结果。我已经等了48小时了,记录才采取行动。我也读过SPF Syntax并且我认为我已经正确设置了它(但我以前从未这样做过,所以我可能完全误解了这一点)

我还尝试了kitterman 的验证脚本,结果如​​下:

Found v=spf1 record for littlejawsbigsmiles.com: v=spf1 a mx ptr ip4:72.167.234.245 -all    
evaluating... SPF record passed validation test with pySPF (Python SPF library)!
Run Code Online (Sandbox Code Playgroud)

有人发现我的记录定义有问题或者我是否遗漏了其他内容?

我正在尝试从 no-reply@littlejawsbigsmiles.com 发送邮件

如果我需要提供任何其他信息,请告诉我。

更新根据 @TheCleaner 的请求,我按照Godaddys 网站上的说明创建了 SPF 记录。以下是我选择的步骤和选项以及选择它们的原因。

在添加 SPF 记录

  • 第4步:我选择了GoDaddy.com, LLC only
    • 我只使用他们的服务器发送电子邮件
  • 第5步:我选择了All Inbound Servers May Send Mail
    • 我不确定这是否适用于我,但我选择它只是为了以防万一
  • 第6步:我没有选择出站记录。
    • 我的域不是邮件服务器
  • 第7步:我没有选择PTR
    • 我的域不是邮件服务器
  • 第 8 步:我添加了72.167.234.0/24这个,因为这似乎是 Godaddy 用于发送电子邮件的邮件服务器
  • 我还选择了Exclude all hosts not specified here添加-all

结果 SPF 记录如下。我会尝试这个,如果这解决了我的问题,我会回复。如果我对上述步骤的假设不正确,请告诉我。

v=spf1 mx include:72.167.234.0/24 -all
Run Code Online (Sandbox Code Playgroud)

gpa*_*ent 5

您在 SPF 记录中输入了错误的 IP 地址。

这是当前记录:

littlejawsbigsmiles.com. 3600   IN      TXT     "v=spf1 a mx ptr ip4:72.167.234.245 -all"
Run Code Online (Sandbox Code Playgroud)

这是您发送邮件的 IP:

72.167.234.239
Run Code Online (Sandbox Code Playgroud)

这明显不同于72.167.234.245.

修复记录,确保其中没有错误,一切正常。

要包含整个地址范围,请使用:

"v=spf1 mx ip4:72.167.234.0/24 -all"
Run Code Online (Sandbox Code Playgroud)

顺便说一句,GoDaddy 提供了一篇有关如何设置 SPF 记录的知识库文章: http://support.godaddy.com/help/article/7926/adding-or-editing-spf-records