Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
In imaplib, deal with extra blank line
Some (buggy) IMAP servers add an extra blank line after a literal value. This ignores the blank line.
MacOS mail and T'bird can deal with the blank line so it seems to be a somewhat common server bug.
  • Loading branch information
jrlevine authored Jun 13, 2021
commit 30f68db816c96c7783ce6a8adcc983b90b3a6f5b
3 changes: 3 additions & 0 deletions Lib/imaplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,9 @@ def _get_response(self):
# Read trailer - possibly containing another literal

dat = self._get_line()
# ignore blank line some servers send after the counted data
if dat == b'':
dat = self._get_line()

self._append_untagged(typ, dat)

Expand Down