From d754fe4573cb7ceaac373b003509beb14c52f6ca Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 29 May 2017 15:52:15 +0300 Subject: [PATCH] lib-storage: Add \NoInferiors flag to autocreated mailboxes with mbox Once the mailboxes get autocreated, the \NoInferiors flag is added anyway. --- src/lib-storage/list/mailbox-list-iter.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib-storage/list/mailbox-list-iter.c b/src/lib-storage/list/mailbox-list-iter.c index 51eb831e7f..190ee8ca77 100644 --- a/src/lib-storage/list/mailbox-list-iter.c +++ b/src/lib-storage/list/mailbox-list-iter.c @@ -920,8 +920,16 @@ static bool autocreate_iter_autobox(struct mailbox_list_iterate_context *ctx, if ((ctx->flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0) actx->new_info.flags |= MAILBOX_SUBSCRIBED; - if ((actx->new_info.flags & MAILBOX_CHILDREN) == 0) - actx->new_info.flags |= MAILBOX_NOCHILDREN; + if ((actx->new_info.flags & MAILBOX_CHILDREN) == 0) { + if ((ctx->list->flags & MAILBOX_LIST_FLAG_MAILBOX_FILES) != 0 && + ctx->list->set.maildir_name[0] == '\0') { + /* mailbox format using files (e.g. mbox) + without DIRNAME specified */ + actx->new_info.flags |= MAILBOX_NOINFERIORS; + } else { + actx->new_info.flags |= MAILBOX_NOCHILDREN; + } + } match = imap_match(ctx->glob, actx->new_info.vname); if (match == IMAP_MATCH_YES) {