From: Timo Sirainen Date: Sun, 26 Sep 2010 17:05:25 +0000 (+0100) Subject: imap: Give better error message for "Unknown namespace" X-Git-Tag: 2.0.4~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=921a0bd6baf92fd83889c11b60d7275c59b61ab2;p=thirdparty%2Fdovecot%2Fcore.git imap: Give better error message for "Unknown namespace" --- 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; }