Skip to content

Commit

Permalink
fix: Only do headless for non-365 hotmail emails
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Sep 17, 2024
1 parent ec48fec commit 1c52bdc
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions core/src/smtp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,35 +114,37 @@ pub async fn check_smtp(
let webdriver_addr = env::var("RCH_WEBDRIVER_ADDR");

if is_hotmail(&host) {
match (&input.hotmail_verif_method, webdriver_addr) {
(HotmailVerifMethod::OneDriveApi, _) => {
if is_microsoft365(&host) {
match outlook::microsoft365::check_microsoft365_api(to_email, input).await {
Ok(Some(smtp_details)) => {
return {
(
Ok(smtp_details),
SmtpDebug {
verif_method: VerifMethod::Api,
},
)
}
}
// Continue in the event of an error/ambiguous result.
Err(err) => {
return (
Err(err.into()),
match (
&input.hotmail_verif_method,
webdriver_addr,
is_microsoft365(&host),
) {
(HotmailVerifMethod::OneDriveApi, _, true) => {
match outlook::microsoft365::check_microsoft365_api(to_email, input).await {
Ok(Some(smtp_details)) => {
return {
(
Ok(smtp_details),
SmtpDebug {
verif_method: VerifMethod::Api,
},
);
)
}
_ => {}
}
// Continue in the event of an error/ambiguous result.
Err(err) => {
return (
Err(err.into()),
SmtpDebug {
verif_method: VerifMethod::Api,
},
);
}
_ => {}
}
}
#[cfg(feature = "headless")]
(HotmailVerifMethod::Headless, Ok(a)) => {
(HotmailVerifMethod::Headless, Ok(a), false) => {
return (
outlook::headless::check_password_recovery(to_email.to_string().as_str(), &a)
.await
Expand Down

0 comments on commit 1c52bdc

Please sign in to comment.