]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Replace mail_storage_service_user_set_setting() calls with master_service_set()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 8 Mar 2023 13:26:55 +0000 (15:26 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Nov 2023 12:20:55 +0000 (14:20 +0200)
src/doveadm/doveadm-dsync.c
src/doveadm/doveadm-mail.c
src/lib-storage/mail-storage-service.c
src/lmtp/lmtp-local.c

index d81280cd8a759fa27d6ca69247a14d41b84b9188..2a7ad1c89728268d11fe17d43d8b173c10172cd2 100644 (file)
@@ -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,
index b08bbf069da700aa647308c450068336ff6d85a7..6ceb262f9566f476bf6c238e22c6fd47df8f6b37 100644 (file)
@@ -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;
 }
index cce1b32ab03d8b3a50b32f7d18e74cd4236f3306..02fb848087dc21f7ac2654c7810228ca3f24fcd4 100644 (file)
@@ -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) {
index 30337d0f6affaa6060ddf2753a0070336c37547d..e5a1df5a2c8a481bcba0084d194ae637f12a6276 100644 (file)
@@ -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);