Spent a week looking at the whole of the IMAP class code and refactored it so that the parser only returns a pointer to one structure rather than one of a number of command specific structure. Also the class now handles instances where the server decides to disconnect a connection without any BYE command warning; this does happen frequently enough to warrant attention. If this does happen it is signaled though an exception and together with the boolean in the reply that signals a BYE response was sent it it possible for client code to detect all disconnects and actuate a reconnect.
Whats next on the list of things to do ? A class to create and manipulate ZIP archives,