我有 postfix + spamassassin。
Spamassassin 应该检查发件人的 SPF,但我收到了以下垃圾邮件:
[email protected] = 这是我的 postfix 上的电子邮件
Return-Path: <[email protected]>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
astra4450.dedicatedpanel.com
X-Spam-Level: ***
X-Spam-Status: No, score=3.4 required=5.0 tests=BAYES_00,
HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_SBL,SPF_HELO_PASS,SPF_PASS,
TO_IN_SUBJ,TVD_PH_BODY_ACCOUNTS_PRE,T_KAM_HTML_FONT_INVALID,URIBL_BLOCKED,
URIBL_DBL_MALWARE,URIBL_PH_SURBL,URIBL_SBL,URIBL_SBL_A autolearn=no
autolearn_force=no version=3.4.0
Delivered-To: [email protected]
Received: from mail.hostify.vn (mail.hostify.vn [150.95.110.152])
by mx6.example.com (Postfix) with ESMTPS id A0C74100F20F14
for <[email protected]>; Wed, 13 Dec 2023 03:26:58 +0200 (EET)
Received: from localhost (localhost [127.0.0.1])
by mail.hostify.vn (Postfix) with ESMTP id 0FFB9166DF7
for <[email protected]>; Wed, 13 Dec 2023 08:26:57 +0700 (+07)
Received: from mail.hostify.vn ([127.0.0.1])
by localhost (mail.hostify.vn [127.0.0.1]) (amavisd-new, port 10032)
with ESMTP id EaHftMvBvz9k for <[email protected]>;
Wed, 13 Dec 2023 08:26:56 +0700 (+07)
Received: from localhost (localhost [127.0.0.1])
by mail.hostify.vn (Postfix) with ESMTP id 9CEAE167AA0
for <[email protected]>; Wed, 13 Dec 2023 08:26:56 +0700 (+07)
X-Virus-Scanned: amavisd-new at hostify.vn
Received: from mail.hostify.vn ([127.0.0.1])
by localhost (mail.hostify.vn [127.0.0.1]) (amavisd-new, port 10026)
with ESMTP id Y2hw8khgynlj for <[email protected]>;
Wed, 13 Dec 2023 08:26:56 +0700 (+07)
Received: from [88.209.206.208] (unknown [88.209.206.208])
by mail.hostify.vn (Postfix) with ESMTPSA id 9CF741675DA
for <[email protected]>; Wed, 13 Dec 2023 08:26:55 +0700 (+07)
From: Admin Helpdesk <[email protected]>
To: [email protected]
Subject: Password Verification For [email protected]
Date: 12 Dec 2023 17:26:54 -0800
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0012_CFC45DD6.E88DD181"
据我所知,[email protected]的 SPF是正确的,发件人在标头中被“欺骗”为[email protected]
然而, [email protected]的 SPF 不可能是正确的。
今天我安装了一个名为 的工具pypolicyd-spf
,但只要我能够检查,它也只检查mail from:
SMTP 命令而不检查电子邮件标头。
我是否遗漏了什么或者可能使用了错误的工具来完成这项工作?
这就是 SPF 应该发挥的作用。来自发件人策略框架 (SPF) 的介绍 ( RFC 7208, 1 ):
另一方面,DMARC ( RFC 7489 ) 使发件人能够发布关于他们希望收件人如何处理邮件的策略,其中标头与传递 SPF 的信封发件人(MAIL FROM) 或有效的 DKIM 签名
From
不一致。让我们假设如下:
事实证明,SPF 应该仅在 SMTP 连接的 From: 字段上进行检查,例如 [2]。
通常这与返回路径相同。
有时 SPF 检查 helo 域 [1]。
然而,电子邮件 [3] 中的 from: 标头从未被检查。
这意味着每个人都可以像这样欺骗发件人。
为了减轻您自己的域的影响,您可以执行 DMARC 并指定两个地址必须相同。
为了减轻您不拥有的域的这种情况,您可以在 /etc/mail/spamassassin/local.cf 中增加以下分数
请注意,这有点冒险,因为有时某些域的配置不是 100% 正确。