[Dovecot] 1.2.13 QRESYNC crash.

David Woodhouse dwmw2 at infradead.org
Sat Aug 21 18:15:14 EEST 2010


On Thu, 2010-08-19 at 18:37 +0100, Timo Sirainen wrote:
> On Wed, 2010-08-18 at 22:27 +0100, David Woodhouse wrote:
> > Aug 18 22:07:31 twosheds IMAP(dwmw2): : Panic: file mail-index-transaction.c:
> >      line 637 (mail_index_transaction_lookup): assertion failed:
> >      (seq >= t->first_new_seq && seq <= t->last_new_seq)
> > 
> > A00131 SELECT lists.bluez (QRESYNC (1154090296 1861 1:*
> > (1,120,1578,2064,2226,2280,2298 1,120,12037,12523,12685,12739,12757)))
> 
> Thanks, fixed: http://hg.dovecot.org/dovecot-1.2/rev/70fa6178380e

Hm, looking at RFC5162 again I realise that SELECT command isn't
actually valid. The '1:*' for the known-uids is not permitted. From the
formal syntax in §6:

   capability          =/ "QRESYNC"

   select-param        =  "QRESYNC" SP "(" uidvalidity SP
                       mod-sequence-value [SP known-uids]
                       [SP seq-match-data] ")"
                       ;; conforms to the generic select-param
                       ;; syntax defined in [IMAPABNF]

   seq-match-data      =  "(" known-sequence-set SP known-uid-set ")"

   uidvalidity         =  nz-number

   known-uids          =  sequence-set
                       ;; sequence of UIDs, "*" is not allowed

   known-sequence-set  =  sequence-set
                       ;; set of message numbers corresponding to
                       ;; the UIDs in known-uid-set, in ascending order.
                       ;; * is not allowed.

   known-uid-set       =  sequence-set
                       ;; set of UIDs corresponding to the messages in
                       ;; known-sequence-set, in ascending order.
                       ;; * is not allowed.


§3.1 says:
   If the list of known UIDs was also provided, the server should only
   report flag changes and expunges for the specified messages.  If the
   client did not provide the list of UIDs, the server acts as if the
   client has specified "1:<maxuid>", where <maxuid> is the mailbox's
   UIDNEXT value minus 1.

So instead of giving the known-uid set '1:*', the client should actually
have omitted the optional known-uid parameter completely. It *should*
have sent this command:

A00131 SELECT lists.bluez (QRESYNC (1154090296 1861 (1,120,1578,2064,2226,2280,2298 1,120,12037,12523,12685,12739,12757)))

Dovecot doesn't like that though:

A00131 BAD Error in IMAP command SELECT: Invalid QRESYNC parameters

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse at intel.com                              Intel Corporation



More information about the dovecot mailing list