From: Timo Sirainen Date: Fri, 3 Jun 2011 13:33:43 +0000 (+0300) Subject: IMAP: Treat "namespace prefix/" as invalid mailbox name. X-Git-Tag: 2.0.14~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4e30ea56df01b237844eb42e71c7bf66294081c;p=thirdparty%2Fdovecot%2Fcore.git IMAP: Treat "namespace prefix/" as invalid mailbox name. --- diff --git a/src/imap/imap-commands-util.c b/src/imap/imap-commands-util.c index 4a8f29e56f..a16aebc289 100644 --- a/src/imap/imap-commands-util.c +++ b/src/imap/imap-commands-util.c @@ -59,6 +59,11 @@ client_find_namespace(struct client_command_context *cmd, const char *mailbox, storage_name = t_strndup(storage_name, storage_name_len-1); } + if (strcmp(mailbox, ns->prefix) == 0) { + client_send_tagline(cmd, "NO Invalid mailbox name."); + return NULL; + } + if (ns->real_sep != ns->sep && ns->prefix_len < strlen(mailbox)) { /* make sure there are no real separators used in the mailbox name. */