fix duplicate message handling
authorJann Horn <jann@thejh.net>
Mon, 2 Sep 2024 00:57:21 +0000 (02:57 +0200)
committerJann Horn <jann@thejh.net>
Mon, 2 Sep 2024 00:57:21 +0000 (02:57 +0200)
main.py

diff --git a/main.py b/main.py
index 3481978..b1904c6 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -325,6 +325,9 @@ def parse_mbox(mail_path):
     message_index = 0
     for msg in mbox:
         tmsg = ThreadMessage(msg, message_index)
+        # skip duplicate messages
+        if tmsg.id in messages_by_id:
+            continue
         message_index += 1
         messages_by_id[tmsg.id] = tmsg
         #print('have message "'+tmsg.id+'"')