Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 936da2a

Browse files
committed
#23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes.
1 parent beed840 commit 936da2a

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

Lib/imaplib.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@
4545

4646
# Maximal line length when calling readline(). This is to prevent
4747
# reading arbitrary length lines. RFC 3501 and 2060 (IMAP 4rev1)
48-
# don't specify a line length. RFC 2683 however suggests limiting client
49-
# command lines to 1000 octets and server command lines to 8000 octets.
50-
# We have selected 10000 for some extra margin and since that is supposedly
51-
# also what UW and Panda IMAP does.
52-
_MAXLINE = 10000
48+
# don't specify a line length. RFC 2683 suggests limiting client
49+
# command lines to 1000 octets and that servers should be prepared
50+
# to accept command lines up to 8000 octets, so we used to use 10K here.
51+
# In the modern world (eg: gmail) the response to, for example, a
52+
# search command can be quite large, so we now use 1M.
53+
_MAXLINE = 1000000
5354

5455

5556
# Commands

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Core and Builtins
1818
Library
1919
-------
2020

21+
- Issue #23647: Increase impalib's MAXLINE to accommodate modern mailbox sizes.
22+
2123
- Issue #23539: If body is None, http.client.HTTPConnection.request now sets
2224
Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors from
2325
some web servers.

0 commit comments

Comments
 (0)