ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: Drop lid from 'cluster' hash - it's already in the id
Date Tue, 05 Sep 2017 22:41:00 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 0067ed59a -> 2801d8172


Drop lid from 'cluster' hash - it's already in the id

This fixes #400

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/2801d817
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/2801d817
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/2801d817

Branch: refs/heads/master
Commit: 2801d81727cf400b0c21e9f044870120482617fd
Parents: 0067ed5
Author: Sebb <sebb@apache.org>
Authored: Tue Sep 5 23:40:56 2017 +0100
Committer: Sebb <sebb@apache.org>
Committed: Tue Sep 5 23:40:56 2017 +0100

----------------------------------------------------------------------
 CHANGELOG.md        | 1 +
 tools/generators.py | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/2801d817/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9e1e89d..12a624f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## CHANGES in 0.10:
+- Drop lid from 'cluster' hash - it's already in the id (#400)
 - Enh: 'cluster' generator ids are not sufficiently unique (#398)
 - archiver/importer adds a Message-Id to mails if they don't have one (#403)
 - Fixed an issue with ID generation where an email body does not exist

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/2801d817/tools/generators.py
----------------------------------------------------------------------
diff --git a/tools/generators.py b/tools/generators.py
index f700412..63cc85e 100644
--- a/tools/generators.py
+++ b/tools/generators.py
@@ -128,9 +128,6 @@ def cluster(msg, body, lid, attachments):
     # Crop out any trailing whitespace in body
     xbody = re.sub(b"\s+$", b"", xbody)
     
-    # Use List ID
-    xbody += bytes(lid, encoding='ascii')
-
     # Use Message-Id (or '' if missing)
     xbody += bytes(msg.get('Message-Id', ''), encoding='ascii')
     
@@ -158,6 +155,8 @@ def cluster(msg, body, lid, attachments):
     if attachments:
         for a in attachments:
             xbody += bytes(a['hash'], encoding = 'ascii')
+
+    # generate the hash and combine with the lid to form the id
     mid = "r%s@%s" % (hashlib.sha224(xbody).hexdigest(), lid)
     return mid
 


Mime
View raw message