Skip to content

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

fix!(core): Bump timeout to 45s, set retries to 1 (#1406)

Amaury22e8e3e86ce9
diff --git a/core/src/rules.json b/core/src/rules.json
index bc7e9110..89150b6d 100644
--- a/core/src/rules.json
+++ b/core/src/rules.json
@@ -8,7 +8,11 @@
"yahoo.fr": { "rules": ["SkipCatchAll"] }
},
"by_mx": {
- "filter30.antispamcloud.com.": { "rules": ["HoneyPot"] }
+ "filter30.antispamcloud.com.": { "rules": ["HoneyPot"] },
+ "futuresinitiative.org.": { "rules": ["SmtpTimeout45s"] },
+ "mail.digimarcon.com.": { "rules": ["SmtpTimeout45s"] },
+ "mail.glasasoftball.org.": { "rules": ["SmtpTimeout45s"] },
+ "nosotrosorg.com.": { "rules": ["SmtpTimeout45s"] }
},
"by_mx_suffix": {
".antispamcloud.com.": {
@@ -19,7 +23,7 @@
"rules": {
"SkipCatchAll": { "_comment": "Don't perform catch-all check" },
"SmtpTimeout45s": {
- "_comment": "Set SMTP connection timeout to at least 45s. If the user request set an even higher timeout, take that one. Please note that this timeout is **per SMTP connection**. By default, we try 2 connections per email: if the 1st one failed, then we connect again to avoid potential greylisting, in which case the whole verification takes 1min30s."
+ "_comment": "Set SMTP connection timeout to at least 45s. If the user request set an even higher timeout, take that one. Please note that this timeout is **per SMTP connection**. We might try 2 connections per email: if the 1st one failed, then we connect again to avoid potential greylisting, in which case the whole verification takes 1min30s."
}
}
}
diff --git a/core/src/util/input_output.rs b/core/src/util/input_output.rs
index a6c2c9bb..c00c1df3 100644
--- a/core/src/util/input_output.rs
+++ b/core/src/util/input_output.rs
@@ -182,7 +182,7 @@ pub struct CheckEmailInput {
/// Add timeout for the SMTP verification step. Set to None if you don't
/// want to use a timeout.
///
- /// Defaults to 12s (more than 10s, but when run twice less than 30s).
+ /// Defaults to 30s.
pub smtp_timeout: Option<Duration>,
/// Select how to verify Yahoo emails.
///
@@ -203,9 +203,10 @@ pub struct CheckEmailInput {
/// Check if a the email address is present in HaveIBeenPwned API.
// If the api_key is filled, HaveIBeenPwned API is checked
pub haveibeenpwned_api_key: Option<String>,
- /// Number of retries of SMTP connections to do.
+ /// Number of retries of SMTP connections to do. Setting to 2 might bypass
+ /// greylisting on some servers, but takes more time.
///
- /// Defaults to 2 to avoid greylisting.
+ /// Defaults to 1.
pub retries: usize,
/// How to apply TLS to a SMTP client connection.
///
@@ -241,7 +242,7 @@ impl Default for CheckEmailInput {
proxy: None,
smtp_port: 25,
smtp_security: SmtpSecurity::default(),
- smtp_timeout: Some(Duration::from_secs(12)),
+ smtp_timeout: Some(Duration::from_secs(45)),
#[cfg(not(feature = "headless"))]
yahoo_verif_method: YahooVerifMethod::Api,
#[cfg(feature = "headless")]
@@ -253,7 +254,7 @@ impl Default for CheckEmailInput {
hotmail_verif_method: HotmailVerifMethod::Headless,
check_gravatar: false,
haveibeenpwned_api_key: None,
- retries: 2,
+ retries: 1,
skipped_domains: vec![],
}
}