为什么SPF会根据我的邮件服务器的IP而不是发件人的IP进行validation?

我有一个邮件服务器“example.com”,将收件人“[email protected]”的所有电子邮件转发给“[email protected]”。 我的邮件服务器运行Postfix,它使用virtual_alias_maps机制来执行转发。 我也为“example.com”安装了SPFlogging:

v=spf1 a include:aspmx.googlemail.com ~all 

问题是,只要有人将邮件发送到“[email protected]”,Gmail会根据example.com的IP地址validationexample.com SPFlogging! 我以为它应该对原始发件人的IP地址进行validation。

例如,我在我的家庭Internet连接上的笔记本电脑上。 我按如下方式连接到example.com的邮件服务器:

 $ telnet example.com 25 20 example.com ESMTP Postfix (Debian/GNU) HELO my-laptop.local 250 example.com MAIL FROM:<[email protected]> 250 2.1.0 Ok RCPT TO:<[email protected]> 250 2.1.5 Ok DATA 354 End data with <CR><LF>.<CR><LF> From: [email protected] To: [email protected] Subject: test test . 250 2.0.0 Ok: queued as CE5F42200F9 

现在,当我在Gmail中打开邮件并查看源代码时,我看到以下标题:

 Delivered-To: [email protected] Received: by 10.231.219.195 with SMTP id hv3csp61494ibb; Sat, 14 Jul 2012 02:15:58 -0700 (PDT) Received: by 10.229.135.5 with SMTP id l5mr2360326qct.5.1342257358291; Sat, 14 Jul 2012 02:15:58 -0700 (PDT) Return-Path: <[email protected]> Received: from example.com [EXAMPLE.COM's IP ADDRESS HERE] by mx.google.com with ESMTP id u9si4262071qcv.89.2012.07.14.02.15.58; Sat, 14 Jul 2012 02:15:58 -0700 (PDT) Received-SPF: neutral (google.com: [EXAMPLE.COM's IP ADDRESS HERE] is neither permitted nor denied by domain of [email protected]) client-ip=[EXAMPLE.COM's IP ADDRESS HERE]; Authentication-Results: mx.google.com; spf=neutral (google.com: [EXAMPLE.COM's IP ADDRESS HERE] is neither permitted nor denied by domain of [email protected]) [email protected] Date: Sat, 14 Jul 2012 02:15:58 -0700 (PDT) Message-Id: <[email protected]> Received: from my-laptop.local ([LAPTOP's IP ADDRESS HERE]) by example.com (Postfix) with SMTP id CE5F42200F9 for <[email protected]>; Sat, 14 Jul 2012 09:15:44 +0000 (UTC) From: [email protected] To: [email protected] Subject: test 

正如您在Received-SPF和Authentication-Results中看到的,SPFlogging正在针对[EXAMPLE.COM的IP地址]而不是[LAPTOP的IP地址]进行validation。

为什么会发生这种情况,如何解决这个问题?

谷歌[或其他任何人]将validationspf agains他们看到连接到他们的IP地址。 在这种情况下,它将是您的后缀服务器的IP地址; 你不能修复它 – 这是devise….

通过devisespf有一个“转发问题”,除非消息被“重新包装”,并且发送者地址被重写为转发者之一。