]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Replace NO-FS-VALIDATION with mailbox_list_validate_fs_names setting
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 26 Oct 2023 09:58:58 +0000 (12:58 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:39:57 +0000 (10:39 +0200)
src/lib-storage/mail-storage-settings.c
src/lib-storage/mail-storage-settings.h
src/lib-storage/mailbox-list.c
src/lib-storage/mailbox-list.h

index 779110ec4346c4247e982b22ceb7b905033de295..fb7d063b6f0d47e7e6fa95df4dd12794bc449747 100644 (file)
@@ -76,6 +76,7 @@ static const struct setting_define mail_storage_setting_defines[] = {
        DEF(BOOL, mailbox_list_index),
        DEF(BOOL, mailbox_list_index_very_dirty_syncs),
        DEF(BOOL, mailbox_list_index_include_inbox),
+       DEF(BOOL_HIDDEN, mailbox_list_validate_fs_names),
        DEF(BOOL_HIDDEN, mail_full_filesystem_access),
        DEF(BOOL, maildir_stat_dirs),
        DEF(BOOL, mail_shared_explicit_inbox),
@@ -136,6 +137,7 @@ const struct mail_storage_settings mail_storage_default_settings = {
        .mailbox_list_index = TRUE,
        .mailbox_list_index_very_dirty_syncs = FALSE,
        .mailbox_list_index_include_inbox = FALSE,
+       .mailbox_list_validate_fs_names = TRUE,
        .mail_full_filesystem_access = FALSE,
        .maildir_stat_dirs = FALSE,
        .mail_shared_explicit_inbox = FALSE,
index f8d65b31323c97083e89b0354730627af4e2081e..91d6948be6b8880dfe660aff696c0009b0beaf7b 100644 (file)
@@ -55,6 +55,7 @@ struct mail_storage_settings {
        bool mailbox_list_index;
        bool mailbox_list_index_very_dirty_syncs;
        bool mailbox_list_index_include_inbox;
+       bool mailbox_list_validate_fs_names;
        bool mail_full_filesystem_access;
        bool maildir_stat_dirs;
        bool mail_shared_explicit_inbox;
index 7f67d80f3d1cc86e2cc232c3265fe19ea6079dcb..0aacf5b18e3a10ba6c460eed3264732b5d7bb2da 100644 (file)
@@ -191,7 +191,6 @@ int mailbox_list_create(const char *driver, struct event *event,
                set->index_control_use_maildir_name;
        list->set.iter_from_index_dir = set->iter_from_index_dir;
        list->set.keep_noselect = set->keep_noselect;
-       list->set.no_fs_validation = set->no_fs_validation;
 
        if (*set->mailbox_dir_name == '\0')
                list->set.mailbox_dir_name = "";
@@ -377,9 +376,6 @@ mailbox_list_settings_parse_full(struct mail_user *user, const char *data,
                        /* retained only for backward compatibility */
                        set_r->keep_noselect = FALSE;
                        continue;
-               } else if (strcmp(key, "NO-FS-VALIDATION") == 0) {
-                       set_r->no_fs_validation = TRUE;
-                       continue;
                } else {
                        *error_r = t_strdup_printf("Unknown setting: %s", key);
                        return -1;
@@ -1309,7 +1305,7 @@ mailbox_list_is_valid_fs_name(struct mailbox_list *list, const char *name,
        *error_r = NULL;
 
        if (list->mail_set->mail_full_filesystem_access ||
-           list->set.no_fs_validation)
+           !list->mail_set->mailbox_list_validate_fs_names)
                return TRUE;
 
        /* either the list backend uses '/' as the hierarchy separator or
index 1eb7bed6790a2fb9676872508a839b98253aa312..1a2b2aafbfe888067b93ad69d951fda2def8650a 100644 (file)
@@ -182,8 +182,6 @@ struct mailbox_list_settings {
        bool iter_from_index_dir:1;
        /* Control creation and listing of \NoSelect mailboxes. */
        bool keep_noselect:1;
-       /* Do not validate names as fs names (allows weird names) */
-       bool no_fs_validation:1;
 };
 
 struct mailbox_permissions {