Always log if the date is going to be corrected
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Thu, 28 Jun 2012 07:59:42 +0000 (09:59 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Thu, 28 Jun 2012 07:59:42 +0000 (09:59 +0200)
confscript.cfg
fix_imap_internaldate.py

index e287aa8..5e6f10a 100644 (file)
@@ -1,6 +1,6 @@
 [basic_settings]
 # 0 NOTSET, 10 DEBUG, 20 INFO, 30 WARNING, 40 ERROR, 50 CRITICAL 
-file_log_level = 20
+file_log_level = 10
 console_log_level = 20
 imap_server = intranator.m.i2n
 tolerance = 120
index d169f2b..06f39e0 100644 (file)
@@ -82,21 +82,21 @@ def main():
                     logging.error(ex)
                     continue
                 if(date_parser.compare_dates(received_date, internal_date, tolerance)):
-                    #print(received_date, internal_date)
+                    logging.warning("Date conflict found in message uid: %s - mailbox: %s - user: %s.\nInternal date %s is different from received date %s from RECEIVED header:\n%s.",
+                                    mid.decode('iso-8859-1'), box.name, box.owner,
+                                    internal_date.strftime("%d %b %Y %H:%M:%S"),
+                                    received_date.strftime("%d %b %Y %H:%M:%S"),
+                                    fetched_received_date.split("Received:")[1])
                     if(args.test_mode==0):
                         try:
                             session.update_message(mid, box.name, received_date)
                         except UserWarning as ex:
                             logging.error(ex)
                             continue
-                    else:
-                        logging.warning("Date conflict found in message uid: %s - mailbox: %s - user: %s.\nInternal date %s is different from received date %s from RECEIVED header:\n%s.",
-                                        mid.decode('iso-8859-1'), box.name, box.owner,
-                                        internal_date.strftime("%d %b %Y %H:%M:%S"),
-                                        received_date.strftime("%d %b %Y %H:%M:%S"),
-                                        fetched_received_date.split("Received:")[1])
+
                     # count total emails for every user and mailbox
                     box.date_conflicts += 1
+
             # if all messages were successfully fixed confirm caching
             if(not args.test_mode):
                 box.confirm_change()