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
fix(core): Remove antispam check (#1337)
Amaury06f18edf7aee
diff --git a/core/src/lib.rs b/core/src/lib.rsindex ae1359e6..e0748d62 100644--- a/core/src/lib.rs+++ b/core/src/lib.rs@@ -70,7 +70,7 @@ pub mod syntax;mod util;use misc::{check_misc, MiscDetails};-use mx::{check_mx, is_antispam_mx};+use mx::check_mx;use rand::Rng;use smtp::{check_smtp, SmtpDetails, SmtpError};use syntax::{check_syntax, get_similar_mail_provider};@@ -196,6 +196,8 @@ pub async fn check_email(input: &CheckEmailInput) -> CheckEmailOutput {// beginning or end of the list (sorted by priority). Instead, we choose a// random one in the middle of the list.//+ // See here for explanation: https://cwiki.apache.org/confluence/display/SPAMASSASSIN/OtherTricks+ //// If anyone has a better algorithm, let me know by creating an issue on// Github.// ref: https://github.com/reacherhq/check-if-email-exists/issues/1049@@ -204,7 +206,6 @@ pub async fn check_email(input: &CheckEmailInput) -> CheckEmailOutput {.as_ref().expect("If lookup is error, we already returned. qed.").iter()- .filter(|host| !is_antispam_mx(host.exchange())).collect::<Vec<&MX>>();mx_records.sort_by_key(|a| a.preference());let host = if mx_records.len() >= 3 {diff --git a/core/src/mx/mod.rs b/core/src/mx/mod.rsindex 0a52afe1..abe83a3a 100644--- a/core/src/mx/mod.rs+++ b/core/src/mx/mod.rs@@ -19,7 +19,6 @@ use crate::util::ser_with_display::ser_with_display;use async_std_resolver::{lookup::MxLookup, resolver_from_system_conf, ResolveError};use serde::{ser::SerializeMap, Serialize, Serializer};use std::io::Error;-use trust_dns_proto::rr::Name;/// Details about the MX lookup.#[derive(Debug)]@@ -96,12 +95,3 @@ pub async fn check_mx(syntax: &SyntaxDetails) -> Result<MxDetails, MxError> {Err(err) => Ok(MxDetails { lookup: Err(err) }),}}--// is_antispam_mx checks if the MX record is an antispam MX record.-pub fn is_antispam_mx(host: &Name) -> bool {- let host = host.to_string();- // filter20.antispamcloud.com. (on @computan.net)- host.contains("antispamcloud.com")- // mx.spamexperts.com (see https://documentation.n-able.com/spamexperts/userguide/Content/B_Admin%20Level/domains/mx-records.htm)- || host.contains("spamexperts.com")-}