]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
IMAP: Treat "namespace prefix/" as invalid mailbox name.
authorTimo Sirainen <tss@iki.fi>
Fri, 3 Jun 2011 13:33:43 +0000 (16:33 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 3 Jun 2011 13:33:43 +0000 (16:33 +0300)
src/imap/imap-commands-util.c

index 4a8f29e56f3255972dc901e314a7567eccef3190..a16aebc2897fb58198ac4fde29c66a6bbda92010 100644 (file)
@@ -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. */