From: Timo Sirainen Date: Fri, 18 Nov 2022 11:15:37 +0000 (+0200) Subject: global: Get settings via settings parser where possible X-Git-Tag: 2.4.0~3346 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83530a557606ef0f302900e55fe634620f6d97ad;p=thirdparty%2Fdovecot%2Fcore.git global: Get settings via settings parser where possible This will be required in the later commits. --- diff --git a/src/imap-urlauth/imap-urlauth-worker.c b/src/imap-urlauth/imap-urlauth-worker.c index 701cefd78a..5124fe2f4d 100644 --- a/src/imap-urlauth/imap-urlauth-worker.c +++ b/src/imap-urlauth/imap-urlauth-worker.c @@ -588,7 +588,7 @@ client_handle_user_command(struct client *client, const char *cmd, /* drop privileges */ restrict_access_allow_coredumps(TRUE); - set = mail_storage_service_user_get_set(user, + set = settings_parser_get_root_set(mail_user->set_parser, &imap_urlauth_worker_setting_parser_info); if (mail_user_var_expand(mail_user, &imap_urlauth_worker_setting_parser_info, set, &error) <= 0) { diff --git a/src/imap/main.c b/src/imap/main.c index da50d7db0d..3086b7096d 100644 --- a/src/imap/main.c +++ b/src/imap/main.c @@ -278,9 +278,9 @@ int client_create_from_input(const struct mail_storage_service_input *input, restrict_access_allow_coredumps(TRUE); - smtp_set = mail_storage_service_user_get_set(user, + smtp_set = settings_parser_get_root_set(mail_user->set_parser, &smtp_submit_setting_parser_info); - imap_set = mail_storage_service_user_get_set(user, + imap_set = settings_parser_get_root_set(mail_user->set_parser, &imap_setting_parser_info); if (imap_set->verbose_proctitle) verbose_proctitle = TRUE; diff --git a/src/lda/main.c b/src/lda/main.c index 9a1755ade2..5e76acc5d4 100644 --- a/src/lda/main.c +++ b/src/lda/main.c @@ -283,7 +283,6 @@ lda_do_deliver(struct mail_deliver_context *ctx, bool stderr_rejection) static int lda_deliver(struct mail_deliver_input *dinput, - struct mail_storage_service_user *service_user, const char *user, const char *path, struct smtp_address *rcpt_to, const char *rcpt_to_source, bool stderr_rejection) @@ -294,10 +293,10 @@ lda_deliver(struct mail_deliver_input *dinput, const char *errstr; int ret; - smtp_set = mail_storage_service_user_get_set(service_user, - &smtp_submit_setting_parser_info); - lda_set = mail_storage_service_user_get_set(service_user, - &lda_setting_parser_info); + lda_set = settings_parser_get_root_set(dinput->rcpt_user->set_parser, + &lda_setting_parser_info); + smtp_set = settings_parser_get_root_set(dinput->rcpt_user->set_parser, + &smtp_submit_setting_parser_info); ret = mail_user_var_expand(dinput->rcpt_user, &lda_setting_parser_info, lda_set, &errstr); if (ret > 0) { @@ -572,7 +571,7 @@ int main(int argc, char *argv[]) mail_from_error); } - ret = lda_deliver(&dinput, service_user, user, path, + ret = lda_deliver(&dinput, user, path, rcpt_to, rcpt_to_source, stderr_rejection); struct mailbox_transaction_context *t = diff --git a/src/lmtp/lmtp-local.c b/src/lmtp/lmtp-local.c index d2d0c8bc88..ca3c5e5727 100644 --- a/src/lmtp/lmtp-local.c +++ b/src/lmtp/lmtp-local.c @@ -468,9 +468,9 @@ lmtp_local_deliver(struct lmtp_local *local, } local->rcpt_user = rcpt_user; - smtp_set = mail_storage_service_user_get_set(service_user, + smtp_set = settings_parser_get_root_set(rcpt_user->set_parser, &smtp_submit_setting_parser_info); - lda_set = mail_storage_service_user_get_set(service_user, + lda_set = settings_parser_get_root_set(rcpt_user->set_parser, &lda_setting_parser_info); ret = mail_user_var_expand(rcpt_user, &smtp_submit_setting_parser_info, smtp_set, &error); diff --git a/src/pop3/main.c b/src/pop3/main.c index 8592fd3ed8..56ff186262 100644 --- a/src/pop3/main.c +++ b/src/pop3/main.c @@ -148,7 +148,7 @@ client_create_from_input(const struct mail_storage_service_input *input, } restrict_access_allow_coredumps(TRUE); - set = mail_storage_service_user_get_set(user, + set = settings_parser_get_root_set(mail_user->set_parser, &pop3_setting_parser_info); if (set->verbose_proctitle) verbose_proctitle = TRUE; diff --git a/src/submission/main.c b/src/submission/main.c index 54f4b6f5d1..9426c92d71 100644 --- a/src/submission/main.c +++ b/src/submission/main.c @@ -192,7 +192,7 @@ client_create_from_input(const struct mail_storage_service_input *input, restrict_access_allow_coredumps(TRUE); - set = mail_storage_service_user_get_set(user, + set = settings_parser_get_root_set(mail_user->set_parser, &submission_setting_parser_info); if (set->verbose_proctitle) verbose_proctitle = TRUE;