refactor: improve logging during SMTP/IMAP configuration

This commit is contained in:
link2xt
2024-06-27 14:58:54 +00:00
parent c400491c07
commit ced5f51482

View File

@@ -625,14 +625,14 @@ async fn try_imap_one_param(
match imap.connect(context).await { match imap.connect(context).await {
Err(err) => { Err(err) => {
info!(context, "failure: {:#}", err); info!(context, "IMAP failure: {err:#}.");
Err(ConfigurationError { Err(ConfigurationError {
config: inf, config: inf,
msg: format!("{err:#}"), msg: format!("{err:#}"),
}) })
} }
Ok(session) => { Ok(session) => {
info!(context, "success: {}", inf); info!(context, "IMAP success: {inf}.");
Ok((imap, session)) Ok((imap, session))
} }
} }
@@ -666,13 +666,13 @@ async fn try_smtp_one_param(
.connect(context, param, socks5_config, addr, provider_strict_tls) .connect(context, param, socks5_config, addr, provider_strict_tls)
.await .await
{ {
info!(context, "failure: {}", err); info!(context, "SMTP failure: {err:#}.");
Err(ConfigurationError { Err(ConfigurationError {
config: inf, config: inf,
msg: format!("{err:#}"), msg: format!("{err:#}"),
}) })
} else { } else {
info!(context, "success: {}", inf); info!(context, "SMTP success: {inf}.");
smtp.disconnect(); smtp.disconnect();
Ok(()) Ok(())
} }