You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2021/10/09 08:49:22 UTC

[incubator-ponymail-foal] 02/02: Revert "Strip trailing \r\n from list-id value"

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit 77b63f6cbb698d9b03c0b3501a617a6788920d58
Author: Sebb <se...@apache.org>
AuthorDate: Sat Oct 9 09:45:03 2021 +0100

    Revert "Strip trailing \r\n from list-id value"
    
    This reverts commit 94e3efc9f27cb6d1bee3bbbfb74961bf7d7da7bd.
---
 tools/plugins/dkim_id.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/plugins/dkim_id.py b/tools/plugins/dkim_id.py
index 27c6e79..0fdc410 100644
--- a/tools/plugins/dkim_id.py
+++ b/tools/plugins/dkim_id.py
@@ -321,12 +321,12 @@ def rfc6376_reformed_canon(
     # print(headers, body)
     k: bytes
     v: bytes
-    # If any List-Id header is set to the LID, lid is not needed in the hash
+    # If any List-Id header is set to the LID, lid is empty
     for (k, v) in headers:
-        # N.B. headers still contain trailing \r\n
-        if k == b"list-id" and v.rstrip() == lid:
-            lid = None
-            break
+        if k == b"list-id":
+            if v == lid:
+                lid = None
+                break
     # Construct hashable bytes from the parsed message
     return (lid or b"", rfc6376_join(headers, body))