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

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


The following commit(s) were added to refs/heads/master by this push:
     new e88e382  Revert for now, as there is unintended normalization in 
msg.as_bytes()
     new b42d951  Merge branch 'master' of 
github.com:apache/incubator-ponymail-foal
e88e382 is described below

commit e88e3822a30b485edfac7488c8572d900f29ec79
Author: Daniel Gruno <[email protected]>
AuthorDate: Tue Aug 25 19:55:09 2020 +0200

    Revert for now, as there is unintended normalization in msg.as_bytes()
    
    This breaks unit tests, as .as_bytes does header normalization.
    It is unclear whether this is stable behavior.
---
 tools/plugins/generators.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/plugins/generators.py b/tools/plugins/generators.py
index 344f115..e626a47 100644
--- a/tools/plugins/generators.py
+++ b/tools/plugins/generators.py
@@ -151,7 +151,7 @@ def dkim(_msg, _body, lid, _attachments, raw_msg):
 # Full generator: uses the entire email (including server-dependent data)
 # Used by default until August 2020.
 # See 'dkim' for recommended generation.
-def full(_msg, _body, lid, _attachments, raw_msg):
+def full(msg, _body, lid, _attachments, _raw_msg):
     """
     Full generator: uses the entire email
     (including server-dependent data)
@@ -159,15 +159,15 @@ def full(_msg, _body, lid, _attachments, raw_msg):
     but different copies of the message are likely to have different headers, 
thus ids
 
     Parameters:
-    msg - the parsed message (not used)
+    msg - the parsed message
     _body - the parsed text content (not used)
     lid - list id
     _attachments - list of attachments (not used)
-    raw_msg - the original message bytes
+    raw_msg - the original message bytes (not used)
 
     Returns: "<hash>@<lid>" where hash is sha224 of message bytes
     """
-    mid = "%s@%s" % (hashlib.sha224(raw_msg).hexdigest(), lid)
+    mid = "%s@%s" % (hashlib.sha224(msg.as_bytes()).hexdigest(), lid)
     return mid
 
 

Reply via email to