Commit 97e2000
committed
bpo-40597: email: Use CTE if lines are longer than max_line_length consistently
RFC5322 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 is
applied if the lines would be too long without it.
However if our message is limited to 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.
Let's fix the CTE heuristic so it doesn't care about 7bit vs 8bit.1 parent d5d9a71 commit 97e2000
File tree
3 files changed
+23
-7
lines changed- Lib
- email
- test/test_email
- Misc/NEWS.d/next/Library
3 files changed
+23
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
332 | 347 | | |
333 | 348 | | |
334 | 349 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments