Getting started with IMAP
Sometimes (or more often) it is hard to start tasks by reading RFCs. For IMAP you might want to read introduction e.g. from:
http://www.tcpipguide.com/free/t_IMAP4GeneralOperationClientServerCommunicationandS-2.htm
http://www.tcpipguide.com/free/t_IMAP4GeneralOperationClientServerCommunicationandS-2.htm