From: Timo Sirainen Date: Wed, 8 Mar 2023 13:26:55 +0000 (+0200) Subject: global: Replace mail_storage_service_user_set_setting() calls with master_service_set() X-Git-Tag: 2.4.0~2252 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc62f2b31583f2c43884269ad28b0e9c8dd5cbf4;p=thirdparty%2Fdovecot%2Fcore.git global: Replace mail_storage_service_user_set_setting() calls with master_service_set() --- diff --git a/src/doveadm/doveadm-dsync.c b/src/doveadm/doveadm-dsync.c index d81280cd8a..2a7ad1c897 100644 --- a/src/doveadm/doveadm-dsync.c +++ b/src/doveadm/doveadm-dsync.c @@ -466,9 +466,9 @@ cmd_dsync_run_local(struct dsync_cmd_context *ctx, struct mail_user *user, /* update mail_location and create another user for the second location. */ - if (mail_storage_service_user_set_setting(ctx->ctx.cur_service_user, - "mail_location", location, - &error) <= 0) + struct setting_parser_context *set_parser = + mail_storage_service_user_get_settings_parser(ctx->ctx.cur_service_user); + if (master_service_set(set_parser, "mail_location", location, &error) <= 0) i_unreached(); ret = mail_storage_service_next(ctx->ctx.storage_service, ctx->ctx.cur_service_user, diff --git a/src/doveadm/doveadm-mail.c b/src/doveadm/doveadm-mail.c index b08bbf069d..6ceb262f95 100644 --- a/src/doveadm/doveadm-mail.c +++ b/src/doveadm/doveadm-mail.c @@ -13,6 +13,7 @@ #include "module-dir.h" #include "wildcard-match.h" #include "master-service.h" +#include "master-service-settings.h" #include "mail-user.h" #include "mail-namespace.h" #include "mail-storage.h" @@ -330,10 +331,10 @@ static int cmd_force_resync_prerun(struct doveadm_mail_cmd_context *ctx ATTR_UNU struct mail_storage_service_user *service_user, const char **error_r) { - if (mail_storage_service_user_set_setting(service_user, - "mailbox_list_index_very_dirty_syncs", - "no", - error_r) <= 0) + struct setting_parser_context *set_parser = + mail_storage_service_user_get_settings_parser(service_user); + if (master_service_set(set_parser, "mailbox_list_index_very_dirty_syncs", + "no", error_r) <= 0) i_unreached(); return 0; } diff --git a/src/lib-storage/mail-storage-service.c b/src/lib-storage/mail-storage-service.c index cce1b32ab0..02fb848087 100644 --- a/src/lib-storage/mail-storage-service.c +++ b/src/lib-storage/mail-storage-service.c @@ -107,7 +107,7 @@ static void set_keyval(struct mail_storage_service_user *user, return; } - if (mail_storage_service_user_set_setting(user, key, value, &error) < 0) + if (master_service_set(user->set_parser, key, value, &error) < 0) i_fatal("Invalid userdb input %s=%s: %s", key, value, error); } @@ -156,7 +156,7 @@ static int set_keyvalue(struct mail_storage_service_ctx *ctx, value = t_strconcat(*strp, append_value, NULL); } - ret = mail_storage_service_user_set_setting(user, key, value, error_r); + ret = master_service_set(user->set_parser, key, value, error_r); if (ret < 0) return -1; if (strstr(key, "pass") != NULL) { @@ -1322,7 +1322,7 @@ mail_storage_service_lookup_real(struct mail_storage_service_ctx *ctx, var_expand_ctx.user = user; if ((flags & MAIL_STORAGE_SERVICE_FLAG_DEBUG) != 0) { - if (mail_storage_service_user_set_setting(user, "mail_debug", "yes", &error) <= 0) + if (master_service_set(user->set_parser, "mail_debug", "yes", &error) <= 0) i_unreached(); } @@ -1351,7 +1351,7 @@ mail_storage_service_lookup_real(struct mail_storage_service_ctx *ctx, fine that extra plugins are loaded - we'll just need to prevent any of their hooks from being called. One easy way to do this is just to clear out the mail_plugins setting: */ - if (mail_storage_service_user_set_setting(user, "mail_plugins", "", &error) <= 0) + if (master_service_set(user->set_parser, "mail_plugins", "", &error) <= 0) i_unreached(); } if (ret > 0) { diff --git a/src/lmtp/lmtp-local.c b/src/lmtp/lmtp-local.c index 30337d0f6a..e5a1df5a2c 100644 --- a/src/lmtp/lmtp-local.c +++ b/src/lmtp/lmtp-local.c @@ -464,11 +464,13 @@ lmtp_local_deliver(struct lmtp_local *local, advertised that it's going to timeout the connection. this avoids duplicate deliveries in case the delivery succeeds after the proxy has already disconnected from us. */ + struct setting_parser_context *set_parser = + mail_storage_service_user_get_settings_parser(service_user); const char *value = t_strdup_printf("%us", proxy_data.timeout_secs <= 1 ? 1 : proxy_data.timeout_secs-1); - if (mail_storage_service_user_set_setting(service_user, - "mail_max_lock_timeout", value, &error) <= 0) + if (master_service_set(set_parser, "mail_max_lock_timeout", + value, &error) <= 0) i_unreached(); } master_service_settings_free(mail_set);