excepted IMAP4 error with unknown cause

This commit is contained in:
b3yond 2018-01-23 09:17:26 +01:00
parent ace28ee25a
commit c9d5f7441a

View file

@ -70,7 +70,11 @@ class Mailbot(object):
crawl for new mails.
:return: msgs: (list of report.Report objects)
"""
try:
rv, data = self.mailbox.select("Inbox")
except imaplib.IMAP4.abort:
logger.error("Crawling Mail failed", exc_info=True)
rv = False
msgs = []
if rv == 'OK':
rv, data = self.mailbox.search(None, "ALL")