From 9e221ed29047ece677d00a668becc8b970d634a2 Mon Sep 17 00:00:00 2001 From: b3yond Date: Tue, 30 Jan 2018 16:09:29 +0100 Subject: [PATCH] Excepted IMAP connection Error --- .gitignore | 1 + mailbot.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8b2b385..3ccf5f8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__/ last_mention last_mail ticketfrei.cfg +ticketfrei.sqlite seen_toots.pickle seen_toots.pickle.part pip-selfcheck.json diff --git a/mailbot.py b/mailbot.py index d74e3b8..7ccc92e 100644 --- a/mailbot.py +++ b/mailbot.py @@ -73,8 +73,11 @@ class Mailbot(object): try: rv, data = self.mailbox.select("Inbox") except imaplib.IMAP4.abort: - logger.error("Crawling Mail failed", exc_info=True) - rv = False + rv = "Crawling Mail failed" + logger.error(rv, exc_info=True) + except TimeoutError: + rv = "No Connection" + logger.error(rv, exc_info=True) msgs = [] if rv == 'OK': rv, data = self.mailbox.search(None, "ALL")