我有一个邮件服务器“example.com”,它将收件人为“[email protected]”的所有电子邮件转发到“[email protected]”。我的邮件服务器运行 Postfix,它使用 virtual_alias_maps 机制来执行转发。我还为“example.com”安装了 SPF 记录:
v=spf1 a include:aspmx.googlemail.com ~all
问题是,每当有人将邮件发送到“[email protected]”时,Gmail 都会根据 example.com 的 IP 地址验证 example.com SPF 记录!我认为它应该根据原始发件人的 IP 地址进行验证。
例如,我在我的笔记本电脑上使用家庭 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 中看到的那样,SPF 记录正在根据 [EXAMPLE.COM 的 IP 地址] 而不是 [LAPTOP 的 IP 地址] 进行验证。
为什么会发生这种情况,我该如何解决这个问题?
google [或其他任何人] 将根据他们看到的连接到他们的 ip 地址再次验证 spf。在这种情况下,它将是您的后缀服务器的 ip 地址;你无法修复它——这是设计使然……
按照设计,spf 在转发方面存在“问题”,除非消息被“重新打包”并且发件人地址被重写为转发者之一。