add debug

This commit is contained in:
Antonio J. Delgado 2025-03-27 07:45:35 +02:00
parent 1f04a016a3
commit 5526801f30

View file

@ -106,13 +106,15 @@ class BackupImap:
try:
search_response, search_data = self.imap.search('UTF-8', 'UNDELETED')
search_succeeded = True
except Exception as error:
imaplib._MAXLINE += 10000
self._log.debug(
"Error searching mailbox, increasing maxline to %s. %s",
imaplib._MAXLINE,
error
)
except imaplib.IMAP4.error as error:
error_str = f"{error.__str__}"
if 'got more than' in error_str:
imaplib._MAXLINE += 10000
self._log.debug(
"Error searching mailbox, increasing maxline to %s. %s",
imaplib._MAXLINE,
error
)
if search_response == 'OK':
all_msgs_uids = search_data[0].split()
self._log.debug(
@ -179,6 +181,10 @@ class BackupImap:
message_path,
error
)
else:
self._log.debug(
"Skipping already backed up message"
)
def _backedup_message(self, message_id, mailbox):
for message in self.data['backedup_messages']: