增加对返回路径和SPF记录的理解

时间:2015-12-28 14:47:02

标签: email dns spf

我的网站上有一个由第三方托管的网络表单。我的服务器配置/架构有问题,想要确认一些事情并显示我收到的邮件标题。

我知道我必须明确设置我的邮件通过我指定的外发邮件服务器和端口发送(这是为了发送邮件,如果没有通过SMTP服务器发送,则不会发送)。

在此处设置SMTP服务器和端口是邮件标题:

x-store-info:sbevkl2QZR7OXo7WID5ZcdV2tiiWGqTnhQzu7BHe69dd2ZvcRr0xBttv16txT0x/MHyyxbQQOWxD0k3WKrQDVl56gwTtl9T9YlQDKWZad3R7ZbliBL6BSfw52gpz37cwL/qGTahKP+U=
Authentication-Results: hotmail.com; spf=softfail (sender IP is 213.171.216.60) smtp.mailfrom=test@hotmail.co.uk; dkim=none header.d=hotmail.co.uk; x-hmca=fail header.id=test@hotmail.co.uk
X-SID-PRA: test@hotmail.co.uk
X-AUTH-Result: FAIL
X-SID-Result: FAIL
X-Message-Status: n:n
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0xO0Q9MTtHRD0xO1NDTD0y
X-Message-Info: NhFq/7gR1vSyCjVJ7Q2iIHhF9oW5eW+g+jrtzv+TwMhHX16XKDSEsIIxc1qXk1NO+AwFoToprpXBtEMxyoOvMnJSYUEEN4JngTWWsUg0/J3120nOI8GDZ8sF8m5iNGKuZt7Ds7svv3bOfUNBVLmpGlsbHUCNwXFNgry/rw0sWtsI0nyKa01KIdnxHDoLHp7GPP/klJGbBhJE2FLEW70tX5XZujwdcC9+R5m/pk5uo4uPxfmnwQK9yQ==
Received: from cust-smtp-auth1.fasthosts.net.uk ([213.171.216.60]) by BLU004-MC1F22.hotmail.com with Microsoft SMTPSVC(7.5.7601.23143);
     Mon, 28 Dec 2015 05:59:03 -0800
Received: from fun-booths.co.uk (unknown [88.208.252.229])
    by cust-smtp-auth1.fasthosts.net.uk (Postfix) with ESMTP id 923AF74021D
    for <c_qatest@hotmail.co.uk>; Mon, 28 Dec 2015 13:59:02 +0000 (GMT)
Date: Mon, 28 Dec 2015 13:59:02 +0000
To: c_qatest@hotmail.co.uk
From: "test@hotmail.co.uk" <test@hotmail.co.uk>
Subject: Fun Booths - Booking form
Message-ID: <918f36d31bf876f19ea6d9563c1ad348@fun-booths.co.uk>
X-Priority: 3
X-Mailer: PHPMailer 5.2.10 (https://github.com/PHPMailer/PHPMailer/)
Reply-To: test@hotmail.co.uk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Return-Path: test@hotmail.co.uk
X-OriginalArrivalTime: 28 Dec 2015 13:59:03.0161 (UTC) FILETIME=[E8B5FE90:01D14177]

专注于Authentication-Results (sender IP is 213.171.216.60),它绝对是正确的外发SMTP服务器。但是spf结果是spf=softfail

经过一些研究后,有人建议

  

Return-Path标头为空。这意味着在SMTP期间   对话,MAIL FROM命令未指定电子邮件地址   发送跳出的地方。它是来自此电子邮件地址的域名   SPF测试。如果没有电子邮件地址,将导致软件失败。

这是指smtp.mailfromAuthentication-Results字段在上例中设置为test@hotmail.co.uk的值吗?

我相信我已经完成了实施SPF所需的工作:

(1)我已在域的DNS区域

中设置了SPF记录
v=spf1 a ip4:213.171.216.0/24 mx -all

现在混乱出现了。当其他人的邮件服务器收到声称来自该域的邮件时,则

(2)接收服务器可以检查消息是否符合域的规定政策

例如,Hotmail接收邮件服务器如何进行此检查?因为如果我设置hello@fun-booths.co.uk的返回路径,则会产生spf=pass。需要明确的是www.fun-booths.co.uk是正在使用的域名。

x-store-info:J++/JTCzmObr++wNraA4Pa4f5Xd6uens6FBov4shFUrwGsQPla5CZKHNFpj4XdT2wfaqUtXggI++7RpfQIpooWW0Sp2ynYP894LLfhswpqbr+Di/ao+0Ofc9Btl/xdHLsTQXTk39KBE=
Authentication-Results: hotmail.com; spf=pass (sender IP is 213.171.216.60) smtp.mailfrom=hello@fun-booths.co.uk; dkim=none header.d=fun-booths.co.uk; x-hmca=pass header.id=hello@fun-booths.co.uk
X-SID-PRA: hello@fun-booths.co.uk
X-AUTH-Result: PASS
X-SID-Result: PASS
X-Message-Status: n:n
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTE7YT0xO0Q9MTtHRD0xO1NDTD0w
X-Message-Info: NhFq/7gR1vTQzco4wDfDIuNexRCLt7KFLQW7EkmNLn/2YehuSC93bNZTp87n+KmseY8TwxSqCjOondyBGOJR9CRbKyT/FU2B2nhMw3SU8HjmnNyAmDcRFqxvARiDy1lMz5O7U5B61WNdLZsDb1vLPQ93l4XO90mQcjMfCI4SWr50rtHEJwK9Y/c2zDWf8jdVXEgQOyBm4pQwu9z7isJFvrHl9HRMGMcWeNHQVVCsFOoqJ8mhQItxPg==
Received: from cust-smtp-auth2.fasthosts.net.uk ([213.171.216.60]) by SNT004-MC2F7.hotmail.com with Microsoft SMTPSVC(7.5.7601.23143);
     Mon, 28 Dec 2015 06:05:27 -0800
Received: from fun-booths.co.uk (unknown [88.208.252.229])
    by cust-smtp-auth2.fasthosts.net.uk (Postfix) with ESMTP id 66414740221
    for <c_qatest@hotmail.co.uk>; Mon, 28 Dec 2015 14:05:26 +0000 (GMT)
Date: Mon, 28 Dec 2015 14:05:26 +0000
To: c_qatest@hotmail.co.uk
From: "hello@fun-booths.co.uk" <hello@fun-booths.co.uk>
Subject: Fun Booths - Booking form
Message-ID: <85119bedb602f9865290c2ea218315b4@fun-booths.co.uk>
X-Priority: 3
X-Mailer: PHPMailer 5.2.10 (https://github.com/PHPMailer/PHPMailer/)
Reply-To: test@hotmail.co.uk
X-Sender: hello@fun-booths.co.uk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Return-Path: hello@fun-booths.co.uk
X-OriginalArrivalTime: 28 Dec 2015 14:05:27.0582 (UTC) FILETIME=[CDD7FBE0:01D14178]

这引出了我的最后一个问题 - 返回路径是否必须设置为站点域中的真实电子邮件地址(www.fun-booths.co.uk),否则邮件将不会发送?

因为我已经设置了邮箱hello@fun-booths.co.uk,但是即使我删除了邮箱,它仍然会导致spf=pass。换句话说,在域上没有真正的电子邮件地址,而只是将Return-Path设置为hello@fun-booths.co.uk而不存在邮箱将导致spf=pass。应该是这样的吗?

在返回路径中设置的电子邮件@ fun-booths.co.uk是否用于确定SPF检查的域名?

最后在上面的引文中提到了SMTP会话,是MAIL FROM命令引用了smtp.mailfrom中的Authentication-Results字段吗?

1 个答案:

答案 0 :(得分:1)

SPF检查始终使用信封发件人(MAIL FROM :) - smtp.mailfrom完成。在第一封邮件中,您将test@hotmail.co.uk作为信封发件人,但您的服务器未列在hotmail.co.uk的SPF记录中,并且由于该记录具有〜所有作为最后一种机制,您获得Softfail。

在第二封邮件中,信封发件人是hello@fun-booths.co.uk,因此它是在该支票中使用的fun-booths.co.uk的SPF记录。

所以你应该使用fun-booths.co.uk地址作为信封发件人。

根据您从网络表单发送邮件的方式,有不同的方法来控制信封发件人,但可能会将Return-Path的值用作信封发件人。

SPF无需使用信封发件人的邮箱,因为SPF通常只查看地址的域名部分,但如果邮件在此过程中某处弹回,则退回邮件通常会发送信封发件人,所以保留该地址的邮箱是个好主意。