Hi again Timo,

As agreed earlier tonight, you'll find as attachments 4 diffs (diff -u) implementing the new workaround "tb-lsub-flags".

The 4 impacted files are:

./src/imap/imap-settings.h
./src/imap/imap-settings.c
./src/imap/cmd-list.c
./src/config/all-settings.c

Here is the proposed description for the dovecot.conf file:

#   tb-lsub-flags:
# Usually IMAP servers don't bother returning the flags attached
# to each mailbox, but Thunderbird presently needs them in order
# to correctly process the "folders of folders" case.


Please tell me if the patch format is suitable or if you expect something else.

Best regards and thanks again for your responsiveness.

Bruno

--
- Service Hydrographique et Oceanographique de la Marine - DO/MGS/INF
-  13, rue du Chatellier -  CS 92803  - 29228 Brest Cedex 2, FRANCE
-     Phone: +33 2 98 22 17 49  -  Email: bruno.tregu...@shom.fr
--- ./src/imap/imap-settings.h  2011-03-04 19:53:01.000000000 +0100
+++ ./src/imap/imap-settings.h.new      2011-03-07 22:10:01.000000000 +0100
@@ -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> */
 
--- ./src/imap/cmd-list.c       2011-03-04 19:53:01.000000000 +0100
+++ ./src/imap/cmd-list.c.new   2011-03-07 22:31:25.000000000 +0100
@@ -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 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;
--- ./src/imap/imap-settings.c  2011-03-04 19:53:01.000000000 +0100
+++ ./src/imap/imap-settings.c.new      2011-03-07 22:05:12.000000000 +0100
@@ -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 }
 };
 
--- ./src/config/all-settings.c 2011-03-04 19:56:16.000000000 +0100
+++ ./src/config/all-settings.c.new     2011-03-07 22:12:48.000000000 +0100
@@ -857,7 +857,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> */
 struct imap_settings {
@@ -2020,6 +2021,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 }
 };
 

Reply via email to