2014-09-18 343 views
0

我們遇到了麻煩,用DKIM使用opendkim作爲Postfix的過濾器簽署我們的外發郵件。DKIM在使用opendkim在MTA上簽名時失敗(body hash)

僅當從phpList發送HTML電子郵件時纔會發生此問題。來自其他服務的所有其他文本郵件和郵件都可以正確簽名並進行驗證。 phpList使用phpMailer作爲引擎。

如果我們發送郵件爲「文本」,那麼我們沒有問題。如果我們將郵件發送爲「HTML」,則主體哈希將失敗。

這個問題存在於v2中,但是我們用來強制phpList只發送爲HTML。

將此郵件作爲HTML和TEXT電子郵件(這是v3中的默認設置)發送時發生此錯誤。

我認爲這是與換行/回報有關。

有人可以指出我們在正確的方向嗎?

感謝您的幫助提前。

Port25驗證服務 - 即通過DKIM(僅文本)消息

========================================================== 
Summary of Results 
========================================================== 
SPF check:   pass 
DomainKeys check: neutral 
DKIM check:   pass 
Sender-ID check: pass 
SpamAssassin check: ham 

========================================================== 
Details: 
========================================================== 


---------------------------------------------------------- 
DomainKeys check details: 
---------------------------------------------------------- 
Result:   neutral (message not signed) 
ID(s) verified: [email protected] 
DNS record(s): 

---------------------------------------------------------- 
DKIM check details: 
---------------------------------------------------------- 
Result:   pass (matches From: [email protected]) 
ID(s) verified: header.d=flyawaysimulation.com 
Canonicalized Headers: 
    to:[email protected]'0D''0A' 
    subject:Test'20'123'0D''0A' 
    date:Thu,'20'18'20'Sep'20'2014'20'21:50:35'20'+0100'0D''0A' 
    from:Fly'20'Away'20'Simulation'20'<[email protected]>'0D''0A' 
    reply-to:Fly'20'Away'20'Simulation'20'<[email protected]>'0D''0A' 
    list-help:<https://flyawaysimulation.com/lists/?p=preferences&uid=1e629246241f8e9714134ee8076ad406>'0D''0A' 
    list-unsubscribe:<https://flyawaysimulation.com/lists/?p=unsubscribe&uid=1e629246241f8e9714134ee8076ad406&jo=1>'0D''0A' 
    list-subscribe:<https://flyawaysimulation.com/lists/?p=subscribe>'0D''0A' 
    list-owner:<mailto:[email protected]>'0D''0A' 
    dkim-signature:v=1;'20'a=rsa-sha256;'20'c=relaxed/simple;'20'd=flyawaysimulation.com;'20's=mail;'20't=1411073436;'20'bh=hhSjWh2jttCh3y1SOIZzUVlxN+KYTuNZ+eh16bzchHc=;'20'h=To:Subject:Date:From:Reply-To:List-Help:List-Unsubscribe:'20'List-Subscribe:List-Owner;'20'b= 

Canonicalized Body: 
    '20'test'20'123'0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '20''20''0D''0A' 


DNS record(s): 
    mail._domainkey.flyawaysimulation.com. 3600 IN TXT "v=DKIM1;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDimrx9MV1sFyUCVPeH6SFMBy7Cb2AU6aB9i3GazP7QKWG5pWWkFEurFImNbwi4wKz6dtKQeEkcGzPdzyeD+hXaSG2sl86T4pnwIxUaBMlW+FWfaNx0XPphacPAYjtkJGVoZGmmIbK3tH8HLZqdCEy6YIKd0kNSXQqFEMQseHaR6wIDAQAB" 

Public key used for verification: mail._domainkey.flyawaysimulation.com (1024 bits) 

NOTE: DKIM checking has been performed based on the latest DKIM specs 
(RFC 4871 or draft-ietf-dkim-base-10) and verification may fail for 
older versions. If you are using Port25's PowerMTA, you need to use 
version 3.2r11 or later to get a compatible version of DKIM. 



========================================================== 
Original Email 
========================================================== 

Return-Path: <[email protected]> 
Received: from web3.rbftpnetworks.net (195.224.144.101) by verifier.port25.com id h3d2q211u9cu for <[email protected]>; Thu, 18 Sep 2014 16:50:41 -0400 (envelope-from <[email protected]>) 
Authentication-Results: verifier.port25.com; spf=pass [email protected] 
Authentication-Results: verifier.port25.com; domainkeys=neutral (message not signed) [email protected] 
Authentication-Results: verifier.port25.com; dkim=pass (matches From: [email protected]) header.d=flyawaysimulation.com 
Authentication-Results: verifier.port25.com; sender-id=pass [email protected] 
Received: by web3.rbftpnetworks.net (Postfix, from userid 70) 
    id 2FF6D3E2B4BC; Thu, 18 Sep 2014 21:50:35 +0100 (BST) 
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; 
    d=flyawaysimulation.com; s=mail; t=1411073436; 
    bh=hhSjWh2jttCh3y1SOIZzUVlxN+KYTuNZ+eh16bzchHc=; 
    h=To:Subject:Date:From:Reply-To:List-Help:List-Unsubscribe: 
    List-Subscribe:List-Owner; 
    b=kz3pyKnsxvzKKc9I764d8xwTxMQkJNcdHSup9+BOoNujSXTOyyAM1tpc5QWIhGMa4 
    NOwsePDv5qfladW3kAh7TuwWW9geH6gdV9PhHF5RCg6jyHHbUY8t4mpIcW7w4yNuIK 
    BMMbXk4+puGpEKdyRgfGKXxYjI0bVKK1Ck2vdb5Q= 
To: [email protected] 
Subject: Test 123 
Received: from host81-138-131-190.in-addr.btopenworld.com [81.138.131.190] by flyawaysimulation.com with HTTP; Thu, 18 Sep 2014 21:50:35 +0100 
Date: Thu, 18 Sep 2014 21:50:35 +0100 
From: Fly Away Simulation <[email protected]> 
Reply-To: Fly Away Simulation <[email protected]> 
Message-ID: <[email protected]> 
X-Priority: 3 
X-Mailer: PHPMailer 5.2.5 (https://github.com/Synchro/PHPMailer/) 
X-phpList-version: 3.0.7 
X-MessageID: 8 
X-ListMember: [email protected] 
Precedence: bulk 
Bounces-To: [email protected] 
List-Help: <https://flyawaysimulation.com/lists/?p=preferences&uid=1e629246241f8e9714134ee8076ad406> 
List-Unsubscribe: <https://flyawaysimulation.com/lists/?p=unsubscribe&uid=1e629246241f8e9714134ee8076ad406&jo=1> 
List-Subscribe: <https://flyawaysimulation.com/lists/?p=subscribe> 
List-Owner: <mailto:[email protected]> 
MIME-Version: 1.0 
Content-Transfer-Encoding: 8bit 
Content-Type: text/plain; charset=UTF-8 

test 123 

Port25驗證服務 - 失敗DKIM(文本/ HTML電子郵件)

========================================================== 
Summary of Results 
========================================================== 
SPF check:   pass 
DomainKeys check: neutral 
DKIM check:   fail 
Sender-ID check: pass 
SpamAssassin check: ham 

========================================================== 
Details: 
========================================================== 


---------------------------------------------------------- 
DKIM check details: 
---------------------------------------------------------- 
Result:   fail (wrong body hash: expected nb2kCq5nNBE+IfyLiAIH9t/9x7Kk5PpCb+1GdO/wiJ8=) 
ID(s) verified: 
Canonicalized Headers: 
    to:[email protected]'0D''0A' 
    subject:Test'20'123'0D''0A' 
    date:Thu,'20'18'20'Sep'20'2014'20'21:52:19'20'+0100'0D''0A' 
    from:Fly'20'Away'20'Simulation'20'<[email protected]>'0D''0A' 
    reply-to:Fly'20'Away'20'Simulation'20'<[email protected]>'0D''0A' 
    list-help:<https://flyawaysimulation.com/lists/?p=preferences&uid=1e629246241f8e9714134ee8076ad406>'0D''0A' 
    list-unsubscribe:<https://flyawaysimulation.com/lists/?p=unsubscribe&uid=1e629246241f8e9714134ee8076ad406&jo=1>'0D''0A' 
    list-subscribe:<https://flyawaysimulation.com/lists/?p=subscribe>'0D''0A' 
    list-owner:<mailto:[email protected]>'0D''0A' 
    dkim-signature:v=1;'20'a=rsa-sha256;'20'c=relaxed/simple;'20'd=flyawaysimulation.com;'20's=mail;'20't=1411073540;'20'bh=XMTdnEvx/N4aZB10KoQqWOQW+MUVFvU66kqiSqm0XKc=;'20'h=To:Subject:Date:From:Reply-To:List-Help:List-Unsubscribe:'20'List-Subscribe:List-Owner;'20'b= 

Canonicalized Body: 
    --b1_b4a02db1226bc348457a47d51e902619'0D''0A' 
    Content-Type:'20'text/plain;'20'charset=UTF-8'0D''0A' 
    Content-Transfer-Encoding:'20'quoted-printable'0D''0A' 
    '0D''0A' 
    '20'test'20'123'0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '20'=20'0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    --b1_b4a02db1226bc348457a47d51e902619'0D''0A' 
    Content-Type:'20'text/html;'20'charset=UTF-8'0D''0A' 
    Content-Transfer-Encoding:'20'quoted-printable'0D''0A' 
    '0D''0A' 
    <html><head>=0A'20''20''20''20''20''20''20''20'<meta'20'content=3D"text/html;charset=3DUTF-8"'20'http-equ='0D''0A' 
    '0D''0A' 
    iv=3D"Content-Type">=0A'20''20''20''20''20''20''20''20'<title></title></head><body><p>&nbsp;test'20'12='0D''0A' 
    '0D''0A' 
    3</p>=0A<img'20'src=3D"https://flyawaysimulation.com/lists/ut.php?u=3D1e629246='0D''0A' 
    '0D''0A' 
    241f8e9714134ee8076ad406&amp;m=3D8"'20'width=3D"1"'20'height=3D"1"'20'border=3D"0"'20'/='0D''0A' 
    '0D''0A' 
    ></body></html>'0D''0A' 
    '0D''0A' 
    '0D''0A' 
    --b1_b4a02db1226bc348457a47d51e902619--'0D''0A' 


DNS record(s): 

NOTE: DKIM checking has been performed based on the latest DKIM specs 
(RFC 4871 or draft-ietf-dkim-base-10) and verification may fail for 
older versions. If you are using Port25's PowerMTA, you need to use 
version 3.2r11 or later to get a compatible version of DKIM. 


========================================================== 
Original Email 
========================================================== 

Return-Path: <[email protected]> 
Received: from web3.rbftpnetworks.net (195.224.144.101) by verifier.port25.com id h3d30c11u9cb for <[email protected]>; Thu, 18 Sep 2014 16:52:22 -0400 (envelope-from <[email protected]>) 
Authentication-Results: verifier.port25.com; spf=pass [email protected] 
Authentication-Results: verifier.port25.com; domainkeys=neutral (message not signed) [email protected] 
Authentication-Results: verifier.port25.com; dkim=fail (wrong body hash: expected nb2kCq5nNBE+IfyLiAIH9t/9x7Kk5PpCb+1GdO/wiJ8=) 
Authentication-Results: verifier.port25.com; sender-id=pass [email protected]waysimulation.com 
Received: by web3.rbftpnetworks.net (Postfix, from userid 70) 
    id 014C83E2B53F; Thu, 18 Sep 2014 21:52:19 +0100 (BST) 
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; 
    d=flyawaysimulation.com; s=mail; t=1411073540; 
    bh=XMTdnEvx/N4aZB10KoQqWOQW+MUVFvU66kqiSqm0XKc=; 
    h=To:Subject:Date:From:Reply-To:List-Help:List-Unsubscribe: 
    List-Subscribe:List-Owner; 
    b=OXitjsekFORKng9NPtJ7GSrKROUf+EGj/zetZ7ZoXWGeZerr2+IUNFgSZcNPjub5M 
    VazJtwOMRZ5g7r6SrUWjPfkpDH6nt3qecOW2E000ftsWwv78wPtD4mc0OIN/IsY52h 
    vk+mbHrQb4ToUHmxIGRIfB/NOdDiXG7Gp+aVrgRY= 
To: [email protected] 
Subject: Test 123 
Received: from host81-138-131-190.in-addr.btopenworld.com [81.138.131.190] by flyawaysimulation.com with HTTP; Thu, 18 Sep 2014 21:52:19 +0100 
Date: Thu, 18 Sep 2014 21:52:19 +0100 
From: Fly Away Simulation <[email protected]> 
Reply-To: Fly Away Simulation <[email protected]> 
Message-ID: <[email protected]> 
X-Priority: 3 
X-Mailer: PHPMailer 5.2.5 (https://github.com/Synchro/PHPMailer/) 
X-phpList-version: 3.0.7 
X-MessageID: 8 
X-ListMember: [email protected] 
Precedence: bulk 
Bounces-To: [email protected] 
List-Help: <https://flyawaysimulation.com/lists/?p=preferences&uid=1e629246241f8e9714134ee8076ad406> 
List-Unsubscribe: <https://flyawaysimulation.com/lists/?p=unsubscribe&uid=1e629246241f8e9714134ee8076ad406&jo=1> 
List-Subscribe: <https://flyawaysimulation.com/lists/?p=subscribe> 
List-Owner: <mailto:[email protected]> 
MIME-Version: 1.0 
Content-Type: multipart/alternative; 
    boundary="b1_b4a02db1226bc348457a47d51e902619" 

--b1_b4a02db1226bc348457a47d51e902619 
Content-Type: text/plain; charset=UTF-8 
Content-Transfer-Encoding: quoted-printable 

test 123 







=20 



--b1_b4a02db1226bc348457a47d51e902619 
Content-Type: text/html; charset=UTF-8 
Content-Transfer-Encoding: quoted-printable 

<html><head>=0A  <meta content=3D"text/html;charset=3DUTF-8" http-equ= 

iv=3D"Content-Type">=0A  <title></title></head><body><p>&nbsp;test 12= 

3</p>=0A<img src=3D"https://flyawaysimulation.com/lists/ut.php?u=3D1e629246= 

241f8e9714134ee8076ad406&amp;m=3D8" width=3D"1" height=3D"1" border=3D"0" /= 

> </body></html> 


--b1_b4a02db1226bc348457a47d51e902619-- 

消息phpMailer 5.2.5版(與phpList一起打包)

更新: 如果我們在opendkim配置中啓用「FixCRLF yes」,我們可以通過Port25測試儀上的DKIM驗證檢查。但是,這仍然是FAILS Gmail DKIM驗證。傳遞了

測試輸出與 「FixCRLF是」:

========================================================== 
Summary of Results 
========================================================== 
SPF check:   pass 
DomainKeys check: neutral 
DKIM check:   pass 
Sender-ID check: pass 
SpamAssassin check: ham 


---------------------------------------------------------- 
DomainKeys check details: 
---------------------------------------------------------- 
Result:   neutral (message not signed) 
ID(s) verified: [email protected] 
DNS record(s): 

---------------------------------------------------------- 
DKIM check details: 
---------------------------------------------------------- 
Result:   pass (matches From: [email protected]) 
ID(s) verified: header.d=flyawaysimulation.com 
Canonicalized Headers: 
    to:[email protected]'0D''0A' 
    subject:Test'20'123'0D''0A' 
    date:Sun,'20'21'20'Sep'20'2014'20'15:57:46'20'+0100'0D''0A' 
    from:Fly'20'Away'20'Simulation'20'<[email protected]>'0D''0A' 
    reply-to:Fly'20'Away'20'Simulation'20'<[email protected]>'0D''0A' 
    list-help:<https://flyawaysimulation.com/lists/?p=preferences&uid=1e629246241f8e9714134ee8076ad406>'0D''0A' 
    list-unsubscribe:<https://flyawaysimulation.com/lists/?p=unsubscribe&uid=1e629246241f8e9714134ee8076ad406&jo=1>'0D''0A' 
    list-subscribe:<https://flyawaysimulation.com/lists/?p=subscribe>'0D''0A' 
    list-owner:<mailto:[email protected]>'0D''0A' 
    dkim-signature:v=1;'20'a=rsa-sha256;'20'c=relaxed/simple;'20'd=flyawaysimulation.com;'20's=mail;'20't=1411311466;'20'bh=PUR9ib4HOSSj9G3jmXSCyzc1LAtqQeyWPSAii67TLd8=;'20'h=To:Subject:Date:From:Reply-To:List-Help:List-Unsubscribe:'20'List-Subscribe:List-Owner;'20'b= 

Canonicalized Body: 
    --b1_4ecb49f93b720bc688fe3bcdcafed5b0'0D''0A' 
    Content-Type:'20'text/plain;'20'charset=UTF-8'0D''0A' 
    Content-Transfer-Encoding:'20'quoted-printable'0D''0A' 
    '0D''0A' 
    '20'test'20'123'0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '20'=20'0D''0A' 
    '0D''0A' 
    '0D''0A' 
    '0D''0A' 
    --b1_4ecb49f93b720bc688fe3bcdcafed5b0'0D''0A' 
    Content-Type:'20'text/html;'20'charset=UTF-8'0D''0A' 
    Content-Transfer-Encoding:'20'quoted-printable'0D''0A' 
    '0D''0A' 
    <html><head>=0A'20''20''20''20''20''20''20''20'<meta'20'content=3D"text/html;charset=3DUTF-8"'20'http-equ='0D''0A' 
    '0D''0A' 
    iv=3D"Content-Type">=0A'20''20''20''20''20''20''20''20'<title></title></head><body><p>&nbsp;test'20'12='0D''0A' 
    '0D''0A' 
    3</p>=0A<img'20'src=3D"https://flyawaysimulation.com/lists/ut.php?u=3D1e629246='0D''0A' 
    '0D''0A' 
    241f8e9714134ee8076ad406&amp;m=3D8"'20'width=3D"1"'20'height=3D"1"'20'border=3D"0"'20'/='0D''0A' 
    '0D''0A' 
    ></body></html>'0D''0A' 
    '0D''0A' 
    '0D''0A' 
    --b1_4ecb49f93b720bc688fe3bcdcafed5b0--'0D''0A' 


DNS record(s): 
    mail._domainkey.flyawaysimulation.com. 3600 IN TXT "v=DKIM1;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDimrx9MV1sFyUCVPeH6SFMBy7Cb2AU6aB9i3GazP7QKWG5pWWkFEurFImNbwi4wKz6dtKQeEkcGzPdzyeD+hXaSG2sl86T4pnwIxUaBMlW+FWfaNx0XPphacPAYjtkJGVoZGmmIbK3tH8HLZqdCEy6YIKd0kNSXQqFEMQseHaR6wIDAQAB" 

Public key used for verification: mail._domainkey.flyawaysimulation.com (1024 bits) 

NOTE: DKIM checking has been performed based on the latest DKIM specs 
(RFC 4871 or draft-ietf-dkim-base-10) and verification may fail for 
older versions. If you are using Port25's PowerMTA, you need to use 
version 3.2r11 or later to get a compatible version of DKIM. 




========================================================== 
Original Email 
========================================================== 

Return-Path: <[email protected]> 
Received: from web3.rbftpnetworks.net (195.224.144.101) by verifier.port25.com id h3rjmm11u9c1 for <[email protected]>; Sun, 21 Sep 2014 10:57:47 -0400 (envelope-from <[email protected]>) 
Authentication-Results: verifier.port25.com; spf=pass [email protected] 
Authentication-Results: verifier.port25.com; domainkeys=neutral (message not signed) [email protected] 
Authentication-Results: verifier.port25.com; dkim=pass (matches From: [email protected]) header.d=flyawaysimulation.com 
Authentication-Results: verifier.port25.com; sender-id=pass [email protected] 
Received: by web3.rbftpnetworks.net (Postfix, from userid 70) 
    id CDAD13E6DCB8; Sun, 21 Sep 2014 15:57:46 +0100 (BST) 
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; 
    d=flyawaysimulation.com; s=mail; t=1411311466; 
    bh=PUR9ib4HOSSj9G3jmXSCyzc1LAtqQeyWPSAii67TLd8=; 
    h=To:Subject:Date:From:Reply-To:List-Help:List-Unsubscribe: 
    List-Subscribe:List-Owner; 
    b=skviRyhjPtB8aaRzLKyzkjay3Qk+Z5AOGg4Ue/Dk62SgvP1aZnf3kL1lCSWiwO1rI 
    VKYmMzzspbKLxMVrZ0yXO0s4wx5u9EFNw4eJMNh6fKCimiNwEoSGQRkJcjNb7wA9nG 
    38/FjbPIkvRyx1+hxgL9QOP3iSGv9w3X0UAFUmmc= 
To: check-auth-ryan=rbftpnetworks.com[email protected] 
Subject: Test 123 
Received: from host81-138-131-190.in-addr.btopenworld.com [81.138.131.190] by flyawaysimulation.com with HTTP; Sun, 21 Sep 2014 15:57:46 +0100 
Date: Sun, 21 Sep 2014 15:57:46 +0100 
From: Fly Away Simulation <[email protected]> 
Reply-To: Fly Away Simulation <[email protected]> 
Message-ID: <[email protected]> 
X-Priority: 3 
X-Mailer: PHPMailer 5.2.5 (https://github.com/Synchro/PHPMailer/) 
X-phpList-version: 3.0.7 
X-MessageID: 8 
X-ListMember: [email protected] 
Precedence: bulk 
Bounces-To: [email protected] 
List-Help: <https://flyawaysimulation.com/lists/?p=preferences&uid=1e629246241f8e9714134ee8076ad406> 
List-Unsubscribe: <https://flyawaysimulation.com/lists/?p=unsubscribe&uid=1e629246241f8e9714134ee8076ad406&jo=1> 
List-Subscribe: <https://flyawaysimulation.com/lists/?p=subscribe> 
List-Owner: <mailto:[email protected]> 
MIME-Version: 1.0 
Content-Type: multipart/alternative; 
    boundary="b1_4ecb49f93b720bc688fe3bcdcafed5b0" 

--b1_4ecb49f93b720bc688fe3bcdcafed5b0 
Content-Type: text/plain; charset=UTF-8 
Content-Transfer-Encoding: quoted-printable 

test 123 







=20 



--b1_4ecb49f93b720bc688fe3bcdcafed5b0 
Content-Type: text/html; charset=UTF-8 
Content-Transfer-Encoding: quoted-printable 

<html><head>=0A  <meta content=3D"text/html;charset=3DUTF-8" http-equ= 

iv=3D"Content-Type">=0A  <title></title></head><body><p>&nbsp;test 12= 

3</p>=0A<img src=3D"https://flyawaysimulation.com/lists/ut.php?u=3D1e629246= 

241f8e9714134ee8076ad406&amp;m=3D8" width=3D"1" height=3D"1" border=3D"0" /= 

> </body></html> 


--b1_4ecb49f93b720bc688fe3bcdcafed5b0-- 

發送到Gmail相同的消息:

Delivered-To: **** 
Received: by 10.170.191.196 with SMTP id i187csp139225yke; 
     Sun, 21 Sep 2014 08:05:20 -0700 (PDT) 
X-Received: by 10.194.134.100 with SMTP id pj4mr14856269wjb.72.1411311920538; 
     Sun, 21 Sep 2014 08:05:20 -0700 (PDT) 
Return-Path: <[email protected]> 
Received: from web3.rbftpnetworks.net (web3.rbftpnetworks.net. [195.224.144.101]) 
     by mx.google.com with ESMTP id db4si8324616wib.100.2014.09.21.08.05.20 
     for <****>; 
     Sun, 21 Sep 2014 08:05:20 -0700 (PDT) 
Received-SPF: pass (google.com: domain of [email protected] designates 195.224.144.101 as permitted sender) client-ip=195.224.144.101; 
Authentication-Results: mx.google.com; 
     spf=pass (google.com: domain of [email protected] designates 195.224.144.101 as permitted sender) [email protected]; 
     dkim=neutral (body hash did not verify) [email protected] 
Received: by web3.rbftpnetworks.net (Postfix, from userid 70) 
    id E11B93E6E003; Sun, 21 Sep 2014 16:05:18 +0100 (BST) 
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; 
    d=flyawaysimulation.com; s=mail; t=1411311919; 
    bh=d40fzjdg7KnEX5wH3Ea2b1ZzoQMu8dzZyP1dYsxaoVc=; 
    h=To:Subject:Date:From:Reply-To:List-Help:List-Unsubscribe: 
    List-Subscribe:List-Owner; 
    b=ub2LA6uRxpsgByD3RRUHqAGhlUu5d1gBgNadBBeaJdDP6pvSL/IX2Lzy6SqG2kGIK 
    dU7YnOmI3w0frerJZRldlSAZduKUQqaT0QZHfvUZVJnLihK8EIZ7GkzX+6VVE2Pojm 
    J8aVCq8fPOEuCG6mu2QdIUmpqkWO+s8bBYBYR6ro= 
To: ***** 
Subject: Test 123 
Received: from host81-138-131-190.in-addr.btopenworld.com [81.138.131.190] by flyawaysimulation.com with HTTP; Sun, 21 Sep 2014 16:05:18 +0100 
Date: Sun, 21 Sep 2014 16:05:18 +0100 
From: Fly Away Simulation <[email protected]> 
Reply-To: Fly Away Simulation <[email protected]> 
Message-ID: <[email protected]> 
X-Priority: 3 
X-Mailer: PHPMailer 5.2.5 (https://github.com/Synchro/PHPMailer/) 
X-phpList-version: 3.0.7 
X-MessageID: 8 
X-ListMember: **** 
Precedence: bulk 
Bounces-To: [email protected] 
List-Help: <https://flyawaysimulation.com/lists/?p=preferences&uid=58f4e3c38a321901b99d714dd5f54850> 
List-Unsubscribe: <https://flyawaysimulation.com/lists/?p=unsubscribe&uid=58f4e3c38a321901b99d714dd5f54850&jo=1> 
List-Subscribe: <https://flyawaysimulation.com/lists/?p=subscribe> 
List-Owner: <mailto:[email protected]> 
MIME-Version: 1.0 
Content-Type: multipart/alternative; 
    boundary="b1_8938d7bccca9e15cd846714ca4a01d04" 

--b1_8938d7bccca9e15cd846714ca4a01d04 
Content-Type: text/plain; charset=UTF-8 
Content-Transfer-Encoding: quoted-printable 

test 123 



=20 


--b1_8938d7bccca9e15cd846714ca4a01d04 
Content-Type: text/html; charset=UTF-8 
Content-Transfer-Encoding: quoted-printable 

<html><head>=0A  <meta content=3D"text/html;charset=3DUTF-8" http-equ= 
iv=3D"Content-Type">=0A  <title></title></head><body><p>&nbsp;test 12= 
3</p>=0A<img src=3D"https://flyawaysimulation.com/lists/ut.php?u=3D58f4e3c3= 
8a321901b99d714dd5f54850&amp;m=3D8" width=3D"1" height=3D"1" border=3D"0" /= 
></body></html> 


--b1_8938d7bccca9e15cd846714ca4a01d04-- 
+0

代碼改變?錯誤訊息?好的和壞的消息頭的例子?什麼版本的PHPMailer? – Synchro 2014-09-18 18:26:45

+0

對不起,我錯過了 - 示例電子郵件已包含在上面(什麼通過/失敗)。也已經確認了phpMailer版本。 – 2014-09-18 20:59:52

+0

你能找到解決這個問題的方法嗎?在發送除文本/純文本以外的電子郵件時,我也面臨DKIM失敗/中立的問題。嘗試幾乎所有我可以在這裏找到在stackoverflow和谷歌。 – Vishnu 2016-03-18 06:50:10

回答

0

似乎有兩個問題:

  1. 身體cano Port25驗證器完成的nicalization是錯誤的。在身體的末尾是
    > </body></html>。有空間被錯誤地刪除。否則,標準化是正確的。

  2. DKIM簽名中的主體哈希似乎不是Port25接收到的正文(有兩個不同的DKIM驗證程序,我得到主體哈希gjpXaqduU+jpM3yh1hPT5jqMSJZjHzi4KqAGlCG0/M8=)。這可能是由於簽名後郵件被更改或簽名過程中出現錯誤。 在opendkim中啓用KeepTemporaryFiles以查看opendkim完成的身體標準化,並將其與Port25中的標準進行比較(請記住錯誤刪除的空間)。如果可能的話,鎖定發送消息的來源並嘗試查看發送和接收主體之間的區別。

更新:與FixCRLF消息評論啓用:

phpList似乎產生電子郵件包含不同的行尾然後CRLFs,這是允許的電子郵件唯一的。通常這不是問題,但正如你所看到的,它可能會導致DKIM出現問題,因爲不同的行尾會產生不同的哈希值。

消息 「FixCRLF是」 Port25:

opendkim似乎有一個錯誤在它的規範化算法。在到Port25的消息中的線路> </body></html>被錯誤地導向到></body></html>(該空間被移除)。由於Port25中的驗證器具有相同的錯誤(因爲它可能也使用opendkim),因此Port25錯誤地將該簽名顯示爲有效。

這似乎並不是發送給Gmail的消息失敗的原因,但如果將消息發送給正在使用不同驗證程序然後opendkim的接收方,將來可能會導致麻煩。最好向他們報告這個問題。與此同時,您可以在發送消息之前自行移除空間。

消息「FixCRLF是」到Gmail:

電子郵件Gmail接收具有再少換行符從Port25收到的人。因此,除非發送消息已經不同,否則消息被改變。在opendkim中啓用「KeepTemporaryFiles」選項以查看由opendkim簽名的主體。

+0

在opendkim配置中將「FixCRLF」設置爲「yes」,它會在Port25上通過驗證。但是,具有相同配置的相同消息在gmail上無法驗證。這是否有任何亮光?謝謝你的幫助。 – 2014-09-20 12:56:57

+0

您能否將Port25的報告添加到您的初始文章? – user228011 2014-09-21 01:00:04

+0

我已經使用通過的FixCRLF測試消息更新了最初的帖子。我還包括髮送給Gmail的測試的消息源(失敗)。它通過Port25並在Gmail上失敗。感謝您的幫助。 – 2014-09-21 15:09:27

2

發送到Gmail時,我遇到了描述[PlainText DKIM = pass]和[HTMLBody DKIM = fail]的確切問題。我使用的是C# MailMessage,默認情況下,主體默認字符集是「us-ascii」,它適用於基於文本的電子郵件,但不適用於HTML。 Email Subject的默認字符集是UTF-8,因此不需要再次設置。

當發送HTML郵件,你必須在發送前編寫以下參數:

Mailmessage.BodyEncoding = Encoding.UTF8; 

使這個小小的改變後,Gmail會重新註冊我的郵件,我收到了DKIM =通過;當我查看原始來源時。此外,這些是相關頭

MIME-Version: 1.0 
Content-Type: text/html; charset=utf-8 
Content-Transfer-Encoding: base64 
*followed by block of base64 body text* 

也許你可以模擬使用PHP的行爲,也許你從

Content-Transfer-Encoding: quoted-printable 
to 
Content-Transfer-Encoding: base64