From: sergey.kitov Date: Wed, 6 Sep 2023 11:50:31 +0000 (+0300) Subject: lib-storage: change mail_attachment_detection_options to BOOLLIST. X-Git-Tag: 2.4.1~864 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba67c8f883e30cdcc842db10d486d6f7f41c460e;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: change mail_attachment_detection_options to BOOLLIST. --- diff --git a/src/lib-storage/mail-storage-settings.c b/src/lib-storage/mail-storage-settings.c index 1283cd644f..2510d590ad 100644 --- a/src/lib-storage/mail-storage-settings.c +++ b/src/lib-storage/mail-storage-settings.c @@ -38,7 +38,7 @@ static const struct setting_define mail_storage_setting_defines[] = { DEF(STR, mail_ext_attachment_path), DEF(STR_NOVARS_HIDDEN, mail_ext_attachment_hash), DEF(SIZE, mail_ext_attachment_min_size), - DEF(STR, mail_attachment_detection_options), + DEF(BOOLLIST, mail_attachment_detection_options), { .type = SET_FILTER_NAME, .key = "mail_attribute", .required_setting = "dict", }, DEF(UINT, mail_prefetch_count), @@ -121,7 +121,7 @@ const struct mail_storage_settings mail_storage_default_settings = { .mail_ext_attachment_path = "", .mail_ext_attachment_hash = "%{sha1}", .mail_ext_attachment_min_size = 1024*128, - .mail_attachment_detection_options = "", + .mail_attachment_detection_options = ARRAY_INIT, .mail_prefetch_count = 0, .mail_cache_fields = "flags", .mail_always_cache_fields = "", @@ -721,12 +721,12 @@ mail_storage_settings_ext_check(struct event *event ATTR_UNUSED, // FIXME: check set->mail_server_admin syntax (RFC 5464, Section 6.2.2) /* parse mail_attachment_indicator_options */ - if (*set->mail_attachment_detection_options != '\0') { + if (array_not_empty(&set->mail_attachment_detection_options)) { ARRAY_TYPE(const_string) content_types; p_array_init(&content_types, pool, 2); const char *const *options = - t_strsplit_spaces(set->mail_attachment_detection_options, " "); + settings_boollist_get(&set->mail_attachment_detection_options); while(*options != NULL) { const char *opt = *options; diff --git a/src/lib-storage/mail-storage-settings.h b/src/lib-storage/mail-storage-settings.h index 3207108ffa..1255efc950 100644 --- a/src/lib-storage/mail-storage-settings.h +++ b/src/lib-storage/mail-storage-settings.h @@ -88,7 +88,7 @@ struct mail_storage_settings { const char *recipient_delimiter; - const char *mail_attachment_detection_options; + ARRAY_TYPE(const_string) mail_attachment_detection_options; ARRAY_TYPE(const_string) namespaces; ARRAY(const char *) plugin_envs;