# HG changeset patch # User Timo Sirainen # Date 1041510937 -7200 # Node ID 986e89b615202226ebf72e4257e55fedba0faece # Parent 06776a31f50c31eeed6c51b448e42ebe815694c8 CREATE mailbox failed always. diff -r 06776a31f50c -r 986e89b61520 src/imap/cmd-create.c --- a/src/imap/cmd-create.c Thu Jan 02 14:20:46 2003 +0200 +++ b/src/imap/cmd-create.c Thu Jan 02 14:35:37 2003 +0200 @@ -6,19 +6,26 @@ int cmd_create(Client *client) { const char *mailbox; + int ignore; /* */ if (!client_read_string_args(client, 1, &mailbox)) return FALSE; - if (!client_verify_mailbox_name(client, mailbox, FALSE, TRUE)) + ignore = mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep; + if (ignore) { + /* name ends with hierarchy separator - client is just + informing us that it wants to create a mailbox under + this name. we don't need that information, but verify + that the mailbox name is valid */ + mailbox = t_strndup(mailbox, strlen(mailbox)-1); + } + + if (!client_verify_mailbox_name(client, mailbox, FALSE, !ignore)) return TRUE; - if (mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep) { - /* name ends with hierarchy separator - client is just - informing us that it wants to create a mailbox under - this name. we don't need that information. */ - } else if (!client->storage->create_mailbox(client->storage, mailbox)) { + if (!ignore && + !client->storage->create_mailbox(client->storage, mailbox)) { client_send_storage_error(client); return TRUE; }