|
@@ -1,10 +1,11 @@
|
|
|
-from imap_tools import MailBox, AND, MailMessage
|
|
|
-import re
|
|
|
import json
|
|
|
import os
|
|
|
-import plac
|
|
|
-from datetime import datetime, date
|
|
|
+import re
|
|
|
from dataclasses import dataclass
|
|
|
+from datetime import datetime, timedelta
|
|
|
+
|
|
|
+import plac
|
|
|
+from imap_tools import AND, MailBox, MailMessage
|
|
|
|
|
|
|
|
|
@dataclass
|
|
@@ -35,7 +36,7 @@ class Imap:
|
|
|
|
|
|
def cleanup(self):
|
|
|
date_now = datetime.now()
|
|
|
- date_criteria = date(date_now.year, date_now.month - 1, 1)
|
|
|
+ date_criteria = (date_now - timedelta(days=60)).date()
|
|
|
msg_limit = 100
|
|
|
|
|
|
with self.connect("archiv") as mb:
|