53 lines
2.2 KiB
Plaintext
53 lines
2.2 KiB
Plaintext
MBOX-Line: From mrc+imap at panda.com Thu Feb 17 11:46:28 2011
|
|
To: imap-protocol@u.washington.edu
|
|
From: Mark Crispin <mrc+imap@panda.com>
|
|
Date: Fri Jun 8 12:34:45 2018
|
|
Subject: [Imap-protocol] detecting new messages
|
|
In-Reply-To: <5398C04A-99D8-47E5-ABB8-AE10B168F3C4@iki.fi>
|
|
References: <2CA53ECF4094AB4D8BDC7C60A75B1C02110BEAFC52@hawaii.shoretel.com>
|
|
<5398C04A-99D8-47E5-ABB8-AE10B168F3C4@iki.fi>
|
|
Message-ID: <alpine.OSX.2.00.1102171137330.782@hsinghsing.panda.com>
|
|
|
|
On Thu, 17 Feb 2011, Timo Sirainen wrote:
|
|
> Use STATUS for getting UIDNEXT for non-selected mailboxes. For selected
|
|
> mailbox, hopefully you don't care about knowing the UIDNEXT value.
|
|
|
|
The latter point bears emphasis.
|
|
|
|
There is no particular reason why you should ever need the UIDNEXT value
|
|
for the selected mailbox. Although most servers will give you the UIDNEXT
|
|
value at SELECT time, it is neither sufficient nor necessary for mailbox
|
|
synchronization with prior state.
|
|
|
|
The UID value of message * is far more important, as this will tell you if
|
|
there are new messages in the mailbox that need synchronization. UIDNEXT
|
|
may tell you if there WERE new messages, but it will not tell you if there
|
|
ARE new messages.
|
|
|
|
Furthermore, UIDNEXT should rightfully be considered a guess. It is
|
|
guaranteed that UIDNEXT is higher than any UID that has ever been assigned
|
|
to a message in the mailbox. There is no guarantee that a new message
|
|
will given that value as its UID; it may be given a higher value. Nor is
|
|
there any guarantee that UIDNEXT is monotonically greater than the highest
|
|
assigned UID.
|
|
|
|
Put another way:
|
|
|
|
A UIDNEXT value of 1234 guarantees that the highest UID ever placed in the
|
|
mailbox is, at most, 1233. It does not in any way assert that UID 1233
|
|
exists now, or ever existed in the past.
|
|
|
|
A UIDNEXT value of 1234 guarantees that a newly delivered message will
|
|
have a UID of at least 1234. It does not in any way assert that the
|
|
message will get UID 1234 as opposed to UID 1235, UID 69105, etc.
|
|
|
|
The fact that some servers assign UIDs monotonically does not mean that
|
|
servers are required to make monotonic assignments.
|
|
|
|
-- Mark --
|
|
|
|
http://panda.com/mrc
|
|
Democracy is two wolves and a sheep deciding what to eat for lunch.
|
|
Liberty is a well-armed sheep contesting the vote.
|
|
|