I am using Nodejs to establish IMAP IDLE connection for email client. Is there any possibility to detect IMAP protocol version when it establish connection.
All IMAP servers today run the same version, 4rev1. Versions 1, 2, 3 and 4 are long gone.
Further, all servers today support one or more extensions. The CAPABILITY command returns the list of extensions. For gmail:
openssl s_client -connect imap.gmail.com:993 -crlf
a capability
* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN
a OK Thats all she wrote! j14mb28178795bkd
So gmail supports IDLE and about a dozen more extensions.