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.

Était-ce utile?

La 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.

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top