On Mon, 2011-03-07 at 17:07 +0100, Bruno Tréguier wrote:

> I'm just questionning the choice of not putting the slash at the end of 
> the mailbox name in the .subscriptions file (for "folders of folders"), 
> as it seems Dovecot solely relies on this to determine which type of 
> mailbox it is dealing with.

The .subscriptions file should never have trailing slashes.

> On the contrary, if the trailing / is present in the names returned by 
> the LSUB command, the client (at least TB) is able to take that into 
> account, and the "folder of folders" type of mailbox is greyed out (and 
> is unselectable, so), and when you right-click on it, the menu allows 
> you to create further subfolders in them. With no way to distinguish 
> between both types of mailboxes, this behaviour is broken...

It's not right to send trailing / to non-selectable mailboxes, even if
it happens to make Thunderbird handle them better.. It might just as
easily break other clients.

The right way to determine if mailbox is selectable is by looking at its
\NoSelect flag. That is returned correctly in LIST replies. With LSUB
replies Dovecot does what other servers too: It doesn't bother seeing
what the correct flags are, because it wastes time and clients probably
don't use them anyway.

You could try if the attached patch helps.
diff -r 2cb0fb910441 src/imap/cmd-list.c
--- a/src/imap/cmd-list.c	Mon Mar 07 01:00:28 2011 +0200
+++ b/src/imap/cmd-list.c	Mon Mar 07 18:20:51 2011 +0200
@@ -931,8 +931,7 @@
 	if (lsub) {
 		/* LSUB - we don't care about flags */
 		ctx->list_flags |= MAILBOX_LIST_ITER_SELECT_SUBSCRIBED |
-			MAILBOX_LIST_ITER_SELECT_RECURSIVEMATCH |
-			MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
+			MAILBOX_LIST_ITER_SELECT_RECURSIVEMATCH;
 	} else if (!ctx->used_listext) {
 		/* non-extended LIST - return children flags always */
 		ctx->list_flags |= MAILBOX_LIST_ITER_RETURN_CHILDREN;

Reply via email to