From: Timo Sirainen Date: Tue, 2 Nov 2010 15:32:47 +0000 (+0000) Subject: imap: Fixed LIST-STATUS when listing subscriptions with subscriptions=no namespaces. X-Git-Tag: 2.0.7~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=676bf7a0b210a92c17967b655368c01122c86d9c;p=thirdparty%2Fdovecot%2Fcore.git imap: Fixed LIST-STATUS when listing subscriptions with subscriptions=no namespaces. --- diff --git a/src/imap/cmd-list.c b/src/imap/cmd-list.c index 8022ea6e50..234e2ba003 100644 --- a/src/imap/cmd-list.c +++ b/src/imap/cmd-list.c @@ -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));