On Wed, 5 Mar 2003 10:50:53 +0100, Martin Sanneblad wrote: > - Multiple sessions doing STATUS or EXAMINE will all recieve the same RECENT > number.
Desirable, but not guaranteed. Also, remember that any session that does a SELECT will cause recent to be turned off in subsequent sessions. > - Doing a NOOP without having done a SELECT or EXAMINE will not return any > RECENT (just 'OK completed'). I'm not sure what you mean here. If a mailbox is not selected, then NOOP will never return EXISTS or RECENT. If a mailbox is selected, then *any* command, including NOOP, could return EXISTS and/or RECENT. Let me emphasize that, once a mailbox is selected, *all* commands are capable of returning EXISTS and/or RECENT if the server deems it necessary (generally because the values have changed). NOOP simply does that and nothing else. > - The first session that SELECT a folder will recieve RECENT number, > following sessions will get 0 RECENT (with SELECT or any of NOOP, STATUS or > EXAMINE). Generally, yes. But remember that messages may come in afterwards. So timing races are possible. > - When a session CLOSE or SELECT all known RECENT messages are lost. That's basically correct, but not the right way to put it. When a session does a SELECT, the current recent status is immediately turned off for all messages *except* in the session that did the SELECT. So, a LOGOUT, CLOSE, or SELECT of another mailbox merely causes that session to forget those recent flags. But in the mailbox, they were long ago turned off. > - If two sessions have SELECT the same folder and a new message arrives, > only the first to do a NOOP gets the RECENT number. The other will get > RECENT 0 (with NOOP or any of STATUS, SELECT or EXAMINE). Once again, you are assuming special semantics of NOOP that do not exist. Correct statement: If two sessions have SELECT the same folder and a new message arrives, only the first to report the new message(s) with EXISTS and RECENT will see them as recent. The other will get a non-zero EXISTS, but a RECENT count of 0 (with *any* IMAP command). Once again, the report of new messages happens with *all* commands. NOOP is commonly used to poll for new mail because it doesn't do anything else. But that does NOT mean that "NOOP polls for new mail." Rather, *all* commands poll for new mail as part of their operation. NOOP is the command to do nothing. But since all commands poll for new mail, NOOP will poll for new mail even though it otherwise does nothing. > - A session does SELECT and recieves 1 RECENT. A new message arrives. When > the session sends NOOP it will recieve 2 RECENT (the previously received > RECENT and the RECENT for the new message). Correct. > - A session does SELECT and receives 1 RECENT. A new message arrives. When > the sessions sends STATUS for the same folder it will recieve 1 RECENT (the > RECENT for the new message). The new RECENT will be available for others to > see unless the session does a NOOP. This case is undefined, and may depend upon internal implementation details. STATUS should never, *EVER*, be done on the selected mailbox. Such behavior is the earmark of a poorly-written client. > /Recent is set for any message added with APPEND or COPY. Correct. > It will not be > set for messages altered with STORE. Correct.