From: Timo Sirainen Date: Fri, 27 Oct 2023 12:41:26 +0000 (+0300) Subject: lib-storage: Replace ALTNOCHECK with mail_alt_check setting X-Git-Tag: 2.4.1~1238 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ffc0de06783ff56b61bd63fd43daeec1cccbb38;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Replace ALTNOCHECK with mail_alt_check setting --- diff --git a/src/lib-storage/index/dbox-common/dbox-storage.c b/src/lib-storage/index/dbox-common/dbox-storage.c index 875d916023..691a9f61ad 100644 --- a/src/lib-storage/index/dbox-common/dbox-storage.c +++ b/src/lib-storage/index/dbox-common/dbox-storage.c @@ -128,7 +128,7 @@ int dbox_storage_create(struct mail_storage *_storage, } } - if (!ns->list->set.alt_dir_nocheck) + if (ns->list->mail_set->mail_alt_check) dbox_verify_alt_path(ns->list, _storage->event); return 0; } diff --git a/src/lib-storage/mail-storage-settings.c b/src/lib-storage/mail-storage-settings.c index 5fbb928172..2cbe2eddb7 100644 --- a/src/lib-storage/mail-storage-settings.c +++ b/src/lib-storage/mail-storage-settings.c @@ -84,6 +84,7 @@ static const struct setting_define mail_storage_setting_defines[] = { DEF(STR_HIDDEN, mailbox_root_directory_name), DEF(STR_HIDDEN, mailbox_subscriptions_filename), DEF(STR, mail_volatile_path), + DEF(BOOL_HIDDEN, mail_alt_check), DEF(BOOL_HIDDEN, mail_full_filesystem_access), DEF(BOOL, maildir_stat_dirs), DEF(BOOL, mail_shared_explicit_inbox), @@ -152,6 +153,7 @@ const struct mail_storage_settings mail_storage_default_settings = { .mailbox_root_directory_name = "", .mailbox_subscriptions_filename = "subscriptions", .mail_volatile_path = "", + .mail_alt_check = TRUE, .mail_full_filesystem_access = FALSE, .maildir_stat_dirs = FALSE, .mail_shared_explicit_inbox = FALSE, @@ -993,6 +995,7 @@ static const size_t mail_storage_2nd_reset_offsets[] = { OFFSET(mailbox_root_directory_name), OFFSET(mailbox_subscriptions_filename), OFFSET(mail_volatile_path), + OFFSET(mail_alt_check), }; static void diff --git a/src/lib-storage/mail-storage-settings.h b/src/lib-storage/mail-storage-settings.h index 81fcf8464a..ddbb635eeb 100644 --- a/src/lib-storage/mail-storage-settings.h +++ b/src/lib-storage/mail-storage-settings.h @@ -64,6 +64,7 @@ struct mail_storage_settings { const char *mailbox_root_directory_name; const char *mailbox_subscriptions_filename; const char *mail_volatile_path; + bool mail_alt_check; bool mail_full_filesystem_access; bool maildir_stat_dirs; bool mail_shared_explicit_inbox; diff --git a/src/lib-storage/mailbox-list.c b/src/lib-storage/mailbox-list.c index 052bc8d114..6da026b928 100644 --- a/src/lib-storage/mailbox-list.c +++ b/src/lib-storage/mailbox-list.c @@ -169,7 +169,6 @@ int mailbox_list_create(struct event *event, struct mail_namespace *ns, list->set.maildir_name = p_strdup(list->pool, set->maildir_name); list->set.alt_dir = p_strdup(list->pool, set->alt_dir); - list->set.alt_dir_nocheck = set->alt_dir_nocheck; list->set.index_control_use_maildir_name = set->index_control_use_maildir_name; @@ -311,10 +310,7 @@ mailbox_list_settings_parse_full(struct mail_user *user, const char *data, dest = &set_r->control_dir; else if (strcmp(key, "ALT") == 0) dest = &set_r->alt_dir; - else if (strcmp(key, "ALTNOCHECK") == 0) { - set_r->alt_dir_nocheck = TRUE; - continue; - } else if (strcmp(key, "DIRNAME") == 0) + else if (strcmp(key, "DIRNAME") == 0) dest = &set_r->maildir_name; else if (strcmp(key, "FULLDIRNAME") == 0) { set_r->index_control_use_maildir_name = TRUE; diff --git a/src/lib-storage/mailbox-list.h b/src/lib-storage/mailbox-list.h index ceda61f672..72f4386621 100644 --- a/src/lib-storage/mailbox-list.h +++ b/src/lib-storage/mailbox-list.h @@ -157,8 +157,6 @@ struct mailbox_list_settings { char vname_escape_char; /* Use UTF-8 mailbox names on filesystem instead of mUTF-7 */ bool utf8:1; - /* Don't check/create the alt-dir symlink. */ - bool alt_dir_nocheck:1; /* Use maildir_name also for index/control directories. This should have been the default since the beginning, but for backwards compatibility it had to be made an option. */