1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-17 22:01:49 -05:00

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

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.")