Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

IMAP uses the CAPABILITY command to request information about the server capabilities. This is more useful than a version number as it allows a client to check for the specific extensions to the IMAP basic protocol that it might require.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top