SPF 记录 - 不指定允许的发件人主机

SPF record - does not designate permitted sender hosts

我有一个 GoDaddy Office 365 电子邮件帐户 test@mydomain.com,我正在使用 PHPMailer 通过 SMTP 发送电子邮件。

每当我的脚本发出电子邮件时,它们都会进入垃圾邮件文件夹,在 headers 我可以看到以下消息...

Received-SPF: None (protection.outlook.com: mydomain.com does not
 designate permitted sender hosts)

该脚本 运行 来自另一个域 mydomain2.com,我在 mydomain.com 上设置了 2 个 SPF 记录,如下所示...

v=spf1 include:spf.protection.outlook.com -all
v=spf1 include:mydomain2.com -all

我哪里错了?记录需要合并吗?

是的,它们确实需要合并。合并它们看起来像这样:

v=spf1 include:spf.protection.outlook.com include:mydomain2.com -all

你确定你是这个意思吗? include:mydomain2.com不代表"allow sending from mydomain2.com";它表示 "allow sending from the servers listed in the SPF record for mydomain2.com",这可能完全不同。如果您需要添加 a 子句,或者可能需要添加 mx 而不是 include,我不会感到惊讶,但我无法从您发布的信息中判断出来。

更新 - 要简单地将域指向的主机指定为发送主机,以及您域的入站邮件服务器,请改为:

v=spf1 a mx include:spf.protection.outlook.com -all