From ebd260aae6847cbda246190c2668a62273ab9202 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 11 Jul 2019 15:08:10 +0300 Subject: [PATCH] lib-storage: Fix setting \Noinferiors flag for detached INBOX The "" namespace is nowadays automatically created, so we can't just check if mail_namespace_find_prefix() returns NULL. I left the NULL check there for now at least, just in case there's some reason I couldn't think of when it could be NULL. --- src/lib-storage/list/mailbox-list-iter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib-storage/list/mailbox-list-iter.c b/src/lib-storage/list/mailbox-list-iter.c index 96e999bc8a..95ad8c52c9 100644 --- a/src/lib-storage/list/mailbox-list-iter.c +++ b/src/lib-storage/list/mailbox-list-iter.c @@ -518,6 +518,7 @@ mailbox_list_ns_prefix_return(struct ns_list_iterate_context *ctx, static void inbox_set_children_flags(struct ns_list_iterate_context *ctx) { + struct mail_namespace *ns; const char *prefix; int ret; @@ -527,7 +528,8 @@ static void inbox_set_children_flags(struct ns_list_iterate_context *ctx) MAILBOX_NOCHILDREN)) != 0) return; - if (mail_namespace_find_prefix(ctx->namespaces, "") == NULL) { + ns = mail_namespace_find_prefix(ctx->namespaces, ""); + if (ns == NULL || (ns->flags & NAMESPACE_FLAG_UNUSABLE) != 0) { /* prefix="" namespace doesn't exist, and neither does anything beginning with prefix=INBOX/ (we checked this earlier). there's no way to create children for INBOX. */ -- 2.47.3