changeset 22111:973a978ed497

lib-storage: Add \NoInferiors flag to autocreated mailboxes with mbox Once the mailboxes get autocreated, the \NoInferiors flag is added anyway.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 29 May 2017 15:52:15 +0300
parents 786b4dcee7e5
children 40df5a1df6b1
files src/lib-storage/list/mailbox-list-iter.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-iter.c	Mon May 29 15:30:36 2017 +0300
+++ b/src/lib-storage/list/mailbox-list-iter.c	Mon May 29 15:52:15 2017 +0300
@@ -920,8 +920,16 @@
 	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) {