You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2020/09/10 13:02:14 UTC

[incubator-ponymail-foal] 03/04: append to notes, but pop the ARCHIVE one if found.

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit b8a849c5c7a0eed21a2d2d8f38172b9063594d62
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Thu Sep 10 15:01:13 2020 +0200

    append to notes, but pop the ARCHIVE one if found.
---
 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 177ce00..4bdab7b 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -311,7 +311,9 @@ class SlurpThread(Thread):
                             ]
 
                     # Mark that we imported this email
-                    json["notes"] = ["IMPORT: Email imported at %u" % int(time.time())]
+                    json["notes"] = [x for x in json["notes"] if "ARCHIVE:" not in x]  # Pop archiver.py note
+                    json["notes"].append(["IMPORT: Email imported at %u" % time.time()])
+
                     try:  # temporary hack to try and find an encoding issue
                         # needs to be replaced by proper exception handling
                         json_source = {