diff --git a/helpdesk/management/commands/get_email.py b/helpdesk/management/commands/get_email.py index f7d00724..e0a329c3 100755 --- a/helpdesk/management/commands/get_email.py +++ b/helpdesk/management/commands/get_email.py @@ -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)