Message311947
According to https://tools.ietf.org/html/rfc6152 you should only send an 8bit email body when the server advertises 8BITMIME in the EHLO, and you should declare it with BODY=8BITMIME in the MAIL command.
The default cte_type is 8bit for the new default email policy which is what will be used by smtplib.send_message when it calls BytesGenerator.flatten, but it will not set BODY=8BITMIME even if the message has any 8-bit characters. It will only set BODY=8BITMIME if the message uses any utf-8 mail/from addresses. This means that a message with ASCII addresses and an 8-bit utf-8 body will be sent without BODY=8BITMIME (I think that's actually quite common).
What should be done is checking if the server advertises 8BITMIME, and if it doesn't use cte_type=7bit; if it does we should set BODY=8BITMIME if the policy is using cte_type=8bit.
I don't know whether any real email server chokes on this. But it's best to follow the RFC, I think. |
|
Date |
User |
Action |
Args |
2018-02-10 10:46:21 | Segev Finer | set | recipients:
+ Segev Finer, barry, r.david.murray |
2018-02-10 10:46:21 | Segev Finer | set | messageid: <1518259581.24.0.467229070634.issue32814@psf.upfronthosting.co.za> |
2018-02-10 10:46:21 | Segev Finer | link | issue32814 messages |
2018-02-10 10:46:20 | Segev Finer | create | |
|