mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-05-29 14:11:13 +02:00
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:
|
if six.PY2:
|
||||||
full_message = encoding.force_text("\n".join(server.retr(msgNum)[1]), errors='replace')
|
full_message = encoding.force_text("\n".join(server.retr(msgNum)[1]), errors='replace')
|
||||||
else:
|
else:
|
||||||
popmsg = []
|
raw_content = server.retr(msgNum)[1]
|
||||||
for line in server.retr(msgNum)[1]:
|
if type(raw_content[0]) is bytes:
|
||||||
popmsg.append(line.encode())
|
full_message = "\n".join([elm.decode('utf-8') for elm in raw_content])
|
||||||
full_message = encoding.force_text(b"\n".join(popmsg), errors='replace')
|
else :
|
||||||
|
full_message = encoding.force_text("\n".join(raw_content), errors='replace')
|
||||||
ticket = ticket_from_message(message=full_message, queue=q, logger=logger)
|
ticket = ticket_from_message(message=full_message, queue=q, logger=logger)
|
||||||
|
|
||||||
if ticket:
|
if ticket:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user