23 Sep
2020
23 Sep
'20
8:22 p.m.
Hi Mailman Users,
I apologize for sending multiple messages! I wanted to mention that this issue occurs whether or not the user with the malformed cc is a member of the list in question. I also noticed that the issues seem to be only happening with the addresses in quotes, and wondered if this snippet of code in avoid_duplicates.py gives any hints as to what the issues may be?
# We've seen messages with Cc: headers folded inside a quoted string.
# I.e., a message composed with several Cc addresses of the form
# 'real name (dept) <user@example.com>', the MUA quotes
# "real name (dept)" and then folds the header between 'name' and
# '(dept)' resulting in a header including the entry
# '"real name\r\n (dept)" <user@example.com>' which parses incorrectly,
# so we "unfold" headers here.
for header in ('to', 'cc', 'resent-to', 'resent-cc'):
hdrs_unfolded = [re.sub('[\r\n]', '', value) for value in
msg.get_all(header, [])]
addrs = getaddresses(hdrs_unfolded)
header_addresses = dict((addr, formataddr((name, addr)))
for name, addr in addrs
if addr)
Thanks again and have a nice day! Peter