From 525a3539d2273d10e143bf4be93dfb6e502686cf Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Mon, 15 Dec 2025 09:37:45 +0100 Subject: [PATCH] misc: log entered login params and actual used params on configuration failure (#7610) #7587 removed "used_account_settings" and "entered_account_settings" from Context.get_info(). link2xt pointed out that entered_account_settings can still be useful to debug login issues, so tis pr adds logs both on failed configuration attempts. example warning event: ``` Warning src/configure.rs:292: configure failed: entered params myself@merlinux.eu imap:unset:***:unset:0:Automatic:AUTH_NORMAL smtp:unset:0:unset:0:Automatic:AUTH_NORMAL cert_automatic, used params myself@merlinux.eu imap:[mailcow.testrun.org:993:tls:myself@merlinux.eu, mailcow.testrun.org:143:starttls:myself@merlinux.eu] smtp:[mailcow.testrun.org:465:tls:myself@merlinux.eu, mailcow.testrun.org:587:starttls:myself@merlinux.eu] provider:none cert_automatic ``` --------- Co-authored-by: iequidoo <117991069+iequidoo@users.noreply.github.com> --- src/configure.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/configure.rs b/src/configure.rs index 3e32b7ba5..b0f32392e 100644 --- a/src/configure.rs +++ b/src/configure.rs @@ -285,7 +285,22 @@ impl Context { } } - let provider = configure(self, param).await?; + let provider = match configure(self, param).await { + Err(error) => { + // Log entered and actual params + let configured_param = get_configured_param(self, param).await; + warn!( + self, + "configure failed: Entered params: {}. Used params: {}. Error: {error}.", + param.to_string(), + configured_param + .map(|param| param.to_string()) + .unwrap_or("error".to_owned()) + ); + return Err(error); + } + Ok(provider) => provider, + }; self.set_config_internal(Config::NotifyAboutWrongPw, Some("1")) .await?; on_configure_completed(self, provider).await?;