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