When during address list folding a separating comma ends up on a folded line containing that is to be unicode-encoded than the separator itself is also unicode encoded. Instead the comma should still a plain comma.
ZZZ: host YYY said:
550 Invalid address in message header. Consult RFC2822. (in reply to end of
DATA command)
>>>importemail>>>m=email.message.EmailMessage()
>>>t='01234567890123456789012345678901234567890123456789012345678901@example.org, ä <foo@example.org>'>>>m['to'] =t>>>m.as_string()
'to: 01234567890123456789012345678901234567890123456789012345678901@example.org\n =?utf-8?q?=2C?= =?utf-8?q?=C3=A4?= <foo@example.org>\n\n'
Bug report
When during address list folding a separating comma ends up on a folded line containing that is to be unicode-encoded than the separator itself is also unicode encoded. Instead the comma should still a plain comma.
This is rejected by some mail servers:
Minimal example:
Your environment
Linked PRs