Check if an email address exists without sending any email, written in Rust. Comes with a ⚙️ HTTP backend.
Rust emailemail-validationemail-validation-apiemail-verificationemail-verification-apiemail-verifierhacktoberfest
revert: "Show thread ID in logs (#1579)"
Amaury56e7838f2806
diff --git a/Cargo.lock b/Cargo.lockindex 43318f47..91bcdd1d 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -601,7 +601,7 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"[[package]]name = "check-if-email-exists"-version = "0.11.2"+version = "0.11.0"dependencies = ["anyhow","async-recursion",@@ -633,7 +633,7 @@ dependencies = [[[package]]name = "check-if-email-exists-cli"-version = "0.11.2"+version = "0.11.0"dependencies = ["anyhow","check-if-email-exists",@@ -3062,7 +3062,7 @@ dependencies = [[[package]]name = "reacher_backend"-version = "0.11.2"+version = "0.11.0"dependencies = ["anyhow","async-smtp",@@ -3095,7 +3095,7 @@ dependencies = [[[package]]name = "reacher_sqs"-version = "0.11.2"+version = "0.11.0"dependencies = ["check-if-email-exists","lambda_runtime",diff --git a/backend/Cargo.toml b/backend/Cargo.tomlindex 0c8aa5c1..d6460846 100644--- a/backend/Cargo.toml+++ b/backend/Cargo.toml@@ -1,6 +1,6 @@[package]name = "reacher_backend"-version = "0.11.2"+version = "0.11.0"edition = "2018"license = "AGPL-3.0"publish = falsediff --git a/cli/Cargo.toml b/cli/Cargo.tomlindex 1a12afcf..03695314 100644--- a/cli/Cargo.toml+++ b/cli/Cargo.toml@@ -1,6 +1,6 @@[package]name = "check-if-email-exists-cli"-version = "0.11.2"+version = "0.11.0"default-run = "check_if_email_exists"edition = "2018"description = "Check if an email address exists without sending any email."diff --git a/core/Cargo.toml b/core/Cargo.tomlindex f3607242..8a30a050 100644--- a/core/Cargo.toml+++ b/core/Cargo.toml@@ -1,6 +1,6 @@[package]name = "check-if-email-exists"-version = "0.11.2"+version = "0.11.0"authors = ["Amaury <[email protected]>"]categories = ["email"]description = "Check if an email address exists without sending any email"diff --git a/core/src/haveibeenpwned.rs b/core/src/haveibeenpwned.rsindex c8e4c834..27fffe8a 100644--- a/core/src/haveibeenpwned.rs+++ b/core/src/haveibeenpwned.rs@@ -43,7 +43,6 @@ pub async fn check_haveibeenpwned(to_email: &str, api_key: Option<String>) -> Oplet breaches: Vec<serde_json::Value> = response.json().await.unwrap_or_default();tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),breach_count=breaches.len(),"HaveIBeenPwned check completed");diff --git a/core/src/lib.rs b/core/src/lib.rsindex afb7b51d..2093758f 100644--- a/core/src/lib.rs+++ b/core/src/lib.rs@@ -149,7 +149,6 @@ pub async fn check_email(input: &CheckEmailInput) -> CheckEmailOutput {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=%to_email,"Checking email");@@ -165,7 +164,6 @@ pub async fn check_email(input: &CheckEmailInput) -> CheckEmailOutput {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=%to_email,syntax=?my_syntax,"Found syntax validation"@@ -211,7 +209,6 @@ pub async fn check_email(input: &CheckEmailInput) -> CheckEmailOutput {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=%to_email,mx_hosts=?mx_hosts,"Found MX hosts"@@ -226,7 +223,6 @@ pub async fn check_email(input: &CheckEmailInput) -> CheckEmailOutput {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=%to_email,misc=?my_misc,"Found misc details"diff --git a/core/src/misc/gravatar.rs b/core/src/misc/gravatar.rsindex fb658ea5..eca5b2f5 100644--- a/core/src/misc/gravatar.rs+++ b/core/src/misc/gravatar.rs@@ -28,7 +28,6 @@ pub async fn check_gravatar(to_email: &str) -> Option<String> {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email,url=url,"Request Gravatar API"@@ -44,7 +43,6 @@ pub async fn check_gravatar(to_email: &str) -> Option<String> {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),"[email={}] Gravatar response: {:?}",to_email,responsediff --git a/core/src/smtp/connect.rs b/core/src/smtp/connect.rsindex 8dcd0da1..38138a60 100644--- a/core/src/smtp/connect.rs+++ b/core/src/smtp/connect.rs@@ -43,7 +43,6 @@ macro_rules! try_smtp (if let Err(err) = $res {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=$to_email.to_string(),mx_host=$host,port=$port,@@ -228,7 +227,6 @@ async fn smtp_is_catch_all<S: AsyncBufRead + AsyncWrite + Unpin + Send>(if has_rule(domain, host, &Rule::SkipCatchAll) {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email.to_string(),domain=domain,"Skipping catch-all check"@@ -282,7 +280,6 @@ async fn create_smtp_future(if parser::is_err_io_errors(e) {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email.to_string(),error=?e,"Got `io: incomplete` error, reconnecting"@@ -349,7 +346,6 @@ pub async fn check_smtp_with_retry() -> Result<SmtpDetails, SmtpError> {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email.to_string(),attempt=verif_method.config.retries - count + 1,mx_host=mx_host,@@ -362,7 +358,6 @@ pub async fn check_smtp_with_retry(tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email.to_string(),attempt=verif_method.config.retries - count + 1,mx_host=mx_host,@@ -385,7 +380,6 @@ pub async fn check_smtp_with_retry(} else {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email.to_string(),"Potential greylisting detected, retrying");diff --git a/core/src/smtp/gmail.rs b/core/src/smtp/gmail.rsindex 7e6aa1fb..7ba556a9 100644--- a/core/src/smtp/gmail.rs+++ b/core/src/smtp/gmail.rs@@ -63,7 +63,6 @@ pub async fn check_gmail_via_api(tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email = %to_email,response = ?response,"Gmail API response"diff --git a/core/src/smtp/outlook/headless.rs b/core/src/smtp/outlook/headless.rsindex 1e835ecc..1a094bea 100644--- a/core/src/smtp/outlook/headless.rs+++ b/core/src/smtp/outlook/headless.rs@@ -39,7 +39,6 @@ pub async fn check_password_recovery(let to_email = to_email.to_string();tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email,"Using Hotmail password recovery in headless navigator");@@ -95,7 +94,6 @@ pub async fn check_password_recovery(if is_deliverable {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email,exists=is_deliverable,"Did not find error message in password recovery, email exists"@@ -103,7 +101,6 @@ pub async fn check_password_recovery(} else {tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email,exists=is_deliverable,"Found error message in password recovery, email does not exist"@@ -114,7 +111,6 @@ pub async fn check_password_recovery(tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email,exists=is_deliverable,"Password recovery check result"diff --git a/core/src/smtp/outlook/microsoft365.rs b/core/src/smtp/outlook/microsoft365.rsindex a8826f4f..321ff38d 100644--- a/core/src/smtp/outlook/microsoft365.rs+++ b/core/src/smtp/outlook/microsoft365.rs@@ -79,7 +79,6 @@ pub async fn check_microsoft365_api(tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email = %to_email,response = ?response,"microsoft365 response"diff --git a/core/src/smtp/yahoo/api.rs b/core/src/smtp/yahoo/api.rsindex 35729c4c..a4d64a15 100644--- a/core/src/smtp/yahoo/api.rs+++ b/core/src/smtp/yahoo/api.rs@@ -93,7 +93,6 @@ pub async fn check_api(to_email: &str, input: &CheckEmailInput) -> Result<SmtpDetracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email,"Yahoo succesfully got cookies after response");@@ -157,7 +156,6 @@ pub async fn check_api(to_email: &str, input: &CheckEmailInput) -> Result<SmtpDetracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=to_email,"Yahoo 2nd response: {:?}",resdiff --git a/core/src/smtp/yahoo/headless.rs b/core/src/smtp/yahoo/headless.rsindex c7501be0..784a5d5d 100644--- a/core/src/smtp/yahoo/headless.rs+++ b/core/src/smtp/yahoo/headless.rs@@ -44,7 +44,6 @@ pub async fn check_headless(attempts += 1;tracing::debug!(target: LOG_TARGET,- thread_id=?tokio::task::id(),email=%to_email,attempt=%attempts,"Using Yahoo password recovery in headless navigator"diff --git a/core/src/util/sentry.rs b/core/src/util/sentry.rsindex 4864cb68..2314e5f6 100644--- a/core/src/util/sentry.rs+++ b/core/src/util/sentry.rs@@ -37,11 +37,7 @@ pub fn setup_sentry(sentry_dsn: &str) -> sentry::ClientInitGuard {// will just silently ignore.let sentry = sentry::init(sentry_dsn);if sentry.is_enabled() {- info!(- target: LOG_TARGET,- thread_id=?tokio::task::id(),- "Sentry is successfully set up."- );+ info!(target: LOG_TARGET, "Sentry is successfully set up.")}sentry@@ -72,12 +68,7 @@ impl<'a> SentryError<'a> {/// info before sending to Sentry, by removing all instances of `username`.fn error(err: SentryError, result: &CheckEmailOutput, backend_name: &str) {let exception_value = redact(format!("{err:?}").as_str(), &result.syntax.username);- debug!(- target: LOG_TARGET,- thread_id=?tokio::task::id(),- "Sending error to Sentry: {}",- exception_value,- );+ debug!(target: LOG_TARGET, "Sending error to Sentry: {}", exception_value);let exception = Exception {ty: err.get_exception_type(),diff --git a/sqs/Cargo.toml b/sqs/Cargo.tomlindex 6dcecaa3..edbee997 100644--- a/sqs/Cargo.toml+++ b/sqs/Cargo.toml@@ -1,6 +1,6 @@[package]name = "reacher_sqs"-version = "0.11.2"+version = "0.11.0"edition = "2018"license = "AGPL-3.0"publish = false