MBOX-Line: From dave at cridland.net  Fri Nov 16 10:02:50 2007
To: imap-protocol@u.washington.edu
From: Dave Cridland <dave@cridland.net>
Date: Fri Jun  8 12:34:40 2018
Subject: [Imap-protocol] FETCH/STORE on out-of-range sequence number
In-Reply-To: <2123708120.202451195235056495.JavaMail.root@dogfood.zimbra.com>
References: <2123708120.202451195235056495.JavaMail.root@dogfood.zimbra.com>
Message-ID: <6199.1195236170.977095@invsysm1>

On Fri Nov 16 17:44:16 2007, Dan Karp wrote:
> If there are 50 messages in the mailbox and a client requests
> 
>    A001 FETCH 52 (FLAGS)
> 
> then what are the acceptable server responses?  I'm currently
> treating it as an example of RFC 2180 section 4.1.2 and returning
> 
>    A001 NO Some of the requested messages no longer exist

BAD - the client knows a priori that there is no message 52.

The exception would be if there was a message 52, but it has  
subsequently been expunged without telling the client. In this  
instance, you're technically breaking the specification, but many  
servers will return empty data, no flags, etc, which seems to be the  
least harmful way of coping. (ie, RFC2180 4.1.3). Note that even in  
this case, you mustn't change the sequence numbers - ie, if message  
51 were expunged but message 52 not, message 52 is still message 52 -  
51 would return the empty data.

4.1.2 is actually rather painful, because it's suggesting different  
client behaviour from the base spec. It can, and will, either confuse  
clients, or outright break them, including putting them into a loop,  
asking for the same data continuously.

4.1.3 is the least obtrusive of the "broken" behaviours, since it's  
quite likely that the client will shortly do something allowing the  
EXPUNGE to be sent. Ideally, 4.1.1 should be done, but I do  
sympathize with the issues this can cause. 4.1.4 is likely to confuse  
some clients, albeit to a lesser extent than 4.1.2, but I'd rather  
4.1.3, in general - even if technically broken.

Dave.
-- 
Dave Cridland - mailto:dave@cridland.net - xmpp:dwd@jabber.org
  - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
  - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade

