01:49.56 > b'PIGH1 LOGIN login@gmail.com "password"'
01:50.64 < b'* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584'
01:50.64 < b'PIGH1 OK login@gmail.com authenticated (Success)'
('IMAP4REV1', 'UNSELECT', 'IDLE', 'NAMESPACE', 'QUOTA', 'ID', 'XLIST', 'CHILDREN', 'X-GM-EXT-1', 'XYZZY', 'SASL-IR', 'AUTH=XOAUTH2', 'AUTH=PLAIN', 'AUTH=PLAIN-CLIENTTOKEN', 'AUTH=OAUTHBEARER', 'AUTH=XOAUTH')
Traceback (most recent call last):
File "path\pyd.py", line 11, in <module>
mail.enable("UTF8=ACCEPT")
File "path\AppData\Local\Programs\Python\Python311\Lib\imaplib.py", line 517, in enable
raise IMAP4.error("Server does not support ENABLE")
imaplib.IMAP4.error: Server does not support ENABLE
Bug report
When connecting to gmail via imaplib, you can't use mail.enable("UTF8=ACCEPT"), it always returns the error "imaplib.IMAP4.error: Server does not support ENABLE". But the server returns both "Enable" and "UTF8=ACCEPT" in capabilities. I commented out the line in imaplib, which causes this error, and everything works correctly. For some reason these parameters are not passed to capabilities.
Your environment
Python 3.11.3, Win 10 21H2 19044.1288
#Code
Console output