From c3508e9595be50ab119e4141db3de2636637d664 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Thu, 31 Jul 2025 09:27:58 +0300 Subject: [PATCH] login-common: Reload client settings before proxying This allows expanding settings that need username. --- src/login-common/client-common-auth.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/login-common/client-common-auth.c b/src/login-common/client-common-auth.c index 3043e14482..3d9d6530bd 100644 --- a/src/login-common/client-common-auth.c +++ b/src/login-common/client-common-auth.c @@ -745,6 +745,8 @@ static bool client_auth_handle_reply(struct client *client, const struct client_auth_reply *reply, bool success) { + const char *error; + if (array_count(&reply->alt_usernames) > 0) { const char **alt; @@ -755,6 +757,15 @@ client_auth_handle_reply(struct client *client, client->alt_usernames = alt; } + /* Refresh client settings to get mail user variable expanded. */ + if (success && client_settings_reload(client, &error) < 0) { + e_error(client->event, "%s", error); + client_auth_result(client, CLIENT_AUTH_RESULT_TEMPFAIL, reply, + AUTH_TEMP_FAILED_MSG); + client_auth_failed(client); + return TRUE; + } + if (reply->proxy.proxy) { /* we want to proxy the connection to another server. don't do this unless authentication succeeded. with -- 2.47.3