This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Segev Finer
Recipients Segev Finer, barry, r.david.murray
Date 2018-02-10.10:46:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1518259581.24.0.467229070634.issue32814@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-02-10 10:46:21Segev Finersetrecipients: + Segev Finer, barry, r.david.murray
2018-02-10 10:46:21Segev Finersetmessageid: <1518259581.24.0.467229070634.issue32814@psf.upfronthosting.co.za>
2018-02-10 10:46:21Segev Finerlinkissue32814 messages
2018-02-10 10:46:20Segev Finercreate