Apply hotfix for get_email fails, #590

This commit is contained in:
Garret Wassermann 2018-02-27 20:18:51 -05:00
parent 8473f2de8a
commit 7982774ee1

View File

@ -235,7 +235,10 @@ def process_queue(q, logger):
logger.info("Processing message %s" % num)
status, data = server.fetch(num, '(RFC822)')
full_message = encoding.force_text(data[0][1], errors='replace')
ticket = ticket_from_message(message=full_message, queue=q, logger=logger)
try:
ticket = ticket_from_message(message=full_message, queue=q, logger=logger)
except TypeError:
ticket = None # hotfix. Need to work out WHY.
if ticket:
server.store(num, '+FLAGS', '\\Deleted')
logger.info("Successfully processed message %s, deleted from IMAP server" % num)