You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to propose adding a method login_plain to Python IMAP4 standard library client.
Currently, one can use login, login_cram_md5 or add their own authentication method using authenticate. While login works great for plain text authentication for English users, it does not support characters out of ASCII, causing errors for users with non-ASCII passwords.
I personally hit that with radicale-imap. It has been reported in bpo-34577, and its SMTP counterpart in bpo-29750.
RFC6855 recommends using AUTHENTICATE for such cases, and so this patch adds login_plain in a manner similar to login_cram_md5. Adding this to a standard library will improve the experience for non-English users not only when programming but also when using other programs written in Python. AUTHENTICATE PLAIN is on by default in Dovecot and most e-mail providers, like Gmail and Outlook, making it more common than, already supported, AUTHENTICATE CRAM-MD5.
Since this is my first patch, let me know if I could change something up - I did my best to RTFM!
Added imaplib.IMAP4.login_plain() in GH-29398, authenticating with the PLAIN SASL mechanism (RFC 4616). Thank you @przemub for the request and the implementation.
Activity
przemub commentedon Nov 4, 2021
Hi everyone and nice to meet you!
I would like to propose adding a method login_plain to Python IMAP4 standard library client.
Currently, one can use login, login_cram_md5 or add their own authentication method using authenticate. While login works great for plain text authentication for English users, it does not support characters out of ASCII, causing errors for users with non-ASCII passwords.
I personally hit that with radicale-imap. It has been reported in bpo-34577, and its SMTP counterpart in bpo-29750.
RFC6855 recommends using AUTHENTICATE for such cases, and so this patch adds login_plain in a manner similar to login_cram_md5. Adding this to a standard library will improve the experience for non-English users not only when programming but also when using other programs written in Python. AUTHENTICATE PLAIN is on by default in Dovecot and most e-mail providers, like Gmail and Outlook, making it more common than, already supported, AUTHENTICATE CRAM-MD5.
Since this is my first patch, let me know if I could change something up - I did my best to RTFM!
serhiy-storchaka commentedon Jul 5, 2026
Added
imaplib.IMAP4.login_plain()in GH-29398, authenticating with thePLAINSASL mechanism (RFC 4616). Thank you @przemub for the request and the implementation.