Hmm, don't know how much more I can explain what I typed up. This was executed from a terminal window on a machine that had openssl installed. Doing all those steps manually shows you how an email client such as 'Mail.app' on OSX communicates with the mail server.
The '. capability' command is how a client determines what a server supports. The server responds with a list of commands/extensions that it supports. The response to this command is the proof that gmail supports imap idle. If you want a really long winded explanation about the capability command check the
imap rfc 2060 section 6.1.1
Each space separated item on this line are the commands/extensions that gmail supports:
- IMAP4rev1 <- RFC requires this item to be present
- UNSELECT
- IDLE <- Here's your proof, imap idle support
- NAMESPACE
- QUOTA
- XLIST
- CHILDREN
- XYZZY
The last part of what I typed up was how an email client such as 'Mail.app' on OSX uses imap idle. The '. idle' command is sent from the client to the server to register itself to be notified of changes. When there are changes on the server it sends notifications to each registered 'idling' client. The message "* 2005 EXISTS" was an example of such a notification, in that case a new email being delivered.
Let me know if I can help explain it further.