[Dovecot] LSUB matches prefix bug?

Chris Wakelin c.d.wakelin at reading.ac.uk
Mon Apr 11 20:35:38 EEST 2005


I think I've found a minor bug in the LSUB command:

. LSUB "" "*"
 
gives 

...
* LIST (\Noselect) "/" "#maildir"
  ^^^^
* LSUB () "/" "#maildir/test4"

where I have a namespace with prefix "#maildir/".

Here's a patch to make it not list the namespace prefix in an LSUB 
command (or should it list it as 'LSUB (\Noselect) "/" "#maildir"'?) :-

--- dovecot-1.0-stable.orig/src/imap/cmd-list.c Fri Mar 18 20:00:44 2005
+++ dovecot-1.0-stable/src/imap/cmd-list.c      Mon Apr 11 18:29:33 2005
@@ -218,7 +218,7 @@
                match = ns->hidden ? IMAP_MATCH_NO :
                        imap_match(ctx->glob, cur_prefix);

-               if (match == IMAP_MATCH_YES) {
+               if ((match == IMAP_MATCH_YES) && !ctx->lsub) {
                        /* The prefix itself matches */
                         enum mailbox_flags flags;
                        string_t *str = t_str_new(128);


Best Wishes,
Chris

--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
Christopher Wakelin,                                c.d.wakelin at reading.ac.uk
IT Services Centre, The University of Reading,       Tel: +44 (0)118 378 8439
Whiteknights, Reading, RG6 2AF, UK                   Fax: +44 (0)118 975 3094




More information about the dovecot mailing list