]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Give better error message for "Unknown namespace"
authorTimo Sirainen <tss@iki.fi>
Sun, 26 Sep 2010 17:05:25 +0000 (18:05 +0100)
committerTimo Sirainen <tss@iki.fi>
Sun, 26 Sep 2010 17:05:25 +0000 (18:05 +0100)
src/imap/imap-commands-util.c

index 1904e204140ee5c15d590d575a1acc746454661f..5e4bf9b8dd8a92b7a5d5a74647fe734e92802400 100644 (file)
@@ -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;
        }