Verify the existence of any email address in real-time without ever sending a single message. This high-performance Apify Actor uses a specialized Rust engine to perform deep SMTP handshakes, MX record validation, and provider-specific checks (Gmail, Yahoo, Outlook) with extreme speed and accuracy.
The hello_name, from_email, smtp_timeout, retries and proxy settings have been moved to inside the new verif_method field, which is now the centralized place to configure how each email is verified (categorized by email provider).
Yahoo account recovery via headless (#1364) (6f0f12b)
Reverts
backend: Bring back the sqlxmq-based bulk verification (#1477) (322ad4e), closes #1421
BREAKING CHANGES
The smtp_security field has been removed from the /check_email request.
In /v0/check_email endpoint, the hotmail_verif_method field has been replaced two fields: hotmailb2b_verif_method and hotmailb2c_verif_method
All serializations of "Smtp","Api","Headless" have been converted to lowercase "smtp","api","headless"
We switched to a more commonly-used builder pattern to create an input:
- let mut input = CheckEmailInput::new("someone@gmail.com");
- input.set_from_email("me@mycompany.com");
+ let input = CheckEmailInputBuilder::default()
+ .to_email("someone@gmail.com")
+ .from_email("me@mycompany.com")
+ .build()
+ .unwrap();
let res = check_email(input, &config).await;
The main function, check_email(), now takes a second argument called ReacherConfig. This struct contains configuration such as the webdriver address to listen to for headless email verifications, or an optional Sentry configuration to send error reports to. Previously, these configurations were passed through poorly-documented environment variables; now we make them explicit. When migration, you can pass ReacherConfig::default() which returns sensible default values.
Vercel functions (used by https://app.reacher.email) usually timeout with a 504 error within less than 60s. So we should absolutely make a verification in less time than that.
After some testing, Reacher performs better with this setting:
each SMTP connection times out after 45s, but we don't retry
over this previous setting
each SMTP connection times out after ~20s, but we do retry once (to avoid greylisting in some rare cases)
Changing the default behaviour in this PR.
For Hotmail, Gmail and Yahoo addresses, the *_use_api and *_use_headless parameters have been removed and replaced with a *VerifyMethod, an enum which can take value Api, Headless or Smtp. If using headless, pass a webdriver address to env variable RCH_WEBDRIVER_ADDR.
input.hotmail_use_headless is now a bool instead of a string. Pass the webdriver address as an environment variable RCH_WEBDRIVER_ADDR now.
core:SmtpError::TimeoutError has been removed in favor of the one async-smtp uses, namely std::io::Error with ErrorKind::TimeoutError
The RUST_LOG target has been changed from check-if-email-exists to reacher.
- RUST_LOG=check-if-email-exists=debug cargo run
- RUST_LOG=reacher=debug cargo run
The library's main function check_email's argument CheckEmailInput nows takes a single to_email field, instead of a to_emails: Vec<String>
pub struct CheckEmailInput {
- pub to_emails: Vec<String>,
+ pub to_email: String,
// --snip--
}
This effectively makes the public API more similar to the v0.7.* series. I'm still thinking about how to best verify multiple emails in one SMTP connection, but it most likely will be a new function with a different API. Follow issue #65 for more info.
refactor!: Rename main function to check_email (#319) (bd12b7d), closes #319
Bug Fixes
Rename valid_format to is_valid_syntax (#288) (eae6482)
BREAKING CHANGES
This new version includes an overhaul of the codebase, mainly to prepare the groundwork for the upcoming work on bulk validation. These changes include:
The main function email_exists has been renamed to check_email:
- email_exists(&input).await;
+ check_email(&input).await;
The input EmailInput has been renamed to CheckEmailInput. Its ::new() method, instead of taking a single String, now takes Vec<String>.
The output SingleEmail has been renamed to CheckEmailOutput. The main function check_emails now returns a Vec<CheckEmailOutput>.
The syntax field in CheckEmailOutput is no longer a Result<SyntaxDetails, SyntaxError>, but only SyntaxDetails. Error cases are guaranteed not to happen for syntax validation.
The misc, mx, and smtp fields' signatures stay the same: Result<{Misc,Mx,Smtp}Details, {Misc,Mx,Smtp}Error>. However, the Result is an Err only when an internal error arrives. In case of errors due to user input (e.g. incorrect email inputted), the Default trait has been implemented on {Misc,Mx,Smtp}Details and will be returned. As such, the Skipped variant of error enums has been removed.
{
"input": "foo@bar.baz",
"mx": {
- "error": { "cannot resolve" }
+ "accepts_mail": false, // This is Default
+ "records": [] // This is Default
}
The misc, mx, smtp, syntax modules have been made private.
The field syntax.valid_format has been renamed to syntax.is_valid_syntax.