]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm, lmtp: Use mail_storage_service_user_set_setting()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 7 Feb 2023 22:46:18 +0000 (00:46 +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/lmtp/lmtp-local.c

index a4c728fc5b451be3d98d4b8f3fb9c01427f0a0cb..d81280cd8a759fa27d6ca69247a14d41b84b9188 100644 (file)
@@ -448,7 +448,6 @@ cmd_dsync_run_local(struct dsync_cmd_context *ctx, struct mail_user *user,
        struct dsync_brain *brain2;
        struct mail_user *user2;
        struct mail_namespace *ns, *ns2;
-       struct setting_parser_context *set_parser;
        const char *location, *error;
        bool brain1_running, brain2_running, changed1, changed2;
        bool remote_only_changes;
@@ -467,8 +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. */
-       set_parser = mail_storage_service_user_get_settings_parser(ctx->ctx.cur_service_user);
-       if (settings_parse_keyvalue(set_parser, "mail_location", location) < 0)
+       if (mail_storage_service_user_set_setting(ctx->ctx.cur_service_user,
+                                                 "mail_location", location,
+                                                 &error) <= 0)
                i_unreached();
        ret = mail_storage_service_next(ctx->ctx.storage_service,
                                        ctx->ctx.cur_service_user,
index ecbd89d2f88a44f6a4d778ee271c4d9e9b530abe..30337d0f6affaa6060ddf2753a0070336c37547d 100644 (file)
@@ -438,7 +438,7 @@ lmtp_local_deliver(struct lmtp_local *local,
        struct smtp_proxy_data proxy_data;
        struct mail_namespace *ns;
        struct setting_parser_context *set_parser;
-       const char *line, *error, *username;
+       const char *error, *username;
        int ret;
 
        input = mail_storage_service_user_get_input(service_user);
@@ -464,10 +464,11 @@ 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. */
-               line = t_strdup_printf("mail_max_lock_timeout=%us",
+               const char *value = t_strdup_printf("%us",
                                       proxy_data.timeout_secs <= 1 ? 1 :
                                       proxy_data.timeout_secs-1);
-               if (settings_parse_line(set_parser, line) < 0)
+               if (mail_storage_service_user_set_setting(service_user,
+                               "mail_max_lock_timeout", value, &error) <= 0)
                        i_unreached();
        }
        master_service_settings_free(mail_set);