This is an automated email from the ASF dual-hosted git repository.
sebb 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 2acaf83 Simplify check for Mboxo
2acaf83 is described below
commit 2acaf839f994b1c48ccd4ee0c03c6685e3123839
Author: Sebb <[email protected]>
AuthorDate: Sat Nov 27 23:32:04 2021 +0000
Simplify check for Mboxo
---
tools/import-mbox.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index 51f0dde..fc7e54f 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -167,6 +167,7 @@ class SlurpThread(Thread):
stime = time.time()
tmpname = ""
delete_file = False
+ useMboxo = False
if imap:
imap4 = mla[2]
tmpname = "IMAP"
@@ -203,6 +204,7 @@ class SlurpThread(Thread):
if maildir:
messages = mailbox.Maildir(tmpname, create=False)
else:
+ useMboxo = (not noMboxo)
messages = mailbox.mbox(
tmpname, None if noMboxo else MboxoFactory,
create=False
)
@@ -242,7 +244,7 @@ class SlurpThread(Thread):
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":
+ if useMboxo:
file = MboxoReader(file)
message_raw = file.read()
file.close()