]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Removed code related to listing mailboxes with non-virtual names.
authorTimo Sirainen <tss@iki.fi>
Sun, 11 Jul 2010 18:32:28 +0000 (19:32 +0100)
committerTimo Sirainen <tss@iki.fi>
Sun, 11 Jul 2010 18:32:28 +0000 (19:32 +0100)
The non-virtual listing code would have already crashed with assert.

23 files changed:
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

index 9b31abd4ff90a18595fb623d4a20fcbd101c0537..eafe5d6a667f8821e3696ddc0eec4cdbdbeaa393 100644 (file)
@@ -46,7 +46,6 @@ cmd_altmove_run(struct doveadm_mail_cmd_context *ctx, struct mail_user *user)
 {
        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;
index 2e74e448a47416b8923b5bfce7f5d27d926be831..e0aa1a43b04262caa9016e765d6a5dae2d8fd5d8 100644 (file)
@@ -166,7 +166,6 @@ cmd_expunge_run(struct doveadm_mail_cmd_context *ctx, struct mail_user *user)
 {
        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;
index 3ac21c240e90e0a4a5c5011b88a2efc2cbe8363a..86ce1943af054f1e3ef050b9958fd73b28f51c0e 100644 (file)
@@ -422,7 +422,6 @@ cmd_fetch_run(struct doveadm_mail_cmd_context *_ctx, struct mail_user *user)
 {
        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;
index c3d07a9561d1e98f12edd70a9b6d12711ccc2a63..c899eac95a7b3b5d2e95283914d471178f3d9505 100644 (file)
@@ -58,8 +58,6 @@ doveadm_mail_list_iter_init(struct mail_user *user,
        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;
 
index cbdd022c935f21e4d50546d477337d2b4b8aa54c..e8cfb9889aed0e237d1639d812147af08cd382e1 100644 (file)
@@ -134,7 +134,6 @@ cmd_mailbox_status_run(struct doveadm_mail_cmd_context *_ctx,
 {
        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;
index cf3a6af3b70a972cfedb130d3820443b879a2d6a..6a7c4f9623026763133d1463bc3489c52364eee6 100644 (file)
@@ -110,7 +110,6 @@ cmd_mailbox_list_run(struct doveadm_mail_cmd_context *_ctx,
        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;
index b65ff9f039dc64d214b55079fa7329560031892b..c9709c089c85edfcaeb92c45d47c6332f9833a25 100644 (file)
@@ -46,7 +46,6 @@ cmd_search_run(struct doveadm_mail_cmd_context *ctx, struct mail_user *user)
 {
        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;
index 79e655171abcd3ab16591e1b058a56b2ba81ddc6..7778cbcea419c4f522a3cfd97f6cc72524c518ec 100644 (file)
@@ -388,7 +388,6 @@ local_worker_mailbox_iter_init(struct dsync_worker *_worker)
                (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 @@ local_worker_subs_iter_init(struct dsync_worker *_worker)
                (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 };
index 3c5f64a8b5ee0a80e7a0add483d94cc402ed3183..06739ad2818d32f647f5bd19198057ad89c8b463 100644 (file)
@@ -184,8 +184,7 @@ list_get_inbox_flags(struct cmd_list_context *ctx)
 
        /* 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 @@ list_get_inbox_flags(struct cmd_list_context *ctx)
 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 @@ bool cmd_list_full(struct client_command_context *cmd, bool lsub)
                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 |
index e086f81515597e986839b5ff8c2afaf33690cf34..a4d50542302848a7e0bf17cb19d9b0cf5e4e0725 100644 (file)
@@ -549,7 +549,6 @@ rebuild_namespace_mailboxes(struct mdbox_storage_rebuild_context *ctx,
                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) {
index bb5a4ebf4942be6668b28344902df3c1487eecbe..16ba96ff9ece1d2694f50324c994ac5241bcbb67 100644 (file)
@@ -196,8 +196,6 @@ shared_list_iter_next(struct mailbox_list_iterate_context *_ctx)
                   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;
index adaa9f812360dcb45b2052896f02809a7ea788a3..1ca56b76647d6dee2a87f2cc28adcb3c863daed7 100644 (file)
@@ -223,8 +223,7 @@ fs_list_iter_init(struct mailbox_list *_list, const char *const *patterns,
        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 @@ fs_list_iter_init(struct mailbox_list *_list, const char *const *patterns,
        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 @@ fs_list_iter_init(struct mailbox_list *_list, const char *const *patterns,
                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 @@ fs_list_subs(struct fs_list_iterate_context *ctx)
                                                &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 */
index 2bbe87da1ddc866e357ca70535efc1c60603a373..b60499f0ec564121597faa3032b9f71e0046320c 100644 (file)
@@ -47,28 +47,18 @@ maildir_fill_parents(struct maildir_list_iterate_context *ctx,
        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 @@ static void maildir_set_children(struct maildir_list_iterate_context *ctx,
        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 @@ maildir_fill_readdir(struct maildir_list_iterate_context *ctx,
        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 @@ maildir_fill_readdir(struct maildir_list_iterate_context *ctx,
                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 @@ maildir_fill_readdir(struct maildir_list_iterate_context *ctx,
                    (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 @@ maildir_fill_other_ns_subscriptions(struct maildir_list_iterate_context *ctx,
        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 @@ maildir_list_iter_init(struct mailbox_list *_list, const char *const *patterns,
 {
        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;
 
index dc23e61b0e3a137245f4070ccb9ff4c85e200bd0..141ec634c96523c7064bf0a1f69598779fef1cfe 100644 (file)
@@ -493,7 +493,6 @@ maildir_rename_children(struct mailbox_list *oldlist, const char *oldname,
 
        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) {
index 3a3d4e2adc84f0f8e73e98b06ae5afdaa4e1d110..bccce605a22c4590c937616eacd75ac48cdd1518 100644 (file)
@@ -787,11 +787,6 @@ mailbox_list_iter_init_multiple(struct mailbox_list *list,
 {
        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 @@ ns_match(struct ns_list_iterate_context *ctx, struct mail_namespace *ns)
        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 @@ mailbox_list_iter_init_namespaces(struct mail_namespace *namespaces,
 
        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;
index 71dd8732653916be09e0587f9d99542e1a999744..d7ebd7cdce3b1ae7bab9f4dd45f5e982dba44027 100644 (file)
@@ -61,9 +61,6 @@ enum mailbox_name_status {
 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 @@ enum mailbox_list_iter_flags {
           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 */
index 9dafd22d0bf63a6acd540c84a78f64c2cf2e4ba5..f7e3547cd62b19d2c8c77d85df597167bb0b3af4 100644 (file)
@@ -252,7 +252,6 @@ acl_backend_vfile_acllist_try_rebuild(struct acl_backend_vfile *backend)
 
        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) {
index 085bd778792b6d6cec06e1aee8a8fde1caa1cf28..b5f429e0c54287eecb2edddf8afe25457bee2389 100644 (file)
@@ -111,9 +111,7 @@ acl_mailbox_try_list_fast(struct acl_mailbox_list_iterate_context *ctx)
                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 @@ acl_mailbox_list_iter_init(struct mailbox_list *list,
        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 @@ acl_mailbox_list_iter_get_name(struct mailbox_list_iterate_context *ctx,
        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 @@ iter_mailbox_has_visible_children(struct acl_mailbox_list_iterate_context *ctx,
 {
        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 @@ iter_mailbox_has_visible_children(struct acl_mailbox_list_iterate_context *ctx,
        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) {
index b7ca769825b4d74fc6ff06e795ca807847fe4cc4..98cea60eb637e201e0d470fc9c2f92f8fcd9b744 100644 (file)
@@ -51,7 +51,6 @@ acl_shared_namespace_add(struct mail_namespace *ns,
 
        /* 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;
index 3edaf71a44b55ff1aa8bf96d14b9dc3068ce3066..b89f6591d74647994f3c473379e5ccb2b06a8755 100644 (file)
@@ -113,18 +113,16 @@ listescape_mailbox_list_iter_init(struct mailbox_list *list,
        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 @@ listescape_mailbox_list_iter_next(struct mailbox_list_iterate_context *ctx)
        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 ?
index d8ba68a790548c2c84b3064b6a38e4968088378f..609421bedc0f4233b9dbc04d7446c872b931edf0 100644 (file)
@@ -81,7 +81,6 @@ quota_count_namespace(struct quota_root *root, struct mail_namespace *ns,
        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 |
index a823b6bc84a8cf1d95af60f9be46c0b34e467a40..9f66a1ba3cf69ded90e5e671f8d68ec2b0b4c780 100644 (file)
@@ -130,7 +130,6 @@ maildir_list_init(struct maildir_quota_root *root, struct mailbox_list *list)
        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;
 }
index 974cac510e1c2d27594bf47deb9249059168e1d5..dca52d9eddea800a050d7c96ce31f1f675e1dc61 100644 (file)
@@ -264,7 +264,6 @@ static int virtual_config_expand_wildcards(struct virtual_parse_context *ctx)
        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;