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: Ensure source is also processed fix mboxo 'From ' escaping
Date Tue, 26 Sep 2017 11:59:09 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 794fd16e1 -> 3a9b1929a


Ensure source is also processed fix mboxo 'From ' escaping

This is a follow-up to commit:
d23d649ae46ecb17d5331571c09d6fa58a9b3859

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

Branch: refs/heads/master
Commit: 3a9b1929a4a085111e33afa83f23162eaca46632
Parents: 794fd16
Author: Sebb <sebb@apache.org>
Authored: Tue Sep 26 12:59:05 2017 +0100
Committer: Sebb <sebb@apache.org>
Committed: Tue Sep 26 12:59:05 2017 +0100

----------------------------------------------------------------------
 tools/import-mbox.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/3a9b1929/tools/import-mbox.py
----------------------------------------------------------------------
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index c983f80..834a8f4 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -37,7 +37,7 @@ import gzip
 
 # Temporary patch to fix Python email package limitation
 # It must be removed when the Python package is fixed
-from mboxo_patch import MboxoFactory
+from mboxo_patch import MboxoFactory, MboxoReader
 
 try:
     from elasticsearch import Elasticsearch, helpers
@@ -308,6 +308,10 @@ class SlurpThread(Thread):
 
                 if json:
                     file=messages.get_file(key, True)
+                    # If the parsed data is filtered, also need to filter the raw input
+                    # so the source agrees with the summary info
+                    if message.__class__.__name__ == 'MboxoFactory':
+                        file=MboxoReader(file)
                     raw_msg=file.read()
                     file.close()
                     if args.dups:


Mime
View raw message