forked from extern/django-helpdesk
More bugs processing mail under python 3, on behalf of @spamandeggs for #590
This commit is contained in:
parent
1406c2a719
commit
283f5e9cec
@ -179,10 +179,11 @@ def process_queue(q, logger):
|
||||
if six.PY2:
|
||||
full_message = encoding.force_text("\n".join(server.retr(msgNum)[1]), errors='replace')
|
||||
else:
|
||||
popmsg = []
|
||||
for line in server.retr(msgNum)[1]:
|
||||
popmsg.append(line.encode())
|
||||
full_message = encoding.force_text(b"\n".join(popmsg), errors='replace')
|
||||
raw_content = server.retr(msgNum)[1]
|
||||
if type(raw_content[0]) is bytes:
|
||||
full_message = "\n".join([elm.decode('utf-8') for elm in raw_content])
|
||||
else :
|
||||
full_message = encoding.force_text("\n".join(raw_content), errors='replace')
|
||||
ticket = ticket_from_message(message=full_message, queue=q, logger=logger)
|
||||
|
||||
if ticket:
|
||||
|
Loading…
Reference in New Issue
Block a user