[Dovecot] search throwing "Sequence out of range"

Stuart Henderson stu at spacehopper.org
Wed Jul 9 00:00:10 EEST 2003


Mulberry client-side message filtering can be persuaded to search for a 
nonexistent message ...

<tag> UID SEARCH UNSEEN UNDELETED UNDRAFT 12 (OR FROM "Cron Daemon 
<sthen at eeyore.37.spacehopper.org>" SUBJECT "Cron <sthen at wide> 
/home/sthen/pingme")

Dovecot 0.99.10 returns this ...

<tag> NO Sequence out of range: 12

I *think* the correct behaviour here is to return a null set of search 
results and avoid the error message in the client. i.e.

* SEARCH
<tag> OK

Certainly this is how other servers seem to work, and my understanding 
of the next paragraph from IMAP4REV1 RFC seems to backs this up (though 
the wording in the RFC isn't 100% clear to me)

      "Message set ranges are permitted; however, there is no guarantee
      that unique identifiers be contiguous.  A non-existent unique
      identifier within a message set range is ignored without any error
      message generated."

it's not Mulberry's fault that it sent this immediately after deleting 
message 12, since on closer investigation this is exactly what my 
filter rules are asking it to do because I forgot to set "stop if 
matched", however it would be helpful to change sometime since I'm sure 
I'm not the only person to have done that (-: of course I've fixed my 
filters now, so it isn't a high priority for me.



Commented protocol log follows, it's not really any more information 
than above though.

--> #4.364 Tue Jul  8 12:54:19 2003
A00448 STATUS INBOX (MESSAGES RECENT UNSEEN UIDVALIDITY UIDNEXT)
* STATUS "INBOX" (MESSAGES 0 RECENT 0 UIDNEXT 1 UIDVALIDITY 1052370612 
UNSEEN 0)
A00448 OK Status completed.

--> #2.364 Tue Jul  8 12:55:19 2003
A01259 NOOP
* 12 EXISTS
* 3 RECENT
A01259 OK NOOP completed.

... incoming mail ...

--> #2.364 Tue Jul  8 12:55:19 2003
A01260 FETCH 12 (FLAGS RFC822.SIZE UID INTERNALDATE ENVELOPE 
BODYSTRUCTURE)
* 12 FETCH (UID 140 FLAGS (\Recent) INTERNALDATE "08-Jul-2003 12:54:36 
+0100" RFC822.SIZE 2372 BODYSTRUCTURE ("text" "plain" ("charset" 
"us-ascii") NIL NIL "7bit" 0 0 NIL NIL NIL) ENVELOPE ("Tue, 08 Jul 2003 
12:00:11 +0000" "***SPAM*** I wish I could be there" (("Kieth Hairston" 
NIL "kiethhairston_ji" "sedona.net")) (("Kieth Hairston" NIL 
"kiethhairston_ji" "sedona.net")) (("Kieth Hairston" NIL 
"kiethhairston_ji" "sedona.net")) ((NIL NIL "stu" "spacehopper.org")) 
NIL NIL NIL "<d1d801c34548$6364549c$6e8ec7ab at 0aqdi32>"))
A01260 OK Fetch completed.

--> #2.364 Tue Jul  8 12:55:19 2003
A01261 SORT (DATE) us-ascii ALL
* SORT 9 1 2 8 3 4 5 6 7 11 10 12
A01261 OK Sort completed.

... filter rule #1 ...

--> #2.364 Tue Jul  8 12:55:19 2003
A01262 UID SEARCH UNSEEN UNDELETED UNDRAFT 12 SUBJECT "***SPAM***"
* SEARCH 140
A01262 OK Search completed.

... ok, it's junk, we want it marked seen/deleted and placed in another 
folder ...

--> #2.364 Tue Jul  8 12:55:19 2003
A01263 UID STORE 140 +FLAGS (\Seen)
* 12 FETCH (FLAGS (\Seen \Recent) UID 140)
A01263 OK Store completed.

--> #2.364 Tue Jul  8 12:55:19 2003
A01264 UID STORE 140 +FLAGS (\Deleted)
* 12 FETCH (FLAGS (\Deleted \Seen \Recent) UID 140)
A01264 OK Store completed.

--> #2.364 Tue Jul  8 12:55:19 2003
A01265 UID COPY 140 "ZZ spam"
A01265 OK Copy completed.

--> #1.364 Tue Jul  8 12:55:20 2003
A00087 STATUS "ZZ spam" (MESSAGES RECENT UNSEEN UIDVALIDITY UIDNEXT)
* STATUS "ZZ spam" (MESSAGES 1 RECENT 1 UIDNEXT 2 UIDVALIDITY 
1057513495 UNSEEN 0)
A00087 OK Status completed.

--> #2.364 Tue Jul  8 12:55:20 2003
A01266 UID STORE 140 +FLAGS (\Deleted)
* 12 FETCH (FLAGS (\Deleted \Seen \Recent) UID 140)
A01266 OK Store completed.

... and expunge this message (only) from the inbox: Mulberry checks so 
that it can keep any other deleted messages in the folder intact ...

--> #2.364 Tue Jul  8 12:55:20 2003
A01267 UID SEARCH DELETED
* SEARCH 140
A01267 OK Search completed.

--> #2.364 Tue Jul  8 12:55:20 2003
A01268 EXPUNGE
* 12 EXPUNGE
A01268 OK Expunge completed.

--> #2.364 Tue Jul  8 12:55:20 2003
A01269 SORT (DATE) us-ascii ALL
* SORT 9 1 2 8 3 4 5 6 7 11 10
A01269 OK Sort completed.

... and on to filter rule #2 ...

--> #2.364 Tue Jul  8 12:55:20 2003
A01270 UID SEARCH UNSEEN UNDELETED UNDRAFT 12 (OR FROM "Cron Daemon 
<sthen at eeyore.37.spacehopper.org>" SUBJECT "Cron <sthen at wide> 
/home/sthen/pingme")
A01270 NO Sequence out of range: 12



More information about the dovecot mailing list