From 921a0bd6baf92fd83889c11b60d7275c59b61ab2 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 26 Sep 2010 18:05:25 +0100 Subject: [PATCH] imap: Give better error message for "Unknown namespace" --- src/imap/imap-commands-util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/imap/imap-commands-util.c b/src/imap/imap-commands-util.c index 1904e20414..5e4bf9b8dd 100644 --- a/src/imap/imap-commands-util.c +++ b/src/imap/imap-commands-util.c @@ -24,14 +24,18 @@ client_find_namespace(struct client_command_context *cmd, const char *mailbox, const char **storage_name_r, enum mailbox_name_status *mailbox_status_r) { + struct mail_namespace *namespaces = cmd->client->user->namespaces; struct mail_namespace *ns; const char *storage_name, *p; unsigned int storage_name_len; storage_name = mailbox; - ns = mail_namespace_find(cmd->client->user->namespaces, &storage_name); + ns = mail_namespace_find(namespaces, &storage_name); if (ns == NULL) { - client_send_tagline(cmd, "NO Unknown namespace."); + client_send_tagline(cmd, t_strdup_printf( + "NO Client tried to access nonexistent namespace. " + "(Mailbox name should probably be prefixed with: %s)", + mail_namespace_find_inbox(namespaces)->prefix)); return NULL; } -- 2.47.3