On Thu, 8 Dec 2011, Petite Abeille wrote:
> In my specific scenario, there are always, say, 1,000 sequences in the
> mailbox. It's just that what messages they represent varies over time.
> No messages are deleted per se. They just fail out of the "recent
> messages" window.
I assume that this is something in an IMAP server? That is, the server
always shows 1000 messages, but from time to time messages vanish in the
existing sequence space, and new messages take their place at the top of
the space?
> In any case, perhaps a simple setup is to freeze the message window upon
> mailbox selection, until a noop request comes along, at which point the
> appropriate expunge notification is communicated to the client and the
> new messages are published. That should guaranty fetch consistency until
> the server is in a position to communicate the message changes to the
> client, no?
If I understand what you are doing correctly, yes.
So, if the bottommost three messages vanish, and are replaced by three new
messages, the server sequence on the EXPUNGE-valid point will be:
* 1 EXPUNGE
* 1 EXPUNGE
* 1 EXPUNGE
* 1000 EXISTS
Remember that the EXPUNGE response has immediate effect on the sequence
space. If your server transmits:
* 1 EXPUNGE
* 2 EXPUNGE
* 3 EXPUNGE
that would remove original messages 1,3,5, not 1:3.
However, note that:
* 3 EXPUNGE
* 2 EXPUNGE
* 1 EXPUNGE
is exactly equivalent to:
* 1 EXPUNGE
* 1 EXPUNGE
* 1 EXPUNGE
If you understand why this is the case, then you can be confident that you
understand how sequence numbers work.
-- 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.