Wrap another server call with try except

Dreamhost email is total garbage.  Stop using it.
This commit is contained in:
Hemna 2021-02-05 15:32:36 -05:00
parent a5cc274ff5
commit 131919bdfb
1 changed files with 9 additions and 4 deletions

View File

@ -480,10 +480,15 @@ class APRSDEmailThread(threads.APRSDThread):
# LOG.debug("Message flags/tags: " + str(server.get_flags(msgid)[msgid]))
# if "APRS" not in server.get_flags(msgid)[msgid]:
# in python3, imap tags are unicode. in py2 they're strings. so .decode them to handle both
taglist = [
x.decode(errors="ignore")
for x in server.get_flags(msgid)[msgid]
]
try:
taglist = [
x.decode(errors="ignore")
for x in server.get_flags(msgid)[msgid]
]
except Exception as e:
LOG.exception("Failed to get flags.", e)
break
if "APRS" not in taglist:
# if msg not flagged as sent via aprs
LOG.debug("Try single fetch.")