From: Timo Sirainen Date: Tue, 7 Feb 2023 22:46:18 +0000 (+0200) Subject: doveadm, lmtp: Use mail_storage_service_user_set_setting() X-Git-Tag: 2.4.0~2255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b063162d00ce4ea8f40c4c6e164c73b8ecf69dbf;p=thirdparty%2Fdovecot%2Fcore.git doveadm, lmtp: Use mail_storage_service_user_set_setting() --- diff --git a/src/doveadm/doveadm-dsync.c b/src/doveadm/doveadm-dsync.c index a4c728fc5b..d81280cd8a 100644 --- a/src/doveadm/doveadm-dsync.c +++ b/src/doveadm/doveadm-dsync.c @@ -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, diff --git a/src/lmtp/lmtp-local.c b/src/lmtp/lmtp-local.c index ecbd89d2f8..30337d0f6a 100644 --- a/src/lmtp/lmtp-local.c +++ b/src/lmtp/lmtp-local.c @@ -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);