forked from extern/django-helpdesk
Fix encoding first before splitting strings, so it works on Python 2
This commit is contained in:
parent
7b8426596f
commit
8e1a6b30fa
@ -276,11 +276,13 @@ def ticket_from_message(message, queue, logger):
|
|||||||
|
|
||||||
cc = message.get_all('cc', None)
|
cc = message.get_all('cc', None)
|
||||||
if cc:
|
if cc:
|
||||||
|
# first, fixup the encoding if necessary
|
||||||
|
cc = [decode_mail_headers(decodeUnknown(message.get_charset(), x)) for x in cc]
|
||||||
# get_all checks if multiple CC headers, but individual emails may be comma separated too
|
# get_all checks if multiple CC headers, but individual emails may be comma separated too
|
||||||
tempcc = []
|
tempcc = []
|
||||||
for hdr in cc:
|
for hdr in cc:
|
||||||
tempcc.extend(hdr.split(','))
|
tempcc.extend(hdr.split(','))
|
||||||
cc = [decode_mail_headers(decodeUnknown(message.get_charset(), x.strip())) for x in tempcc]
|
cc = [x.strip() for x in tempcc]
|
||||||
|
|
||||||
for ignore in IgnoreEmail.objects.filter(Q(queues=queue) | Q(queues__isnull=True)):
|
for ignore in IgnoreEmail.objects.filter(Q(queues=queue) | Q(queues__isnull=True)):
|
||||||
if ignore.test(sender_email):
|
if ignore.test(sender_email):
|
||||||
|
Loading…
Reference in New Issue
Block a user