Mercurial > dovecot > core-2.2
changeset 5299:937afbbf61b2 HEAD
If trying to create <mailbox><real separator>, give an error instead of
working like <virtual separator>.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 13 Mar 2007 19:18:39 +0200 |
parents | 143c5942e392 |
children | 4df292d2404d |
files | src/imap/cmd-create.c |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/imap/cmd-create.c Tue Mar 13 19:17:09 2007 +0200 +++ b/src/imap/cmd-create.c Tue Mar 13 19:18:39 2007 +0200 @@ -1,11 +1,12 @@ /* Copyright (C) 2002 Timo Sirainen */ #include "common.h" +#include "namespace.h" #include "commands.h" bool cmd_create(struct client_command_context *cmd) { - struct mail_storage *storage; + struct namespace *ns; const char *mailbox, *full_mailbox; bool directory; size_t len; @@ -15,13 +16,12 @@ return FALSE; full_mailbox = mailbox; - storage = client_find_storage(cmd, &mailbox); - if (storage == NULL) + ns = client_find_namespace(cmd, &mailbox); + if (ns == NULL) return TRUE; - len = strlen(mailbox); - if (len == 0 || - mailbox[len-1] != mail_storage_get_hierarchy_sep(storage)) + len = strlen(full_mailbox); + if (len == 0 || full_mailbox[len-1] != ns->sep) directory = FALSE; else { /* name ends with hierarchy separator - client is just @@ -35,8 +35,8 @@ if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE)) return TRUE; - if (mail_storage_mailbox_create(storage, mailbox, directory) < 0) - client_send_storage_error(cmd, storage); + if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0) + client_send_storage_error(cmd, ns->storage); else client_send_tagline(cmd, "OK Create completed."); return TRUE;