changeset 11790:b25a30644e68

lib-storage: Removed code related to listing mailboxes with non-virtual names. The non-virtual listing code would have already crashed with assert.
author Timo Sirainen <tss@iki.fi>
date Sun, 11 Jul 2010 19:32:28 +0100
parents 54807112d1d6
children fec7013c628b
files src/doveadm/doveadm-mail-altmove.c src/doveadm/doveadm-mail-expunge.c src/doveadm/doveadm-mail-fetch.c src/doveadm/doveadm-mail-list-iter.c src/doveadm/doveadm-mail-mailbox-status.c src/doveadm/doveadm-mail-mailbox.c src/doveadm/doveadm-mail-search.c src/dsync/dsync-worker-local.c src/imap/cmd-list.c src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c src/lib-storage/index/shared/shared-list.c src/lib-storage/list/mailbox-list-fs-iter.c src/lib-storage/list/mailbox-list-maildir-iter.c src/lib-storage/list/mailbox-list-maildir.c src/lib-storage/mailbox-list.c src/lib-storage/mailbox-list.h src/plugins/acl/acl-backend-vfile-acllist.c src/plugins/acl/acl-mailbox-list.c src/plugins/acl/acl-shared-storage.c src/plugins/listescape/listescape-plugin.c src/plugins/quota/quota-count.c src/plugins/quota/quota-maildir.c src/plugins/virtual/virtual-config.c
diffstat 23 files changed, 40 insertions(+), 122 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/doveadm-mail-altmove.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/doveadm/doveadm-mail-altmove.c	Sun Jul 11 19:32:28 2010 +0100
@@ -46,7 +46,6 @@
 {
 	const enum mailbox_list_iter_flags iter_flags =
 		MAILBOX_LIST_ITER_RAW_LIST |
-		MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 		MAILBOX_LIST_ITER_NO_AUTO_INBOX |
 		MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
 	struct doveadm_mail_list_iter *iter;
--- a/src/doveadm/doveadm-mail-expunge.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/doveadm/doveadm-mail-expunge.c	Sun Jul 11 19:32:28 2010 +0100
@@ -166,7 +166,6 @@
 {
 	const enum mailbox_list_iter_flags iter_flags =
 		MAILBOX_LIST_ITER_RAW_LIST |
-		MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 		MAILBOX_LIST_ITER_NO_AUTO_INBOX |
 		MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
 	struct doveadm_mail_list_iter *iter;
--- a/src/doveadm/doveadm-mail-fetch.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/doveadm/doveadm-mail-fetch.c	Sun Jul 11 19:32:28 2010 +0100
@@ -422,7 +422,6 @@
 {
 	struct fetch_cmd_context *ctx = (struct fetch_cmd_context *)_ctx;
 	const enum mailbox_list_iter_flags iter_flags =
-		MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 		MAILBOX_LIST_ITER_NO_AUTO_INBOX |
 		MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
 	struct doveadm_mail_list_iter *iter;
--- a/src/doveadm/doveadm-mail-list-iter.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/doveadm/doveadm-mail-list-iter.c	Sun Jul 11 19:32:28 2010 +0100
@@ -58,8 +58,6 @@
 	struct doveadm_mail_list_iter *iter;
 	ARRAY_TYPE(const_string) patterns;
 
-	i_assert((iter_flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0);
-
 	iter = i_new(struct doveadm_mail_list_iter, 1);
 	iter->search_args = search_args;
 
--- a/src/doveadm/doveadm-mail-mailbox-status.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/doveadm/doveadm-mail-mailbox-status.c	Sun Jul 11 19:32:28 2010 +0100
@@ -134,7 +134,6 @@
 {
 	struct status_cmd_context *ctx = (struct status_cmd_context *)_ctx;
 	enum mailbox_list_iter_flags iter_flags =
-		MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 		MAILBOX_LIST_ITER_RAW_LIST |
 		MAILBOX_LIST_ITER_NO_AUTO_INBOX |
 		MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
--- a/src/doveadm/doveadm-mail-mailbox.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/doveadm/doveadm-mail-mailbox.c	Sun Jul 11 19:32:28 2010 +0100
@@ -110,7 +110,6 @@
 	struct list_cmd_context *ctx = (struct list_cmd_context *)_ctx;
 	enum mailbox_list_iter_flags iter_flags =
 		MAILBOX_LIST_ITER_RAW_LIST |
-		MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 		MAILBOX_LIST_ITER_NO_AUTO_INBOX |
 		MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
 	struct doveadm_mail_list_iter *iter;
--- a/src/doveadm/doveadm-mail-search.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/doveadm/doveadm-mail-search.c	Sun Jul 11 19:32:28 2010 +0100
@@ -46,7 +46,6 @@
 {
 	const enum mailbox_list_iter_flags iter_flags =
 		MAILBOX_LIST_ITER_RAW_LIST |
-		MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 		MAILBOX_LIST_ITER_NO_AUTO_INBOX |
 		MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
 	struct doveadm_mail_list_iter *iter;
--- a/src/dsync/dsync-worker-local.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/dsync/dsync-worker-local.c	Sun Jul 11 19:32:28 2010 +0100
@@ -388,7 +388,6 @@
 		(struct local_dsync_worker *)_worker;
 	struct local_dsync_worker_mailbox_iter *iter;
 	enum mailbox_list_iter_flags list_flags =
-		MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 		MAILBOX_LIST_ITER_SKIP_ALIASES |
 		MAILBOX_LIST_ITER_NO_AUTO_INBOX;
 	static const char *patterns[] = { "*", NULL };
@@ -592,7 +591,6 @@
 		(struct local_dsync_worker *)_worker;
 	struct local_dsync_worker_subs_iter *iter;
 	enum mailbox_list_iter_flags list_flags =
-		MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 		MAILBOX_LIST_ITER_SKIP_ALIASES |
 		MAILBOX_LIST_ITER_SELECT_SUBSCRIBED;
 	static const char *patterns[] = { "*", NULL };
--- a/src/imap/cmd-list.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/imap/cmd-list.c	Sun Jul 11 19:32:28 2010 +0100
@@ -184,8 +184,7 @@
 
 	/* find the INBOX flags */
 	ns = mail_namespace_find_inbox(ctx->cmd->client->user->namespaces);
-	list_iter = mailbox_list_iter_init(ns->list, "INBOX",
-					   MAILBOX_LIST_ITER_VIRTUAL_NAMES);
+	list_iter = mailbox_list_iter_init(ns->list, "INBOX", 0);
 	info = mailbox_list_iter_next(list_iter);
 	if (info != NULL) {
 		i_assert(strcasecmp(info->name, "INBOX") == 0);
@@ -198,8 +197,7 @@
 static bool list_namespace_has_children(struct cmd_list_context *ctx)
 {
 	enum mailbox_list_iter_flags list_flags =
-		MAILBOX_LIST_ITER_RETURN_NO_FLAGS |
-		MAILBOX_LIST_ITER_VIRTUAL_NAMES;
+		MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
 	struct mailbox_list_iterate_context *list_iter;
 	const struct mailbox_info *info;
 	bool ret = FALSE;
@@ -925,7 +923,6 @@
 		args += 2;
 	}
 
-	ctx->list_flags |= MAILBOX_LIST_ITER_VIRTUAL_NAMES;
 	if (lsub) {
 		/* LSUB - we don't care about flags */
 		ctx->list_flags |= MAILBOX_LIST_ITER_SELECT_SUBSCRIBED |
--- a/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c	Sun Jul 11 19:32:28 2010 +0100
@@ -549,7 +549,6 @@
 		ctx->default_list = ns->list;
 
 	iter = mailbox_list_iter_init(ns->list, "*",
-				      MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 				      MAILBOX_LIST_ITER_RAW_LIST |
 				      MAILBOX_LIST_ITER_RETURN_NO_FLAGS);
 	while ((info = mailbox_list_iter_next(iter)) != NULL) {
--- a/src/lib-storage/index/shared/shared-list.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/lib-storage/index/shared/shared-list.c	Sun Jul 11 19:32:28 2010 +0100
@@ -196,8 +196,6 @@
 		   prefix matches without the trailing separator */
 		i_assert(ns->prefix_len > 0);
 		ctx->info.name = t_strndup(ns->prefix, ns->prefix_len - 1);
-		if ((_ctx->flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) == 0)
-			ctx->info.name += ctx->info.ns->prefix_len;
 		if (imap_match(ctx->glob, ctx->info.name) == IMAP_MATCH_YES) {
 			ctx->cur_ns = ns->next;
 			return &ctx->info;
--- a/src/lib-storage/list/mailbox-list-fs-iter.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/lib-storage/list/mailbox-list-fs-iter.c	Sun Jul 11 19:32:28 2010 +0100
@@ -223,8 +223,7 @@
 	ctx->ctx.flags = flags;
 	ctx->info_pool = pool_alloconly_create("fs list", 1024);
 	ctx->next = fs_list_next;
-	ctx->sep = (flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0 ?
-		_list->ns->sep : _list->ns->real_sep;
+	ctx->sep = _list->ns->sep;
 	ctx->info.ns = _list->ns;
 
 	prefix_len = strlen(_list->ns->prefix);
@@ -232,14 +231,11 @@
 	for (; *patterns != NULL; patterns++) {
 		/* check that we're not trying to do any "../../" lists */
 		test_pattern = *patterns;
-		if ((flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0) {
-			/* skip namespace prefix if possible. this allows using
-			   e.g. ~/mail/ prefix and have it pass the pattern
-			   validation. */
-			if (strncmp(test_pattern, _list->ns->prefix,
-				    prefix_len) == 0)
-				test_pattern += prefix_len;
-		}
+		/* skip namespace prefix if possible. this allows using
+		   e.g. ~/mail/ prefix and have it pass the pattern
+		   validation. */
+		if (strncmp(test_pattern, _list->ns->prefix, prefix_len) == 0)
+			test_pattern += prefix_len;
 		if (mailbox_list_is_valid_pattern(_list, test_pattern)) {
 			if (strcasecmp(*patterns, "INBOX") == 0) {
 				ctx->inbox_match = TRUE;
@@ -278,8 +274,7 @@
 		return &ctx->ctx;
 	}
 
-	vpath = (flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0 ?
-		_list->ns->prefix : "";
+	vpath = _list->ns->prefix;
 	rootdir = list_get_rootdir(ctx, &vpath);
 	if (rootdir == NULL) {
 		path = mailbox_list_get_path(_list, NULL,
@@ -663,10 +658,7 @@
 						&storage_name);
 	if (ns == NULL) {
 		ns = ctx->info.ns;
-		if ((ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0)
-			storage_name = mail_namespace_get_storage_name(ns, storage_name);
-		else
-			storage_name = ctx->info.name;
+		storage_name = mail_namespace_get_storage_name(ns, storage_name);
 	}
 
 	/* if name ends with hierarchy separator, drop the separator */
--- a/src/lib-storage/list/mailbox-list-maildir-iter.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/lib-storage/list/mailbox-list-maildir-iter.c	Sun Jul 11 19:32:28 2010 +0100
@@ -47,28 +47,18 @@
 	struct mail_namespace *ns = ctx->ctx.list->ns;
 	struct mailbox_node *node;
 	const char *p, *mailbox_c;
-	char hierarchy_sep;
 	bool created;
-	unsigned int prefix_len;
-
-	if ((ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0) {
-		hierarchy_sep = ns->sep;
-		prefix_len = ns->prefix_len;
-	} else {
-		hierarchy_sep = ns->real_sep;
-		prefix_len = 0;
-	}
 
 	mailbox_c = str_c(mailbox);
-	while ((p = strrchr(mailbox_c, hierarchy_sep)) != NULL) {
+	while ((p = strrchr(mailbox_c, ns->sep)) != NULL) {
 		str_truncate(mailbox, (size_t) (p-mailbox_c));
 		mailbox_c = str_c(mailbox);
 		if (imap_match(glob, mailbox_c) != IMAP_MATCH_YES)
 			continue;
 
-		if (prefix_len > 0 && str_len(mailbox) == prefix_len-1 &&
-		    strncmp(mailbox_c, ns->prefix, prefix_len - 1) == 0 &&
-		    mailbox_c[prefix_len-1] == hierarchy_sep) {
+		if (ns->prefix_len > 0 && str_len(mailbox) == ns->prefix_len-1 &&
+		    strncmp(mailbox_c, ns->prefix, ns->prefix_len - 1) == 0 &&
+		    mailbox_c[ns->prefix_len-1] == ns->sep) {
 			/* don't return matches to namespace prefix itself */
 			continue;
 		}
@@ -99,10 +89,7 @@
 	const char *p, *mailbox_c;
 	char hierarchy_sep;
 
-	if ((ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0)
-		hierarchy_sep = ctx->ctx.list->ns->sep;
-	else
-		hierarchy_sep = ctx->ctx.list->ns->real_sep;
+	hierarchy_sep = ctx->ctx.list->ns->sep;
 
 	/* mark the first existing parent as containing children */
 	mailbox_c = str_c(mailbox);
@@ -287,7 +274,7 @@
 	enum mailbox_info_flags flags;
 	enum imap_match_result match;
 	struct mailbox_node *node;
-	bool created, virtual_names;
+	bool created;
 	struct stat st;
 	int ret;
 
@@ -304,8 +291,6 @@
 		return 0;
 	}
 
-	virtual_names = (ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0;
-
 	mailbox = t_str_new(MAILBOX_LIST_NAME_MAX_LENGTH);
 	while ((d = readdir(dirp)) != NULL) {
 		const char *fname = d->d_name;
@@ -323,14 +308,8 @@
 		    (fname[1] == '\0' || (fname[1] == '.' && fname[2] == '\0')))
 			continue;
 
-		if (!virtual_names) {
-			str_truncate(mailbox, 0);
-			str_append(mailbox, mailbox_name);
-			mailbox_name = str_c(mailbox);
-		} else {
-			mailbox_name = mail_namespace_get_vname(ns, mailbox,
-								mailbox_name);
-		}
+		mailbox_name = mail_namespace_get_vname(ns, mailbox,
+							mailbox_name);
 
 		/* make sure the pattern matches */
 		match = imap_match(glob, mailbox_name);
@@ -412,7 +391,6 @@
 	struct mailbox_node *node;
 
 	iter = mailbox_list_iter_init(ns->list, "*",
-				      MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 				      MAILBOX_LIST_ITER_RETURN_CHILDREN);
 	while ((info = mailbox_list_iter_next(iter)) != NULL) {
 		node = mailbox_tree_lookup(ctx->tree_ctx, info->name);
@@ -459,24 +437,20 @@
 {
 	struct maildir_list_iterate_context *ctx;
         struct imap_match_glob *glob;
-	char sep;
 	pool_t pool;
 	int ret;
 
-	sep = (flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0 ?
-		_list->ns->sep : _list->ns->real_sep;
-
 	pool = pool_alloconly_create("maildir_list", 1024);
 	ctx = p_new(pool, struct maildir_list_iterate_context, 1);
 	ctx->ctx.list = _list;
 	ctx->ctx.flags = flags;
 	ctx->pool = pool;
-	ctx->tree_ctx = mailbox_tree_init(sep);
+	ctx->tree_ctx = mailbox_tree_init(_list->ns->sep);
 	ctx->info.ns = _list->ns;
 	ctx->prefix_char = strcmp(_list->name, MAILBOX_LIST_NAME_IMAPDIR) == 0 ?
 		'\0' : _list->hierarchy_sep;
 
-	glob = imap_match_init_multiple(pool, patterns, TRUE, sep);
+	glob = imap_match_init_multiple(pool, patterns, TRUE, _list->ns->sep);
 
 	ctx->dir = _list->set.root_dir;
 
--- a/src/lib-storage/list/mailbox-list-maildir.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/lib-storage/list/mailbox-list-maildir.c	Sun Jul 11 19:32:28 2010 +0100
@@ -493,7 +493,6 @@
 
 	pattern = t_strdup_printf("%s%c*", old_vname, oldlist->ns->sep);
 	iter = mailbox_list_iter_init(oldlist, pattern,
-				      MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 				      MAILBOX_LIST_ITER_RETURN_NO_FLAGS |
 				      MAILBOX_LIST_ITER_RAW_LIST);
 	while ((info = mailbox_list_iter_next(iter)) != NULL) {
--- a/src/lib-storage/mailbox-list.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/lib-storage/mailbox-list.c	Sun Jul 11 19:32:28 2010 +0100
@@ -787,11 +787,6 @@
 {
 	i_assert(*patterns != NULL);
 
-	/* we'll want to remove MAILBOX_LIST_ITER_VIRTUAL_NAMES flag completely.
-	   this assert will be here until it's sure that there are no more
-	   non-virtual users and it can be safely removed. (and if there are,
-	   this assert can still be easily removed) */
-	i_assert((flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0);
 	return list->v.iter_init(list, patterns, flags);
 }
 
@@ -901,25 +896,19 @@
 	if (!ns_match_simple(ctx, ns))
 		return FALSE;
 
-	if ((ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0) {
-		/* filter out namespaces whose prefix doesn't match.
-		   this same code handles both with and without
-		   STAR_WITHIN_NS, so the "without" case is slower than
-		   necessary, but this shouldn't matter much */
-		T_BEGIN {
-			for (i = 0; ctx->patterns_ns_match[i] != NULL; i++) {
-				if (ns_match_inbox(ns, ctx->patterns_ns_match[i]))
-					break;
-				if (ns_match_next(ctx, ns,
-						  ctx->patterns_ns_match[i]))
-					break;
-			}
-		} T_END;
+	/* filter out namespaces whose prefix doesn't match. this same code
+	   handles both with and without STAR_WITHIN_NS, so the "without" case
+	   is slower than necessary, but this shouldn't matter much */
+	T_BEGIN {
+		for (i = 0; ctx->patterns_ns_match[i] != NULL; i++) {
+			if (ns_match_inbox(ns, ctx->patterns_ns_match[i]))
+				break;
+			if (ns_match_next(ctx, ns, ctx->patterns_ns_match[i]))
+				break;
+		}
+	} T_END;
 
-		if (ctx->patterns_ns_match[i] == NULL)
-			return FALSE;
-	}
-	return ns;
+	return ctx->patterns_ns_match[i] != NULL;
 }
 
 static struct mail_namespace *
@@ -1004,9 +993,6 @@
 
 	i_assert(namespaces != NULL);
 
-	i_assert((flags & MAILBOX_LIST_ITER_STAR_WITHIN_NS) == 0 ||
-		 (flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0);
-
 	pool = pool_alloconly_create("mailbox list namespaces", 1024);
 	ctx = p_new(pool, struct ns_list_iterate_context, 1);
 	ctx->pool = pool;
--- a/src/lib-storage/mailbox-list.h	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/lib-storage/mailbox-list.h	Sun Jul 11 19:32:28 2010 +0100
@@ -61,9 +61,6 @@
 enum mailbox_list_iter_flags {
 	/* Ignore index file and ACLs (used by ACL plugin internally) */
 	MAILBOX_LIST_ITER_RAW_LIST		= 0x000001,
-	/* Use virtual mailbox names (virtual separators and namespace
-	   prefixes) for patterns and for returned mailbox names. */
-	MAILBOX_LIST_ITER_VIRTUAL_NAMES		= 0x000002,
 	/* Don't list INBOX unless it actually exists */
 	MAILBOX_LIST_ITER_NO_AUTO_INBOX		= 0x000004,
 
@@ -74,7 +71,7 @@
 	   match beyond namespace boundary (e.g. "foo*" or "*o" doesn't match
 	   "foo." namespace's mailboxes, but "*.*" does). also '%' can't match
 	   namespace prefixes, if there exists a parent namespace whose children
-	   it matches. VIRTUAL_NAMES must be set when using this flag. */
+	   it matches. */
 	MAILBOX_LIST_ITER_STAR_WITHIN_NS	= 0x000010,
 
 	/* List only subscribed mailboxes */
--- a/src/plugins/acl/acl-backend-vfile-acllist.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/plugins/acl/acl-backend-vfile-acllist.c	Sun Jul 11 19:32:28 2010 +0100
@@ -252,7 +252,6 @@
 
 	backend->rebuilding_acllist = TRUE;
 	iter = mailbox_list_iter_init(list, "*",
-				      MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 				      MAILBOX_LIST_ITER_RAW_LIST |
 				      MAILBOX_LIST_ITER_RETURN_NO_FLAGS);
 	while ((info = mailbox_list_iter_next(iter)) != NULL) {
--- a/src/plugins/acl/acl-mailbox-list.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/plugins/acl/acl-mailbox-list.c	Sun Jul 11 19:32:28 2010 +0100
@@ -111,9 +111,7 @@
 		return;
 
 	/* no LOOKUP right by default, we can optimize this */
-	if ((ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0)
-		vname = t_str_new(256);
-
+	vname = t_str_new(256);
 	memset(&update_ctx, 0, sizeof(update_ctx));
 	update_ctx.iter_ctx = &ctx->ctx;
 	update_ctx.glob =
@@ -173,8 +171,7 @@
 	ctx->ctx.flags = flags;
 
 	inboxcase = (list->ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0;
-	ctx->sep = (ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0 ?
-		list->ns->sep : list->ns->real_sep;
+	ctx->sep = list->ns->sep;
 	ctx->glob = imap_match_init_multiple(default_pool, patterns,
 					     inboxcase, ctx->sep);
 	/* see if all patterns have only a single '*' and it's at the end.
@@ -225,9 +222,7 @@
 	struct mail_namespace *ns = ctx->list->ns;
 	unsigned int len;
 
-	if ((ctx->flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0)
-		name = mail_namespace_get_storage_name(ns, name);
-
+	name = mail_namespace_get_storage_name(ns, name);
 	len = strlen(name);
 	if (name[len-1] == ns->real_sep) {
 		/* name ends with separator. this can happen if doing e.g.
@@ -256,7 +251,6 @@
 {
 	struct mailbox_list_iterate_context *iter;
 	const struct mailbox_info *info;
-	enum mailbox_list_iter_flags flags;
 	string_t *pattern;
 	const char *prefix;
 	unsigned int i, prefix_len;
@@ -294,9 +288,8 @@
 	prefix = str_c(pattern);
 	prefix_len = str_len(pattern) - 1;
 
-	flags = (ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) |
-		MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
-	iter = mailbox_list_iter_init(ctx->ctx.list, str_c(pattern), flags);
+	iter = mailbox_list_iter_init(ctx->ctx.list, str_c(pattern),
+				      MAILBOX_LIST_ITER_RETURN_NO_FLAGS);
 	while ((info = mailbox_list_iter_next(iter)) != NULL) {
 		if (only_nonpatterns &&
 		    imap_match(ctx->glob, info->name) == IMAP_MATCH_YES) {
--- a/src/plugins/acl/acl-shared-storage.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/plugins/acl/acl-shared-storage.c	Sun Jul 11 19:32:28 2010 +0100
@@ -51,7 +51,6 @@
 
 	/* check if there are any mailboxes really visible to us */
 	iter = mailbox_list_iter_init(new_ns->list, "*",
-				      MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 				      MAILBOX_LIST_ITER_RETURN_NO_FLAGS);
 	while ((info = mailbox_list_iter_next(iter)) != NULL)
 		break;
--- a/src/plugins/listescape/listescape-plugin.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/plugins/listescape/listescape-plugin.c	Sun Jul 11 19:32:28 2010 +0100
@@ -113,18 +113,16 @@
 	struct mailbox_list_iterate_context *ctx;
 	const char **escaped_patterns;
 	unsigned int i;
-	bool vname;
 
 	/* this is kind of kludgy. In ACL code we want to convert patterns,
 	   in maildir renaming code we don't. so for now just use the _RAW_LIST
 	   flag.. */
 	if ((flags & MAILBOX_LIST_ITER_RAW_LIST) == 0) {
-		vname = (flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0;
 		escaped_patterns = t_new(const char *,
 					 str_array_length(patterns) + 1);
 		for (i = 0; patterns[i] != NULL; i++) {
 			escaped_patterns[i] =
-				list_escape(list->ns, patterns[i], vname);
+				list_escape(list->ns, patterns[i], TRUE);
 		}
 		patterns = escaped_patterns;
 	}
@@ -170,7 +168,7 @@
 	ctx->list->ns->real_sep = ctx->list->hierarchy_sep;
 	info = mlist->module_ctx.super.iter_next(ctx);
 	ctx->list->ns->real_sep = ctx->list->ns->sep;
-	if (info == NULL || (ctx->flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) == 0)
+	if (info == NULL)
 		return info;
 
 	ns = (ctx->flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) == 0 ?
--- a/src/plugins/quota/quota-count.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/plugins/quota/quota-count.c	Sun Jul 11 19:32:28 2010 +0100
@@ -81,7 +81,6 @@
 	int ret = 0;
 
 	ctx = mailbox_list_iter_init(ns->list, "*",
-				     MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 				     MAILBOX_LIST_ITER_RETURN_NO_FLAGS);
 	while ((info = mailbox_list_iter_next(ctx)) != NULL) {
 		if ((info->flags & (MAILBOX_NONEXISTENT |
--- a/src/plugins/quota/quota-maildir.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/plugins/quota/quota-maildir.c	Sun Jul 11 19:32:28 2010 +0100
@@ -130,7 +130,6 @@
 	ctx->path = str_new(default_pool, 512);
 	ctx->list = list;
 	ctx->iter = mailbox_list_iter_init(list, "*",
-					   MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 					   MAILBOX_LIST_ITER_RETURN_NO_FLAGS);
 	return ctx;
 }
--- a/src/plugins/virtual/virtual-config.c	Sun Jul 11 19:19:45 2010 +0100
+++ b/src/plugins/virtual/virtual-config.c	Sun Jul 11 19:32:28 2010 +0100
@@ -264,7 +264,6 @@
 	const enum namespace_type iter_ns_types =
 		NAMESPACE_PRIVATE | NAMESPACE_SHARED | NAMESPACE_PUBLIC;
 	const enum mailbox_list_iter_flags iter_flags =
-		MAILBOX_LIST_ITER_VIRTUAL_NAMES |
 		MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
 	struct mail_user *user = ctx->mbox->storage->storage.user;
 	ARRAY_TYPE(virtual_backend_box) wildcard_boxes, neg_boxes;