[3.14] gh-108280: Give a meaningful error for an invalid imaplib greeting (GH-152768) (GH-152857)
Connecting to a server that does not send a valid IMAP4 greeting, such as
a POP3 server answering on the IMAP port, failed with the unhelpful
"imaplib.IMAP4.error: None". A meaningful message is now raised instead.
(cherry picked from commit
262b6a0df5a325e788928ab0cd514fa4786571b4)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>