ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject [1/4] incubator-ponymail git commit: be more comprehensive in generating IDs
Date Sun, 04 Jun 2017 14:02:01 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 767d8f8c1 -> c58b23127


be more comprehensive in generating IDs

Include whatever metadata we can in generating IDs to lessen the
risk of theoretical ID collisions.


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

Branch: refs/heads/master
Commit: 8b7ede85f03bd738d42e8e87f2302e4c8ddb0ad3
Parents: 767d8f8
Author: Daniel Gruno <humbedooh@apache.org>
Authored: Sun Jun 4 15:21:23 2017 +0200
Committer: Daniel Gruno <humbedooh@apache.org>
Committed: Sun Jun 4 15:21:23 2017 +0200

----------------------------------------------------------------------
 CHANGELOG.md      | 1 +
 tools/archiver.py | 3 +++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/8b7ede85/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 275b0df..be595de 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## CHANGES in 0.10:
+- more comprehensive ID generation mechanisms
 - private messages are now included in downloads if the user has access to them (#169, #108)
 - mbox export now generates valid From_ line (#190)
 - mbox export now escapes 'From ' lines in body text (#188)

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/8b7ede85/tools/archiver.py
----------------------------------------------------------------------
diff --git a/tools/archiver.py b/tools/archiver.py
index 141a431..41933f7 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -324,6 +324,9 @@ class Archiver(object):
                     xbody += bytes(lid, encoding='ascii')
                     xbody += bytes(mdatestring, encoding='ascii')
                     mid = "%s@%s" % (hashlib.sha224(xbody).hexdigest(), lid)
+                    if attachments:
+                        for a in attachments:
+                            xbody += bytes(a['hash'], encoding = 'ascii')
                 else:
                     # Or revert to the old way?
                     mid = "%s@%s@%s" % (hashlib.sha224(body if type(body) is bytes else body.encode('ascii',
'ignore')).hexdigest(), uid_mdate, lid)


Mime
View raw message