From 45115ba5c77d86ffa3dee0aee775e97f7b3fd9eb Mon Sep 17 00:00:00 2001 From: Garret Wassermann Date: Wed, 7 Feb 2018 03:01:27 -0500 Subject: [PATCH] Actually fix #582 according to quickcheck unittests --- helpdesk/management/commands/get_email.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/helpdesk/management/commands/get_email.py b/helpdesk/management/commands/get_email.py index 46aedf60..94ad204c 100755 --- a/helpdesk/management/commands/get_email.py +++ b/helpdesk/management/commands/get_email.py @@ -179,8 +179,10 @@ def process_queue(q, logger): if six.PY2: full_message = encoding.force_text("\n".join(server.retr(msgNum)[1]), errors='replace') else: - popmsg = server.retr(msgNum)[1] - full_message = encoding.force_text(b"\n".join(popmsg.encode()), errors='replace') + popmsg = [] + for line in server.retr(msgNum)[1]: + popmsg.append(line.encode()) + full_message = encoding.force_text(b"\n".join(popmsg), errors='replace') ticket = ticket_from_message(message=full_message, queue=q, logger=logger) if ticket: