Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #190.
When a DNS deliverability check times out or has no usable nameserver,
validate_email()returns an accepted address without anmxattribute. A caller following the documentedValidatedEmail.mxAPI then getsAttributeErrorinstead ofNone, making it harder to distinguish a temporary lookup problem from a successful check.Assign
mxfrom the lookup result unconditionally, matching both the README and the existing handling ofmx_fallback_type. Make the annotation optional and retain the existing equality behavior with optional MX results. Regression tests exercise the public validator for timeout and no-nameserver outcomes, includingas_dict().The existing report provides a constructed timeout reproduction. I also verified the public API with an ordinary
dns.resolver.Resolverpointing only at a bound, nonresponding loopback UDP socket: reading.mxfails before this fix and returnsNoneafterward. This is controlled test data, not a production DNS trace.Validation:
Disclosure: OpenAI Codex assisted with investigation, implementation, tests, and this PR description. No human review or upstream acceptance is claimed.