Skip to content

Commit

Permalink
feat: add logging during processing
Browse files Browse the repository at this point in the history
  • Loading branch information
fl42 committed Nov 24, 2024
1 parent aef809c commit a99b5e3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions imap2imap.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ def forward(self, src_imap_config, dest_imap_config):
# Update watchdog also for each message processed to avoid timeout for large mailboxes
self.watchdog = time()

if counter_success % 100 == 0 or counter_failure % 100 == 0:
self.log.info(
"Successfuly forwarded %d messages (%d failed) over %d so far, continuing...",
counter_success,
counter_failure,
len(message_list)
)

self.src_imap.expunge()
self.src_imap.close()
self.src_imap.logout()
Expand Down

0 comments on commit a99b5e3

Please sign in to comment.