Skip to content

Commit

Permalink
lib-storage: Add \NoInferiors flag to autocreated mailboxes with mbox
Browse files Browse the repository at this point in the history
Once the mailboxes get autocreated, the \NoInferiors flag is added anyway.
  • Loading branch information
sirainen authored and GitLab committed May 30, 2017
1 parent f5836cc commit d754fe4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib-storage/list/mailbox-list-iter.c
Expand Up @@ -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) {
Expand Down

0 comments on commit d754fe4

Please sign in to comment.