diff --git a/helpdesk/management/commands/get_email.py b/helpdesk/management/commands/get_email.py index aa66a52f..3fa3d38a 100644 --- a/helpdesk/management/commands/get_email.py +++ b/helpdesk/management/commands/get_email.py @@ -276,11 +276,13 @@ def ticket_from_message(message, queue, logger): cc = message.get_all('cc', None) 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 tempcc = [] for hdr in cc: 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)): if ignore.test(sender_email):