ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject incubator-ponymail git commit: add a medium mid generator for clustered setups
Date Wed, 01 Jun 2016 12:58:32 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 43d70910c -> aa9896101


add a medium mid generator for clustered setups


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

Branch: refs/heads/master
Commit: aa98961019c7c660c8c610449f5640afa1228cfb
Parents: 43d7091
Author: humbedooh <humbedooh@apache.org>
Authored: Wed Jun 1 14:58:18 2016 +0200
Committer: humbedooh <humbedooh@apache.org>
Committed: Wed Jun 1 14:58:18 2016 +0200

----------------------------------------------------------------------
 tools/archiver.py | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/aa989610/tools/archiver.py
----------------------------------------------------------------------
diff --git a/tools/archiver.py b/tools/archiver.py
index 010e88e..f350f5f 100644
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -299,6 +299,11 @@ class Archiver(object):
                 # Use full message as bytes for mid?
                 if config.has_section('archiver') and config.has_option("archiver", "generator")
and config.get("archiver", "generator") == "full":
                     mid = "%s@%s" % (hashlib.sha224(msg.as_bytes()).hexdigest(), lid)
+                elif config.has_section('archiver') and config.has_option("archiver", "generator")
and config.get("archiver", "generator") == "medium":
+                    xbody = body if type(body) is bytes else body.encode('ascii', 'ignore')
+                    xbody += bytes(lid)
+                    xbody += bytes(uid_mdate)
+                    mid = "%s@%s" % (hashlib.sha224(xbody).hexdigest(), lid)
                 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