]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-63121: Refresh imaplib capabilities on state changes (GH-152752) (GH-152855)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 2 Jul 2026 07:38:30 +0000 (09:38 +0200)
committerGitHub <noreply@github.com>
Thu, 2 Jul 2026 07:38:30 +0000 (07:38 +0000)
commit9f4a9447217e30d350d64a3b808ee44b4a3c7cbd
tree604ba869f43d452e23fcf4779b80837836ac6dcc
parent7449390ade454a5a565a12166f74c008a1699fcd
[3.14] gh-63121: Refresh imaplib capabilities on state changes (GH-152752) (GH-152855)

imaplib fetched the server capabilities only once, at connection time.
They are now also refreshed after a successful LOGIN or AUTHENTICATE,
from the CAPABILITY response the server sent or, if it sent none, by
querying it.  This lets methods such as enable() see capabilities added
after login, for example ENABLE on Gmail (gh-103451).

Capabilities advertised in the server greeting are now used too, saving
a redundant CAPABILITY command.
(cherry picked from commit c89b72abed7393d9d428f1e336e3aa02e7ef6ce8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lib/imaplib.py
Lib/test/test_imaplib.py
Misc/NEWS.d/next/Library/2026-07-01-10-30-00.gh-issue-63121.Rm4tZp.rst [new file with mode: 0644]