David Carter wrote: > On Tue, 20 May 2008, Matthew Hodgson wrote: > >> If I create a hierarchy of folders such as: >> >> test >> test.SPAM >> test-foo >> >> and try to list the folder hierarchy with something like: >> >> 11 LIST "" "test%" >> >> I get broken output, where test is listed twice - the second time with a >> \Noselect flag: > > The problem is that '-' sorts before '.' in ASCII. Try: > > improved_mboxlist_sort: 1 > > (You will need to dump and then restore the mboxlist). Thanks for the response - I'm not sure how I managed to miss the improved_mboxlist_sort option so spectacularly... on spotting the ASCII sorting problem, one of my first thoughts was to change the comparator in order to fudge the ordering of '.'. Out of interest, do you (or anyone else) understand the mstringdata() code well enough to see what negative side-effects there might be of simplifying the partial match suppression logic? It seems that the function, which actually writes the output of LIST/LSUB commands to the client, is called with the name of the folder which has matched the pattern, with a matchlen argument which describes how much of the name was matched by the pattern before hitting a '%'. As such, I'd have thought that any expression where name[matchlen] != '\0' is by definition a partial match which can be suppressed - and I don't see why the code bothers to compare the stem of the match with the stem of the previously matched folder name (which is where the behaviour then breaks with the default comparator). I'm just wondering if improved_mboxlist_sort is in fact the correct fix to this problem. M. -- Matthew Hodgson <matthew@xxxxxxxxxxxxx> Media & Systems Project Manager Tel: +44 (0) 845 666 7778 http://www.mxtelecom.com ---- Cyrus Home Page: http://cyrusimap.web.cmu.edu/ Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html