]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fixed LIST-STATUS when listing subscriptions with subscriptions=no namespaces.
authorTimo Sirainen <tss@iki.fi>
Tue, 2 Nov 2010 15:32:47 +0000 (15:32 +0000)
committerTimo Sirainen <tss@iki.fi>
Tue, 2 Nov 2010 15:32:47 +0000 (15:32 +0000)
src/imap/cmd-list.c

index 8022ea6e504b486c4f524876833dea4004ba9845..234e2ba003eb59c96fd8c3d35d55349c5f4e1d9b 100644 (file)
@@ -327,6 +327,7 @@ static void list_send_status(struct cmd_list_context *ctx, const char *name,
                             enum mailbox_info_flags flags)
 {
        struct imap_status_result result;
+       struct mail_namespace *ns;
        const char *storage_name, *error;
 
        if ((flags & (MAILBOX_NONEXISTENT | MAILBOX_NOSELECT)) != 0) {
@@ -339,8 +340,11 @@ static void list_send_status(struct cmd_list_context *ctx, const char *name,
                return;
        }
 
-       storage_name = mail_namespace_get_storage_name(ctx->ns, name);
-       if (imap_status_get(ctx->cmd, ctx->ns, storage_name,
+       /* if we're listing subscriptions and there are subscriptions=no
+          namespaces, ctx->ns may not point to correct one */
+       storage_name = name;
+       ns = mail_namespace_find(ctx->ns->user->namespaces, &storage_name);
+       if (imap_status_get(ctx->cmd, ns, storage_name,
                            &ctx->status_items, &result, &error) < 0) {
                client_send_line(ctx->cmd->client,
                                 t_strconcat("* ", error, NULL));