]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Never prevent using '/' in mailbox names with mail_full_filesystem_acces...
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 17 Feb 2018 20:10:17 +0000 (22:10 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 24 Feb 2018 17:33:31 +0000 (19:33 +0200)
It was already allowed with LAYOUT=fs, but not with e.g. LAYOUT=Maildir++.
Now it's possible to use e.g. SELECT /home/shareduser/Maildir/test.box

src/lib-storage/mailbox-list.c

index 45086f8a749873a345dc8344910bebc9a9525d06..5ca7c77d1b0473aa562f4178acd4d95a2a1dfc1a 100644 (file)
@@ -1290,6 +1290,15 @@ mailbox_list_is_valid_fs_name(struct mailbox_list *list, const char *name,
        if (list->mail_set->mail_full_filesystem_access)
                return TRUE;
 
+       /* either the list backend uses '/' as the hierarchy separator or
+          it doesn't use filesystem at all (PROP_NO_ROOT) */
+       if ((list->props & MAILBOX_LIST_PROP_NO_ROOT) == 0 &&
+           mailbox_list_get_hierarchy_sep(list) != '/' &&
+           strchr(name, '/') != NULL) {
+               *error_r = "Name must not have '/' characters";
+               return FALSE;
+       }
+
        /* make sure it's not absolute path */
        if (*name == '/') {
                *error_r = "Begins with '/'";
@@ -1365,15 +1374,6 @@ bool mailbox_list_is_valid_name(struct mailbox_list *list,
                return FALSE;
        }
 
-       /* either the list backend uses '/' as the hierarchy separator or
-          it doesn't use filesystem at all (PROP_NO_ROOT) */
-       if ((list->props & MAILBOX_LIST_PROP_NO_ROOT) == 0 &&
-           mailbox_list_get_hierarchy_sep(list) != '/' &&
-           strchr(name, '/') != NULL) {
-               *error_r = "Name must not have '/' characters";
-               return FALSE;
-       }
-
        return mailbox_list_is_valid_fs_name(list, name, error_r);
 }