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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top