dovecot-2.0: imap: Added tb-lsub-flags to imap_client_workarounds.

dovecot at dovecot.org dovecot at dovecot.org
Sat Mar 12 15:12:24 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/0405f4c507c9
changeset: 12672:0405f4c507c9
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Mar 12 15:12:22 2011 +0200
description:
imap: Added tb-lsub-flags to imap_client_workarounds.
Patch by Bruno Tréguier.

diffstat:

 doc/example-config/conf.d/20-imap.conf |  5 +++++
 src/imap/cmd-list.c                    |  9 ++++++---
 src/imap/imap-settings.c               |  1 +
 src/imap/imap-settings.h               |  3 ++-
 4 files changed, 14 insertions(+), 4 deletions(-)

diffs (59 lines):

diff -r 2ac35ed2f943 -r 0405f4c507c9 doc/example-config/conf.d/20-imap.conf
--- a/doc/example-config/conf.d/20-imap.conf	Thu Mar 10 15:56:46 2011 +0200
+++ b/doc/example-config/conf.d/20-imap.conf	Sat Mar 12 15:12:22 2011 +0200
@@ -48,6 +48,11 @@
   #     With mbox storage a mailbox can contain either mails or submailboxes,
   #     but not both. Thunderbird separates these two by forcing server to
   #     accept '/' suffix in mailbox names in subscriptions list.
+  #   tb-lsub-flags:
+  #     Show \Noselect flags for LSUB replies with LAYOUT=fs (e.g. mbox).
+  #     This makes Thunderbird realize they aren't selectable and show them
+  #     greyed out, instead of only later giving "not selectable" popup error.
+  #
   # The list is space-separated.
   #imap_client_workarounds = 
 }
diff -r 2ac35ed2f943 -r 0405f4c507c9 src/imap/cmd-list.c
--- a/src/imap/cmd-list.c	Thu Mar 10 15:56:46 2011 +0200
+++ b/src/imap/cmd-list.c	Sat Mar 12 15:12:22 2011 +0200
@@ -929,10 +929,13 @@
 	}
 
 	if (lsub) {
-		/* LSUB - we don't care about flags */
+		/* LSUB - we don't care about flags except if
+		   tb-lsub-flags workaround is explicitly set */
 		ctx->list_flags |= MAILBOX_LIST_ITER_SELECT_SUBSCRIBED |
-			MAILBOX_LIST_ITER_SELECT_RECURSIVEMATCH |
-			MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
+			MAILBOX_LIST_ITER_SELECT_RECURSIVEMATCH;
+		if ((cmd->client->set->parsed_workarounds &
+		     WORKAROUND_TB_LSUB_FLAGS) == 0)
+			ctx->list_flags |= MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
 	} else if (!ctx->used_listext) {
 		/* non-extended LIST - return children flags always */
 		ctx->list_flags |= MAILBOX_LIST_ITER_RETURN_CHILDREN;
diff -r 2ac35ed2f943 -r 0405f4c507c9 src/imap/imap-settings.c
--- a/src/imap/imap-settings.c	Thu Mar 10 15:56:46 2011 +0200
+++ b/src/imap/imap-settings.c	Sat Mar 12 15:12:22 2011 +0200
@@ -116,6 +116,7 @@
 static const struct imap_client_workaround_list imap_client_workaround_list[] = {
 	{ "delay-newmail", WORKAROUND_DELAY_NEWMAIL },
 	{ "tb-extra-mailbox-sep", WORKAROUND_TB_EXTRA_MAILBOX_SEP },
+	{ "tb-lsub-flags", WORKAROUND_TB_LSUB_FLAGS },
 	{ NULL, 0 }
 };
 
diff -r 2ac35ed2f943 -r 0405f4c507c9 src/imap/imap-settings.h
--- a/src/imap/imap-settings.h	Thu Mar 10 15:56:46 2011 +0200
+++ b/src/imap/imap-settings.h	Sat Mar 12 15:12:22 2011 +0200
@@ -6,7 +6,8 @@
 /* <settings checks> */
 enum imap_client_workarounds {
 	WORKAROUND_DELAY_NEWMAIL		= 0x01,
-	WORKAROUND_TB_EXTRA_MAILBOX_SEP		= 0x08
+	WORKAROUND_TB_EXTRA_MAILBOX_SEP		= 0x08,
+	WORKAROUND_TB_LSUB_FLAGS		= 0x10
 };
 /* </settings checks> */
 


More information about the dovecot-cvs mailing list