From: Timo Sirainen Date: Fri, 15 Oct 2010 14:13:59 +0000 (+0100) Subject: acl: Log mailbox names that are skipped due to missing lookup right with mail_debug=yes X-Git-Tag: 2.0.6~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=925915badca5cf87bf45050c2fcc103534bef71a;p=thirdparty%2Fdovecot%2Fcore.git acl: Log mailbox names that are skipped due to missing lookup right with mail_debug=yes --- diff --git a/src/plugins/acl/acl-mailbox-list.c b/src/plugins/acl/acl-mailbox-list.c index 9a96e3c268..8a693bcb89 100644 --- a/src/plugins/acl/acl-mailbox-list.c +++ b/src/plugins/acl/acl-mailbox-list.c @@ -202,15 +202,18 @@ acl_mailbox_list_iter_next_info(struct acl_mailbox_list_iterate_context *ctx) struct acl_mailbox_list *alist = ACL_LIST_CONTEXT(ctx->ctx.list); const struct mailbox_info *info; - do { - info = alist->module_ctx.super.iter_next(ctx->super_ctx); - if (info == NULL) - return NULL; + while ((info = alist->module_ctx.super.iter_next(ctx->super_ctx)) != NULL) { /* if we've a list of mailboxes with LOOKUP rights, skip the mailboxes not in the list (since we know they can't be visible to us). */ - } while (ctx->lookup_boxes != NULL && - mailbox_tree_lookup(ctx->lookup_boxes, info->name) == NULL); + if (ctx->lookup_boxes == NULL || + mailbox_tree_lookup(ctx->lookup_boxes, info->name) != NULL) + break; + if (ctx->ctx.list->ns->user->mail_debug) { + i_debug("acl: Mailbox not in dovecot-acl-list: %s", + info->name); + } + } return info; } @@ -378,6 +381,10 @@ acl_mailbox_list_iter_next(struct mailbox_list_iterate_context *_ctx) return NULL; } /* skip to next one */ + if (ctx->ctx.list->ns->user->mail_debug) { + i_debug("acl: No lookup right to mailbox: %s", + info->name); + } } return info == NULL ? NULL : &ctx->info; }