From: Timo Sirainen Date: Wed, 11 Jun 2008 23:08:16 +0000 (+0300) Subject: dbox: Set MAILBOX_NOCHILDREN flag for selectable mailboxes if we know it. X-Git-Tag: 1.2.alpha1~331 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37fa7b009a21c968d134b02a5e42b66052df7682;p=thirdparty%2Fdovecot%2Fcore.git dbox: Set MAILBOX_NOCHILDREN flag for selectable mailboxes if we know it. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/dbox/dbox-storage.c b/src/lib-storage/index/dbox/dbox-storage.c index a37c4aaf27..c8dfcaf089 100644 --- a/src/lib-storage/index/dbox/dbox-storage.c +++ b/src/lib-storage/index/dbox/dbox-storage.c @@ -634,11 +634,14 @@ static int dbox_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx if ((*flags & (MAILBOX_NOSELECT | MAILBOX_NONEXISTENT)) == 0) { /* make sure it's a selectable mailbox */ maildir_path = t_strconcat(path, "/"DBOX_MAILDIR_NAME, NULL); - if (stat(maildir_path, &st2) < 0 || !S_ISDIR(st2.st_mode)) { + if (stat(maildir_path, &st2) < 0 || !S_ISDIR(st2.st_mode)) *flags |= MAILBOX_NOSELECT; - if (st.st_nlink == 3 && - *ctx->list->set.maildir_name != '\0') + if (st.st_nlink == 3 && *ctx->list->set.maildir_name != '\0') { + /* now we know what link count 3 means. */ + if ((*flags & MAILBOX_NOSELECT) != 0) *flags |= MAILBOX_CHILDREN; + else + *flags |= MAILBOX_NOCHILDREN; } } return ret;