try to fix some smtp todos and do better error logging

This commit is contained in:
holger krekel
2019-11-03 02:12:29 +01:00
parent a3b90a08b6
commit 1cfeb730c3
3 changed files with 36 additions and 30 deletions

View File

@@ -531,21 +531,26 @@ fn try_smtp_one_param(context: &Context, param: &LoginParam) -> Option<bool> {
param.send_user, param.send_server, param.send_port, param.server_flags
);
info!(context, "Trying: {}", inf);
if context
match context
.smtp
.clone()
.lock()
.unwrap()
.connect(context, &param)
{
info!(context, "success: {}", inf);
return Some(true);
Ok(()) => {
info!(context, "success: {}", inf);
Some(true)
}
Err(err) => {
if context.shall_stop_ongoing() {
Some(false)
} else {
warn!(context, "could not connect: {}", err);
None
}
}
}
if context.shall_stop_ongoing() {
return Some(false);
}
info!(context, "could not connect: {}", inf);
None
}
/*******************************************************************************