New submission from Alexander Mohr <[email protected]>:
If you have a reply-to list that contains a name with a comma it must be
quoted, however if the line length is just right python with split the name
incorrectly and not keep the quote. Note that the CC line keeps the quote in
the name but the reply-to does not, presumably since the line is slightly
longer.
example:
from email.message import EmailMessage
def main():
message = EmailMessage()
message['From'] = '[email protected]'
message['Reply-To'] = """MEGAN FOOOBAAAAAR
<[email protected]>,"KDJEHGI, SCOTT KJUYT"
<[email protected]>"""
message['To'] = """"KDJEHGI, SCOTT KJUYT" <[email protected]>"""
message['Subject'] = "does not matter"
message['CC'] = """MEGAN FOOOBAAAAAR <[email protected]>,"KDJEHGI,
SCOTT KJUYT" <[email protected]>"""
message.set_content('foo bar')
print(message.as_string())
if __name__ == '__main__':
main()
----------
components: email
messages: 407329
nosy: barry, r.david.murray, thehesiod
priority: normal
severity: normal
status: open
title: EmailMessage incorrectly splits reply-to header
type: behavior
versions: Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue45932>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com