Andreas Aardal Hanssen <[EMAIL PROTECTED]> writes:

>>> If so, this is bad client behavior because you will get all the info you
>>> need by sending "noop". Sending STATUS is unnecessary, and may be
>>> confusing for the client, as STATUS may return other data than what you
>>> got from the session you're in. It's a race..
>>> STATUS returns a snapshot of the information you need, and you can make no
>>> assumptions on it being exact later on.
>>I cannot infer this from the specification.  Where does it say this in
>>the RFC?  Reading the specification, it seems legal.
>>How would sending NOOP discover the UIDNEXT value?  I don't think NOOP
>>can do this.
>
> You get UIDNEXT from the SELECT response, then NOOP, IDLE etc will give
> you status updates, so that you can find this number yourself.

Well, UIDNEXT is not returned in the untagged responses returned
during NOOP or IDLE.  Using 1+UIDMAX could work as a guess though.

> It's not explicitly in the 2060 rfc, it's just common sense; it doesn't
> make any sense to check the status of the folder that you are staring at,
> using a method that gives you unreliable snapshot info.
>
> Fyi, from rfc2683 (IMAP4 Implementation Recommendations):
>
> 3.1.1. Multiple Accesses of the Same Mailbox
>
>    (...)
>
>    4. you must avoid using the STATUS command on a mailbox that you have
>       selected (with some server implementations the STATUS command has
>       the same problems with multiple access as do the SELECT and
>       EXAMINE commands).
>
>    A further note about STATUS: The STATUS command is sometimes used to
>    check a non-selected mailbox for new mail.  This mechanism must not
>    be used to check for new mail in the selected mailbox; section 5.2 of
>    [RFC-2060] specifically forbids this in its last paragraph.
>
> RFC2060, 5.2:
>
>    Regardless of what implementation decisions a client makes on
>    remembering data from the server, a client implementation MUST record
>    mailbox size updates.  It MUST NOT assume that any command after
>    initial mailbox selection will return the size of the mailbox.

Indeed, thanks for the pointer.  I think this should be made clearer
in the description for STATUS -- right now it doesn't mention that the
command partially doesn't work if you use it on the currently selected
mailbox, which seems like critical information.  Mark?

Reply via email to