Merge pull request #34 from b3yond/master

Backporting IMAP error exceptions
remotes/1705286528371406548/stable1^2
b3yond 2018-09-08 11:29:01 +02:00 committed by GitHub
commit 05c09c97c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ __pycache__/
last_mention
last_mail
ticketfrei.cfg
ticketfrei.sqlite
seen_toots.pickle
seen_toots.pickle.part
pip-selfcheck.json

View File

@ -74,7 +74,7 @@ feel free to use them as an orientation.
Just add the words to the goodlist, which you want to require. A
report is only spread, if it contains at least one of them. If you
want to RT everything, just add a ```\*```.
want to RT everything, just add a ```*```.
There is also a blacklist, which you can use to automatically sort
out malicious tweets. Be careful though, our filter can't read the

View File

@ -70,7 +70,14 @@ class Mailbot(object):
crawl for new mails.
:return: msgs: (list of report.Report objects)
"""
rv, data = self.mailbox.select("Inbox")
try:
rv, data = self.mailbox.select("Inbox")
except imaplib.IMAP4.abort:
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")