]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add \NoInferiors flag to autocreated mailboxes with mbox
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 29 May 2017 12:52:15 +0000 (15:52 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 30 May 2017 07:00:34 +0000 (10:00 +0300)
Once the mailboxes get autocreated, the \NoInferiors flag is added anyway.

src/lib-storage/list/mailbox-list-iter.c

index 51eb831e7f1ff256e43febfbcee5f1d8bc1e292a..190ee8ca77b89f278f1c38393987b539da7c0f38 100644 (file)
@@ -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) {