]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Maildir++ layout: Allow selecting namespace prefix if inbox=no.
authorTimo Sirainen <tss@iki.fi>
Wed, 15 Apr 2009 23:47:20 +0000 (19:47 -0400)
committerTimo Sirainen <tss@iki.fi>
Wed, 15 Apr 2009 23:47:20 +0000 (19:47 -0400)
With Maildir this allows opening the "mailbox root" (i.e. INBOX).

--HG--
branch : HEAD

src/lib-storage/list/mailbox-list-maildir.c

index 6118c5e79dddb09485ceadbff25e2dab132da304..3c45d177859b19ba3a565435ea157674aac1b574 100644 (file)
@@ -134,6 +134,13 @@ maildir_is_valid_existing_name(struct mailbox_list *list, const char *name)
 {
        size_t len;
 
+       if (*name == '\0' && *list->ns->prefix != '\0' &&
+           (list->ns->flags & NAMESPACE_FLAG_INBOX) == 0) {
+               /* an ugly way to get to Maildir/ root when it's not the
+                  INBOX. */
+               return TRUE;
+       }
+
        if (!maildir_list_is_valid_common(list, name, &len))
                return FALSE;