Skip to content

Check if an email address exists without sending any email, written in Rust. Comes with a ⚙️ HTTP backend.

fix(core): Fix hotmail/outlook checks

Amaury5e4bf16e75e0
diff --git a/core/src/smtp/outlook/mod.rs b/core/src/smtp/outlook/mod.rs
index 3c8c9c07..9bcb209f 100644
--- a/core/src/smtp/outlook/mod.rs
+++ b/core/src/smtp/outlook/mod.rs
@@ -4,9 +4,12 @@ pub mod microsoft365;
/// Check if a MX host is from outlook (includes @hotmail.*, @outlook.* and
/// all Microsoft 365 addresses).
+///
+/// After some testing I got:
+/// - @outlook.* and @hotmail.* -> end with ".olc.protection.outlook.com."
+/// - Microsoft 365 emails -> end with ".mail.protection.outlook.com."
pub fn is_outlook(host: &str) -> bool {
- host.to_lowercase()
- .ends_with(".mail.protection.outlook.com.")
+ host.to_lowercase().ends_with(".protection.outlook.com.")
}
/// Check if a MX host is an @hotmail.* or @outlook.* email.
@@ -18,8 +21,10 @@ pub fn is_outlook(host: &str) -> bool {
/// - *@hotmail.fr -> `eur.olc.protection.outlook.com.`
/// - *@hotmail.nl -> `eur.olc.protection.outlook.com.`
///
+/// But Microsoft 365 addresses end with "mail.protection.outlook.com."
+///
/// So it seems that outlook/hotmail addresses end with `olc.protection.outlook.com.`
pub fn is_hotmail(host: &str) -> bool {
host.to_lowercase()
- .ends_with(".mail.protection.outlook.com.")
+ .ends_with(".olc.protection.outlook.com.")
}