dovecot-2.2: imapc: Don't return mailbox list entries that would...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 23 09:34:29 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/563b93302831
changeset: 18885:563b93302831
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 23 11:30:27 2015 +0200
description:
imapc: Don't return mailbox list entries that would result in name="".
So basically don't return namespace prefix if imapc_list_prefix="".

diffstat:

 src/lib-storage/index/imapc/imapc-list.c |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diffs (27 lines):

diff -r f06008be0d1d -r 563b93302831 src/lib-storage/index/imapc/imapc-list.c
--- a/src/lib-storage/index/imapc/imapc-list.c	Tue Jun 23 11:12:38 2015 +0200
+++ b/src/lib-storage/index/imapc/imapc-list.c	Tue Jun 23 11:30:27 2015 +0200
@@ -679,6 +679,8 @@
 {
 	struct imapc_mailbox_list_iterate_context *ctx =
 		(struct imapc_mailbox_list_iterate_context *)_ctx;
+	struct imapc_mailbox_list *list =
+		(struct imapc_mailbox_list *)_ctx->list;
 	struct mailbox_node *node;
 	const char *vname;
 
@@ -694,6 +696,14 @@
 			return NULL;
 	} while ((node->flags & MAILBOX_MATCHED) == 0);
 
+	if (ctx->info.ns->prefix > 0 &&
+	    strncmp(vname, ctx->info.ns->prefix, ctx->info.ns->prefix_len-1) == 0 &&
+	    vname[ctx->info.ns->prefix_len] == '\0' &&
+	    list->set->imapc_list_prefix[0] == '\0') {
+		/* don't return "" name */
+		return imapc_list_iter_next(_ctx);
+	}
+
 	ctx->info.vname = vname;
 	ctx->info.flags = node->flags;
 	if ((_ctx->list->ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0) {


More information about the dovecot-cvs mailing list