我使用 exim4 的邮件服务器有一个 ACL 来检查 DKIM 签名。它接受所有内容,但会记录失败并写入包含结果的标头。
我正在从另一台服务器发送邮件,我相信该服务器正确添加了 DKIM 签名。(例如,我已将邮件发送到 gmail 和 Outlook 地址,检查了标头,这两个系统都给了 DKIM 通过。)但是我的邮件服务器说bodyhash_mismatch
。
我的邮件服务器并不总是说 DKIM 失败。
这是一封电子邮件。我已经更改了域:
- example.org这是主要组织的域;它用在From:标头中,是签名者域。公钥在 DNS 中发布。
- sender.example.org这是发送电子邮件、创建 DKIM 标头的服务器。这是返回路径标头。
- receive.example.org这是我的邮件服务器的域,正在其中验证 DKIM。这是
X-dkim-check
添加标题的地方,下面的文本domain=
来自$dkim_cur_signer
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from mail.receiver.example.org
by mail.receiver.example.org with LMTP
id t8rHGepc52SOVA8ADCPZSA
(envelope-from <[email protected]>)
for <[email protected]>; Thu, 24 Aug 2023 14:36:42 +0100
Received: from sender-rdns.example.org ([1.2.3.4] helo=sender.example.org)
by mail.receiver.example.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
(Exim 4.94.2)
(envelope-from <[email protected]>)
id 1qZAVv-004DMU-00
for [email protected]; Thu, 24 Aug 2023 14:36:42 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=example.org; s=220151210; h=Sender:Message-Id:Subject:From:To:Date:
Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
List-Subscribe:List-Post:List-Owner:List-Archive;
bh=ecGWgWCJeWxJFeM0urOVWP+KOlqqvsQYKOpYUP8nk7I=; b=GTY2HZVje81tRJ0/xKFNUk5d7/
9wE7CGtwmz2APM5VTDKY6q+qIbwhCRNzc6IWZ4j0Y9FOtnuVBeNR1I5xbOuqPaf62MYQZJFjLQ3/J
PNpOpS3i1Yd3NCZUs1iB/Q8N+ii73FrvD5k1AA8F5yzJhVeaposgbkvU5vv1s/KgqTIA=;
Received: from localhost ([127.0.0.1] helo=sender.example.org)
by sender.example.org with esmtp (Exim 4.96)
(envelope-from <[email protected]>)
id 1qZAVt-001EhO-2k
for [email protected];
Thu, 24 Aug 2023 14:36:41 +0100
Date: Thu, 24 Aug 2023 14:36:41 +0100
To: [email protected]
From: [email protected]
Subject: test Thu, 24 Aug 2023 14:36:41 +0100
Message-Id: <[email protected]>
X-Mailer: swaks v20201014.0 jetmore.org/john/code/swaks/
Sender: [email protected]
X-dkim-check: DKIM test failed: (domain=example.org), signature is bad.
This is a test mailing
如何调试为什么 exim onreceiver.example.org
认为签名不好?
(我注意到 DKIM 签名包含许多不存在的标头。这可能是一个原因吗?)
编辑:添加详细信息:
- 签名 exim:4.96-15+deb12u1。
- 接收exim:4.94.2-7~bpo10+1