Hi, On Tue, 3 Dec 2002 20:17:13 +0100 (CET), 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? Since the > STATUS command can not change the mailbox in any way - I assume it's not > allowed to index the messages either. > > Is it far off to say that UIDNEXT == # of messages + 1, or UIDVALIDITY = 1 > (obviously this is weird for servers that use time(NULL))?
See below... > What practical use does a client have for checking UIDNEXT status? Assuming the UIDVALIDITY value does not change, UIDNEXT will change only when new mail has been delivered. The difference between the last known UIDNEXT value may be an indication of how much mail has been delivered since the last STATUS command. The delivered mail is not guaranteed to exist since it is possible another session may have already accessed the mailbox and deleted the mail. > > Andy > > -- > Andreas Aardal Hanssen One example of the how to handle the situation you are referring to above is to see what the UW-IMAP server does in this case. What happens when the UW-IMAP server does a STATUS command on a mbox mailbox which has not been SELECTed before? Well... $ telnet localhost 143 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN] localhost IMAP4rev1 2001.315 at Thu, 5 Dec 2002 11:36:02 +0900 (JST) . login username password . OK [CAPABILITY IMAP4REV1 IDLE NAMESPACE MAILBOX-REFERRALS SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND] User dehenken authenticated . status INBOX (uidvalidity uidnext) * STATUS INBOX (UIDNEXT 2 UIDVALIDITY 1039055787) . OK Assigning new unique identifiers to all messages . status INBOX (uidvalidity uidnext) * STATUS INBOX (UIDNEXT 2 UIDVALIDITY 1039055804) . OK Assigning new unique identifiers to all messages . logout * BYE localhost IMAP4rev1 server terminating connection . OK LOGOUT completed Connection closed by foreign host. It behaves is if it were SELECTing the mailbox and temporarily assigns a UIDVALIDITY and UIDs and reports that information. Since those values can't be stored, it generates new values each time. The algorithm used to assign the UIDVALIDITY must ensure that it is never the same value. The UIDVALIDITY should be unique because the server has no way to determine if the file has been modified or not in the interval between two STATUS commands. If it were able to be determined absolutely that the file had not been modified, the server could report the previous UIDVALIDITY were that value known. Regards, Mark Keasling <[EMAIL PROTECTED]>
