Hi, Mark. Sorry for being so unclear. On Tue, 3 Dec 2002, Mark Crispin wrote: >On Tue, 3 Dec 2002, Andreas Aardal Hanssen wrote: >> If someone does a STATUS on a mailbox that the IMAP server has not seen >> before - what is expected output for UIDNEXT and UIDVALIDITY? >I don't understand this question.
Since UIDVALIDITY is an IMAP-feature, and an "unseen" mailbox, that is - a mailbox that you have never selected before and never done any operation on before with IMAP - has no UIDVALIDITY, what is the expected behavior of the IMAP server when the client issues a STATUS <mailbox> (UIDNEXT UIDVALIDITY) ? >The UIDVALIDITY is always the uidvalidity value assigned to the mailbox, >and the UIDNEXT is the expected value of the next UID that would be >assigned in the mailbox to a new message. Commonly, the UIDNEXT is the >most recently assigned UID in the mailbox plus 1. >> Since the >> STATUS command can not change the mailbox in any way - I assume it's not >> allowed to index the messages either. >What do you mean by "index the messages"? Sorry again - I refer to the process of assigning UIDVALIDITY value to a mailbox and UID values to messages. >> Is it far off to say that UIDNEXT == # of messages + 1, or UIDVALIDITY = 1 >> (obviously this is weird for servers that use time(NULL))? >Yes, it is very far off. >UIDVALIDITY = 1 can't be used unless the server remembers the last >assigned UID for long-deleted mailboxes to ensure that no newly-created >mailbox with the same name reuses that UID. Remember that mailbox + >uidvalidity + UID uniquely identifies a message on that server into >eternity. >UIDNEXT would never be <# of messages> + 1. It can be <most recently >assigned UID> + 1, which may or may not be the UID of the last message. Sure, but what if the IMAP server *never used this mailbox before*? Say the mailbox has no _recent_ messages, since they were all marked as seen by another mail fetch protocol, or any protocol. Then the IMAP server upon selecting this mailbox would assign UID values to each message. But if the IMAP server has never done this before, so that there are no UID values in the mailbox, and a client issues STATUS - UIDNEXT and UIDVALIDITY - what is the expected output? >> What practical use does a client have for checking UIDNEXT status? >A change in UIDNEXT from its last recorded value tells a client that >messages have been delivered to the mailbox since that time, and it does >so even if all those messages were expunged. Ok, that seems reasonable. Andy >-- Mark -- >http://staff.washington.edu/mrc >Science does not emerge from voting, party politics, or public debate. > -- Andreas Aardal Hanssen