imapd LIST bug?

David Carter dpc22 at cam.ac.uk
Wed Aug 17 06:55:40 EDT 2005


On Wed, 17 Aug 2005, Jukka Salmi wrote:

> a0021 LIST "" "INBOX.%"
> [...]
> * LIST (\HasNoChildren) "." "INBOX.Spam"
> * LIST (\HasNoChildren) "." "INBOX.Test"
> * LIST (\HasNoChildren) "." "INBOX.Test-1"
> * LIST (\Noselect \HasChildren) "." "INBOX.Test"
> * LIST (\HasNoChildren) "." "INBOX.Trash"
> a0021 OK Completed (0.000 secs 36 calls)
>
>
> So, why is INBOX.Test listed twice? And why the \Noselect flag?

It is a long standing bug in the LIST command.

I imagine that you have three mailboxes named:

   INBOX.Test
   INBOX.Test.<something>
   INBOX.Test-1

The problem is that "-" sorts before "." in the mailbox list, so the two 
"INBOX.Test" entries become separated. The mstringdata() function which 
generates each line of output for the LIST and LSUB commands only compares 
adjacent entries, so it gets confused by this ordering.

One solution would be to change the sort order (as it happens the flat 
backend already sorts '.' before '-'). A small group of us had a 
discussion about this last October. I think that we were all rather wary 
about messing with the mailbox list sort order: there's a fairly high 
potential for breaking things in the process.

-- 
David Carter                             Email: David.Carter at ucs.cam.ac.uk
University Computing Service,            Phone: (01223) 334502
New Museums Site, Pembroke Street,       Fax:   (01223) 334679
Cambridge UK. CB2 3QH.



More information about the Info-cyrus mailing list