Tolerance cache validation added
[imap-fix-internaldate] / fix_imap_internaldate.py
index 5ac1d5c..30ee148 100644 (file)
@@ -55,7 +55,7 @@ def main():
     caching_data = CachingData()
     logging.warning("Cache version %s loaded.", caching_data.version)
     user_reader = csv.DictReader(open("userdata.csv", "r"), delimiter=',')
-    
+
     # server name is stored in the config
     server = config.get('basic_settings', 'imap_server')
     # tolerance is now in seconds
@@ -71,7 +71,7 @@ def main():
             try:
                 box = caching_data.retrieve_cached_mailbox(mailbox[0], mailbox[1], user['username'])
                 mail_ids = session.fetch_messages()
-                new_ids = box.synchronize(mail_ids)
+                new_ids = box.synchronize(mail_ids, tolerance)
                 logging.info("%s new messages out of %s found in %s.", len(new_ids), len(mail_ids), box.name)
             except UserWarning as ex:
                 logging.error(ex)
@@ -111,7 +111,7 @@ def main():
                 box.confirm_change()
 
         # final report on date conflicts
-        caching_data.report_date_conflicts()
+        caching_data.report_conflicts()
 
 def load_configuration():
     """Loads the script configuration from a file or creates such."""