]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Don't duplicate standard mailbox flags in LIST replies.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 14 Jan 2016 14:28:06 +0000 (16:28 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 14 Jan 2016 14:28:06 +0000 (16:28 +0200)
We added the standard \NoSelect, \NonExistent, \NoInferiors and \Subscribed
to special_use string, which caused them to be sent duplicated.

src/lib-storage/index/imapc/imapc-list.c
src/lib-storage/mailbox-list.h

index 49a412fcac80ad919512f1531a4c792bc062ef1e..ef2699c77d4894b9296af6d6710875ad8a292359 100644 (file)
@@ -660,7 +660,8 @@ imapc_list_write_special_use(struct imapc_mailbox_list_iterate_context *ctx,
        str_truncate(ctx->special_use, 0);
 
        for (i = 0; i < N_ELEMENTS(imap_list_flags); i++) {
-               if ((node->flags & imap_list_flags[i].flag) != 0) {
+               if ((node->flags & imap_list_flags[i].flag) != 0 &&
+                   (node->flags & MAILBOX_SPECIALUSE_MASK) != 0) {
                        str_append(ctx->special_use, imap_list_flags[i].str);
                        str_append_c(ctx->special_use, ' ');
                }
index f0d9a356e38070e91367ed70ece887d6fad22c64..8f5998c3ebeb169a23839ebd4859b7fc18da9518 100644 (file)
@@ -59,6 +59,7 @@ enum mailbox_info_flags {
        MAILBOX_SPECIALUSE_SENT         = 0x00200000,
        MAILBOX_SPECIALUSE_TRASH        = 0x00400000,
        MAILBOX_SPECIALUSE_IMPORTANT    = 0x00800000,
+#define MAILBOX_SPECIALUSE_MASK                  0x00ff0000
 
        /* Internally used by lib-storage: */
        MAILBOX_SELECT                  = 0x20000000,