CImap4Agent Class Hotlist

TO DO
•	(9/27/96): Not all IMAP responses are recognized in a case-insensitive manner.
•	(9/27/96): An non-compliant IMAP response such as "* OK" will not be recognized as "* OK response text". (12/2/96): I had the pleasure of finding out today that Crispin's UW IMAP Server returns just such a non-compliant IMAP response. If you issue a SEARCH response which has no matches (say, "SEARCH DELETED"), Crispin's server returns "* SEARCH<crlf>". Bastard.
•	(9/27/96): Have to implement parseCapability function so we can send "RFC822.PEEK" for IMAP4 servers and "BODY.PEEK[]" for IMAP4rev1 servers.
•	(10/31/96): Holy SMOKES, I found out a pretty important problem today... if you issue something like "<tag> UID FETCH <invalid UID> (...)", your response is "<tag> OK <resp text>"! This means that as a client, my job of informing the user that his command can't be carried out is compromised. The best thing I can think of at the moment is to have CImap4Agent note that no FETCH response was generated for the FETCH command, and instead of returning S_OK, to return a failure code like E_MSG_NOT_ON_SVR or something.
•	(11/27/96): Currently, callers who pass a non-NULL rangelist into the SEARCH, COPY, STORE and FETCH commands will have their command lines broken up into 3 parts: 1) tag and command verb, 2) message range, and 3) command arguments. EricAn says that this is a bad idea, in general. I've fixed the above commands so that a NULL rangelist will cause the RangedCommand helper function to create a one-line command, but I have not done the work to fix the case when a rangelist is passed. Since we only require message sequence number users to pass in a rangelist, I'm going to defer this work. ACTUALLY, it should be very easy. Replace all instances of CAsyncConn::SendBytes used for iltLINE and iltRANGELIST to use a function, ConstructAndSendLine which only calls SendBytes when a CRLF is encountered. Of course, sending an iltLITERAL of type ilsSTRING should use SendBytes directly.
•	(11/27/96): Currently, in ConnectToServer, we set m_irsState and m_ssServerStatus on successful completion of CAsyncConn::Connect. This results in problems when the user cancels the connect operation before we're even done lookup. The setting of m_irsState to irsSVR_GREETING and m_ssServerStatus to ssNonAuthenticated should be moved to OnNotify, and be based upon actual connection status. A novel concept.
•	(12/20/96): Interesting, I found this a while ago (11/4/96, p.544 of log), but I am only now reporting it. The Append command accepts a FILETIME as input. Unfortunately, it doesn't indicate whether the time should be in local or universal time. I should clearly indicate that the time should be specified in GMT, and then fix Append so that it outputs the proper time (it's totally broken right now: it makes no adjustments to the time, but it DOES output the proper timezone modifier).
•	(12/20/96): Change APPEND command interface to allow asynchronous message body transfer.
•	(1/27/97): Bug #17234: Deleting all the messages in a mailbox results in an assert, because whoever implemented MemRealloc doesn't believe we should ever realloc to 0. Special-case the 0 case and use MemFree for that, instead. Discovery text, p. 695 of logbook.
•	(4/16/97): While coding UTF-7 mailboxes, I've noticed that the UW server accepts non-USASCII names like "Ärhus". The problem is that it returns "Ärhus" as a quoted when I do a LIST, and the "Ä" is not valid. My client complains when this happens. I was wondering whether I should loosen CImap4Agent::QuotedToString, but then I was thinking, what happens if the server has a mailbox, "Ärhus", and "&AMQ-rhus"? They map to the same folder name, and so the user will never be able to select the one named "Ärhus". Mind you, the server can always return the folder just fine, via literal. I'm not sure what to do about this. See discovery text on p.798 (4/6/97) of logbook.
•	(4/16/97): We now queue IMAP commands, but we don't resequence IMAP commands which refer to message sequence numbers in the situation where such commands are waiting to be sent, and we receive an EXPUNGE. This is not a high priority at the moment, because nobody's using msg seq nums, but we'll eventually have to provide this. No IIMAPTransport interface change is necessary. See p.807 (4/10/97) for discovery text.
•	(4/16/97): EricAn points out that CIMAPCmdInfo's constructor should not contain a "new" operator. I should replace this with a module variable. See p.812 (4/14/97) for details.

DONE
•	(11/21/96): This is not the place for UIDValidity. The UIDValidity should be persisted in the local cache, and so the CImap4Agent user should get it from there. (10/14/96): Have to add a member function to return the UIDValidity of the currently selected folder. This is so that CIMAPView can handle folder selection, and the CIMAPFolder can decide if its cache is properly set up, afterwards.
•	(11/21/96): Added a Disconnect member function on 11/18/96. I'm not sure what the gibberish about returning the current status means, though. The view is the class responsible for connection management, because the view is answerable to the user. (10/28/96): Need a Disconnect member function, so we can cut a connection (say, when the user hits "Stop"). We also need a member function which returns the current status (connected, authenticated, etc) so that a user class (CIMAPFolder or CIMAPFolderMgr) can establish an authenticated connection if required, and so that such connections are performed only when needed.
•	(1/3/97): This was done a long time ago, on 10/1/96. (9/27/96): For any stream you write to, you must call Commit before returning the stream. This ensures that what you wrote will not be lost. This is courtesy of Opie.
•	(1/3/97): This was done on 11/20/96, when I implemented usage of the OnResponse callback. Still pending is the queueing code which prevents multiple simultaneous commands from conflicting with each other. That is covered by the general queueing work item. (10/15/96): The CImap4Agent class cannot be properly shared currently between CIMAPFolders and CIMAPFolderMgr classes because the callback object is monolithic, and is determined once, at class initialization. I considered various granularities of callback segregation, until EricAn and I decided that the best solution, especially for progress indication, is to accept a callback function with each IMAP command wrapper (in addition to the default CB handler), and queue all conflicting commands (eg, multiple SEARCH commands) so that they are sent one at a time. This way, the CImap4Agent class can accept a callback function as an argument to an IMAP command function (eg, CImap4Agent::Search), and we can call the callback immediately on server response, thus allowing progress indication.
•	(1/3/97): This was free when CImap4Agent moved to inetcomm.dll. (11/21/96): Hook up connection status callbacks for status indication.
•	(1/3/97): This work item has been replaced with more specific goals: async message transfer for uploads and downloads. (11/21/96): We need progress indication.
•	(4/16/97): This was checked in on 4/11/97. (10/15/95): In addition to the above conditions for command queueing (multiple simultaneous commands of the same type), there is one more condition: FETCH, STORE and SEARCH commands must be queued if they use message sequence numbers and they follow a sequence of commands which are NOT FETCH, STORE or SEARCH. Obviously, UID SEARCH is fine, and UID FETCH and UID STORE are mostly fine, except they may fail if one of the specified UIDs happens to be a deleted message. No real harm done: the command will fail for that message, but there is no ambiguity. Since UID (SEARCH|FETCH|STORE) are fine at any time, this work item is low-priority for Athena, but necessary if we wish to expose the IMAP interface in winsock.
•	(4/16/97): This was checked in on 4/11/97. (10/23/96): I already came up with this idea on 9/26/96, but I never added it to the hotlist.  It is related to the 10/15/96 work item above which involves IMAP command queuing. The CImap4Agent class should be responsible for queueing commands, period. This includes accepting and queuing commands which must wait until we are connected and authenticated, and returning CmdCompletionNotifications in the event of authentication/connection failure. In order to do this, I proposed on 9/26/96 (p. 466 of my log) that all IMAP commands have a LPSTR for their arguments, instead of special-purpose structures. I guess this also means I have to add UID equivalent commands to the IMAP_COMMAND enumeration (eg, icUID_FETCH_COMMAND).
•	(5/12/97): This was checked in on 4/16/97. (11/8/96): Mailbox names should be recognizable and returnable to caller in UTF-7.
•	(5/12/97): This was checked in on 5/6/97. (12/20/96): Change FETCH response parser to allow asynchronous message body retrieval.