From be3b9374c9cd7f5fbe1e9f9280ed483286dcc04b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 14 Jan 2016 16:28:06 +0200 Subject: [PATCH] imapc: Don't duplicate standard mailbox flags in LIST replies. 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 | 3 ++- src/lib-storage/mailbox-list.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib-storage/index/imapc/imapc-list.c b/src/lib-storage/index/imapc/imapc-list.c index 49a412fcac..ef2699c77d 100644 --- a/src/lib-storage/index/imapc/imapc-list.c +++ b/src/lib-storage/index/imapc/imapc-list.c @@ -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, ' '); } diff --git a/src/lib-storage/mailbox-list.h b/src/lib-storage/mailbox-list.h index f0d9a356e3..8f5998c3eb 100644 --- a/src/lib-storage/mailbox-list.h +++ b/src/lib-storage/mailbox-list.h @@ -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,