[New-bugs-announce] [issue40597] generated email message exceeds RFC-mandated limit of 998 characters

Arkadiusz Hiler report at bugs.python.org
Mon May 11 15:00:19 EDT 2020


New submission from Arkadiusz Hiler <arek at hiler.eu>:

RFC5322[0] in section 2.1.1 mandates that the line cannot be longer than 998 characters and should not be longer than 78 characters (excluding CRLF). When we use raw_data_manager (default for EmailPolicy, EmailMessage) it does the correct thing as long as the message contains characters outside of 7bit US-ASCII set - base64 or qp Content-Transfer-Encoding which respects the line wrapping at 78 characters.

However if our message is limited the characters from the 7bit US-ASCII set no transfer encoding is applied, and such messages can easily go beyond 78 or even 998 characters.


[0]: https://tools.ietf.org/html/rfc5322.html#section-2.1.1

----------
components: email
messages: 368641
nosy: barry, ivyl, r.david.murray
priority: normal
severity: normal
status: open
title: generated email message exceeds RFC-mandated limit of 998 characters
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40597>
_______________________________________


More information about the New-bugs-announce mailing list