LIST-EXT and list_data rewrite

Bron Gondwana brong at
Thu Jun 30 09:35:43 EDT 2011

I've been looking at various bugs with LIST throughout 2.4.x, with
LSUB and LIST and stuff issues.  Most of them are now fixed in stable and
in master, but there's still some things that the dovecot 'imaptest' tool

The core problem is this:

we have two functions, mboxlist_findall and mboxlist_findsub, which come in
both altnamespace and regular flavours.

If you have a query on (children subscribed) then you need to find anything
that either has children OR is subscribed, which requires both lots of find
to run kind of concurrently, which is impossible.

At the moment, the callback function to either of these checks the name to
see if either:

a) it can be matched exactly by the LIST filter
b) one of its parents can be matched by the list filter.

if (b), then if the parent has already been seen, we just mark it as having
children, and move on.  Otherwise we create a "NonExistant" item and set
HasChildren on it.

Whenever we get another match, we move on.  This kind of works, until you
have a LIST-EXT query that wants to find folder that are either subscribed
or have children!

So what I'm looking at doing is replacing all this with an in-memory list
of folders which will be in the final result, and we can add to it and
then sort it and merge before output.  This means we can fully pass

(I guess the other alternative is to build an in-memory list from the LSUB
stuff if required, and just walk that list.  It's guaranteed to be less
wasteful of memory, but probably more complex...)


Using Opera's revolutionary email client:

More information about the Cyrus-devel mailing list