From fe9288092835b1d70aa209e2a1e013f6af881224 Mon Sep 17 00:00:00 2001 From: Jonathan Barratt Date: Fri, 13 Jan 2017 17:11:35 +0700 Subject: [PATCH] do not throw exceptions for invalid/non-UTF8 IMAP content --- helpdesk/management/commands/get_email.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpdesk/management/commands/get_email.py b/helpdesk/management/commands/get_email.py index 90916a72..97b5b8cc 100644 --- a/helpdesk/management/commands/get_email.py +++ b/helpdesk/management/commands/get_email.py @@ -198,7 +198,7 @@ def process_queue(q, logger): for num in msgnums: logger.info("Processing message %s" % num) status, data = server.fetch(num, '(RFC822)') - ticket = ticket_from_message(message=encoding.smart_text(data[0][1]), queue=q, logger=logger) + ticket = ticket_from_message(message=encoding.smart_text(data[0][1], errors='replace'), queue=q, logger=logger) if ticket: server.store(num, '+FLAGS', '\\Deleted') logger.info("Successfully processed message %s, deleted from IMAP server" % num)