Templated SMTP Output: Enforce SMTPUTF8 policy#2546
Templated SMTP Output: Enforce SMTPUTF8 policy#2546Psych0meter wants to merge 3 commits intocerttools:developfrom
Conversation
|
Thank you for the fix! I'll look into it, hopefully this weekend. If the CI tests fail, it's likely not because of your changes. |
|
I'm struggling to reproduce the error you are getting with For this purpose I added the character to the tests: sebix@40cbc90 The switch to the UT8 Policy also changes the line separator
In your example, the non-ASCII characters are in the subject, not in from or to. https://docs.python.org/3/library/email.policy.html#email.policy.EmailPolicy.utf8
So the switch doesn't enable/disable UTF-8, it just activates the conversion. Both settings should work. |
|
I now tested sending an e-mail with a recipient-address containing a non-ASCII character ( But the result is the same, independent of using So the issue is not the subject but the sender/recipient address and that your server doesn't support SMTPUTF8 and therefore requires a conversion for compatibility. |
|
So what to do with this PR now? Merge or leave? |
|
IMO postpone until the situation (bug report) is clarified. |
The bot encountered this kind of error when processing emails containing non-ASCII characters (e.g., accents or special symbols):
UnicodeEncodeError: 'ascii' codec can't encode character '\xe0' in position 4: ordinal not in range(128)Dump example :