]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Remove SSL settings from mail_storage_settings
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 29 Jul 2021 15:04:53 +0000 (18:04 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 10 Aug 2021 09:35:01 +0000 (11:35 +0200)
They can be accessed via master_service_ssl_settings instead.

src/lib-master/master-service-ssl-settings.c
src/lib-storage/mail-storage-settings.c
src/lib-storage/mail-storage-settings.h

index c677defa9d257f2c623c879dd69f17decfdefa55..5ddf18cc8a4d9cb41c87087cc7c16138730c3f56 100644 (file)
@@ -44,7 +44,6 @@ static const struct master_service_ssl_settings master_service_ssl_default_setti
 #else
        .ssl = "no:yes:required",
 #endif
-       /* keep synced with mail-storage-settings */
        .ssl_ca = "",
        .ssl_client_ca_file = "",
        .ssl_client_ca_dir = "",
index c9e5ce9c415cf3597b30b6f6f8c7eeb98861e899..35c3821316a894c0cd72d9a952f3e2652a3c514b 100644 (file)
@@ -83,18 +83,6 @@ static const struct setting_define mail_storage_setting_defines[] = {
        DEF(STR, hostname),
        DEF(STR, recipient_delimiter),
 
-       DEF(STR, ssl_client_ca_file),
-       DEF(STR, ssl_client_ca_dir),
-       DEF(STR, ssl_client_cert),
-       DEF(STR, ssl_client_key),
-       DEF(STR, ssl_cipher_list),
-       DEF(STR, ssl_cipher_suites),
-       DEF(STR, ssl_curve_list),
-       DEF(STR, ssl_min_protocol),
-       DEF(STR, ssl_crypto_device),
-       DEF(BOOL, ssl_client_require_valid_cert),
-       DEF(BOOL, verbose_ssl),
-
        SETTING_DEFINE_LIST_END
 };
 
@@ -150,19 +138,6 @@ const struct mail_storage_settings mail_storage_default_settings = {
 
        .hostname = "",
        .recipient_delimiter = "+",
-
-       /* Keep synced with master-service-ssl-settings */
-       .ssl_client_ca_file = "",
-       .ssl_client_ca_dir = "",
-       .ssl_client_cert = "",
-       .ssl_client_key = "",
-       .ssl_cipher_list = "ALL:!kRSA:!SRP:!kDHd:!DSS:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK:!RC4:!ADH:!LOW@STRENGTH",
-       .ssl_cipher_suites = "", /* Use TLS library provided value */
-       .ssl_curve_list = "",
-       .ssl_min_protocol = "TLSv1.2",
-       .ssl_crypto_device = "",
-       .ssl_client_require_valid_cert = TRUE,
-       .verbose_ssl = FALSE,
 };
 
 const struct setting_parser_info mail_storage_setting_parser_info = {
@@ -549,15 +524,6 @@ static bool mail_storage_settings_check(void *_set, pool_t pool,
                return FALSE;
        }
        hash_format_deinit_free(&format);
-#ifndef CONFIG_BINARY
-       if (*set->ssl_client_ca_dir != '\0' &&
-           access(set->ssl_client_ca_dir, X_OK) < 0) {
-               *error_r = t_strdup_printf(
-                       "ssl_client_ca_dir: access(%s) failed: %m",
-                       set->ssl_client_ca_dir);
-               return FALSE;
-       }
-#endif
 
        // FIXME: check set->mail_server_admin syntax (RFC 5464, Section 6.2.2)
 
@@ -841,26 +807,3 @@ bool mail_user_set_get_postmaster_smtp(const struct mail_user_settings *set,
        get_postmaster_address_error(set, error_r);
        return FALSE;
 }
-
-void mail_storage_settings_init_ssl_client_settings(const struct mail_storage_settings *mail_set,
-                                                   struct ssl_iostream_settings *ssl_set_r)
-{
-       i_zero(ssl_set_r);
-       if (*mail_set->ssl_client_ca_dir != '\0')
-               ssl_set_r->ca_dir = mail_set->ssl_client_ca_dir;
-       if (*mail_set->ssl_client_ca_file != '\0')
-               ssl_set_r->ca_file = mail_set->ssl_client_ca_file;
-       if (*mail_set->ssl_client_cert != '\0')
-               ssl_set_r->cert.cert = mail_set->ssl_client_cert;
-       if (*mail_set->ssl_client_key != '\0')
-               ssl_set_r->cert.key = mail_set->ssl_client_key;
-       ssl_set_r->cipher_list = mail_set->ssl_cipher_list;
-       if (*mail_set->ssl_cipher_suites != '\0')
-               ssl_set_r->ciphersuites = mail_set->ssl_cipher_suites;
-       ssl_set_r->curve_list = mail_set->ssl_curve_list;
-       ssl_set_r->min_protocol = mail_set->ssl_min_protocol;
-       ssl_set_r->crypto_device = mail_set->ssl_crypto_device;
-       ssl_set_r->verify_remote_cert = mail_set->ssl_client_require_valid_cert;
-       ssl_set_r->allow_invalid_cert = !ssl_set_r->verify_remote_cert;
-       ssl_set_r->verbose = mail_set->verbose_ssl;
-}
index 66e578d948979232483a0c4c7f024d86e269938f..9dc8f5d82c1c7639dce04f42a6cd712949f2d3e3 100644 (file)
@@ -64,17 +64,6 @@ struct mail_storage_settings {
        const char *hostname;
        const char *recipient_delimiter;
 
-       const char *ssl_client_ca_file;
-       const char *ssl_client_ca_dir;
-       const char *ssl_client_cert;
-       const char *ssl_client_key;
-       const char *ssl_cipher_list;
-       const char *ssl_cipher_suites;
-       const char *ssl_curve_list;
-       const char *ssl_min_protocol;
-       const char *ssl_crypto_device;
-       bool ssl_client_require_valid_cert;
-       bool verbose_ssl;
        const char *mail_attachment_detection_options;
 
        enum file_lock_method parsed_lock_method;
@@ -183,7 +172,4 @@ bool mail_user_set_get_postmaster_smtp(const struct mail_user_settings *set,
                                       const struct smtp_address **address_r,
                                       const char **error_r);
 
-void mail_storage_settings_init_ssl_client_settings(const struct mail_storage_settings *mail_set,
-                                                   struct ssl_iostream_settings *ssl_set_r);
-
 #endif