Merge pull request #1036 from martin-marty/redundant_cc_code_in_email

Remove left over 'cc' code
This commit is contained in:
Garret Wassermann 2022-07-22 13:52:54 -04:00 committed by GitHub
commit 681e8b267d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -539,19 +539,6 @@ def object_from_message(message, queue, logger):
sender_email = email.utils.getaddresses( sender_email = email.utils.getaddresses(
['\"' + sender.replace('<', '\" <')])[0][1] ['\"' + sender.replace('<', '\" <')])[0][1]
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(','))
# use a set to ensure no duplicates
cc = set([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):
if ignore.keep_in_mailbox: if ignore.keep_in_mailbox: