Do not DNSBL check invalid domains (#1107)

This commit is contained in:
mdecimus
2025-01-19 18:36:48 +01:00
parent a6f11699ef
commit 5e5771e033
7 changed files with 108 additions and 30 deletions

View File

@@ -380,7 +380,10 @@ pub fn sanitize_email(email: &str) -> Option<String> {
}
}
if found_domain && last_ch != '.' && psl::domain(result.as_bytes()).is_some() {
if found_domain
&& last_ch != '.'
&& psl::domain(result.as_bytes()).is_some_and(|d| d.suffix().typ().is_some())
{
Some(result)
} else {
None