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:11 UTC

[incubator-ponymail-foal] branch master updated (988e5ea -> 5bf34d0)

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

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


    from 988e5ea  forgot to add magic number
     new 140eb56  set in notes whether an email was live-archived or imported
     new 658e79d  make a list for notes, add bad date exceptions
     new b8a849c  append to notes, but pop the ARCHIVE one if found.
     new 5bf34d0  note what we imported it as

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tools/archiver.py    | 8 +++++++-
 tools/import-mbox.py | 4 ++++
 2 files changed, 11 insertions(+), 1 deletion(-)


[incubator-ponymail-foal] 04/04: note what we imported it as

Posted by hu...@apache.org.
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 5bf34d083756303ec45f73afae08e0d655966c8f
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Thu Sep 10 15:02:01 2020 +0200

    note what we imported it as
---
 tools/import-mbox.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index 4bdab7b..02ccf55 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -312,7 +312,7 @@ class SlurpThread(Thread):
 
                     # Mark that we imported this email
                     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()])
+                    json["notes"].append(["IMPORT: Email imported as %s at %u" % (json["mid"], time.time())])
 
                     try:  # temporary hack to try and find an encoding issue
                         # needs to be replaced by proper exception handling


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

Posted by hu...@apache.org.
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 = {


[incubator-ponymail-foal] 02/04: make a list for notes, add bad date exceptions

Posted by hu...@apache.org.
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 658e79dda432c50372844539f67370c60f163461
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Thu Sep 10 15:00:46 2020 +0200

    make a list for notes, add bad date exceptions
---
 tools/archiver.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/archiver.py b/tools/archiver.py
index 93531eb..255866f 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -359,6 +359,7 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
                 the digested email as a dict, its attachments, its metadata fields and any
                 in-reply-to data found.
         """
+        notes = []  # Put debug notes in here, for later...
 
         if not lid:
             lid = normalize_lid(msg.get("list-id"))
@@ -407,11 +408,13 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
             )
 
         if not message_date:
+            epoch = time.time()
+            notes.append(["BADDATE: Email date missing or invalid, setting to %u" % epoch])
             print(
                 "Date (%s) seems totally wrong, using current UNIX epoch instead."
                 % message_date
             )
-            epoch = time.time()
+
         else:
             epoch = email.utils.mktime_tz(message_date)
         # message_date calculations are all done, prepare the index entry
@@ -469,6 +472,8 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
                     irt = ""
             document_id = id_set[0]
 
+            notes.append(["ARCHIVE: Email archived as %s at %u" % (document_id, time.time())])
+
             output_json = {
                 "from_raw": msg_metadata["from"],
                 "from": msg_metadata["from"],
@@ -489,7 +494,7 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
                 "body": body.unflow() if body else "",
                 "html_source_only": body and body.html_as_source or False,
                 "attachments": attachments,
-                "notes": ["ARCHIVE: Email archived at %u" % int(time.time())]
+                "notes": notes,
             }
 
         return output_json, contents, msg_metadata, irt


[incubator-ponymail-foal] 01/04: set in notes whether an email was live-archived or imported

Posted by hu...@apache.org.
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 140eb562af9021b3ca9d2e49d0a6223ccf2412db
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Thu Sep 10 14:53:31 2020 +0200

    set in notes whether an email was live-archived or imported
---
 tools/archiver.py    | 1 +
 tools/import-mbox.py | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/tools/archiver.py b/tools/archiver.py
index b7328dd..93531eb 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -489,6 +489,7 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
                 "body": body.unflow() if body else "",
                 "html_source_only": body and body.html_as_source or False,
                 "attachments": attachments,
+                "notes": ["ARCHIVE: Email archived at %u" % int(time.time())]
             }
 
         return output_json, contents, msg_metadata, irt
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index 7c22ba9..177ce00 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -310,6 +310,8 @@ class SlurpThread(Thread):
                                 json["message-id"] + " in " + filename
                             ]
 
+                    # Mark that we imported this email
+                    json["notes"] = ["IMPORT: Email imported at %u" % int(time.time())]
                     try:  # temporary hack to try and find an encoding issue
                         # needs to be replaced by proper exception handling
                         json_source = {