Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ In Development
* Python 3.8 and 3.9 are no longer supported.
* The `original` field of the returned validated email object incorrectly un-escaped the local part of the email address. Now it returns the original address, without any display name, as passed to validate_email.
* add support python3.15
* Faster validation of domains without Punycode (xn--) labels.

2.3.0 (August 26, 2025)
-----------------------
Expand Down
7 changes: 7 additions & 0 deletions email_validator/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,13 @@ def validate_email_domain_name(domain: str, test_environment: bool = False, glob
if ascii_domain == d or ascii_domain.endswith("." + d):
raise EmailSyntaxError("The part after the @-sign is a special-use or reserved name that cannot be used with email.")

# Domains without Punycode labels come back unchanged from the IDNA round trip below.
if "xn--" not in ascii_domain:
return {
"ascii_domain": ascii_domain,
"domain": ascii_domain,
}

# We may have been given an IDNA ASCII domain to begin with. Check
# that the domain actually conforms to IDNA. It could look like IDNA
# but not be actual IDNA. For ASCII-only domains, the conversion out
Expand Down
Loading