return HasMXRecord as true when at least one valid mx records exist #94
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.
Some domains may have several MX records and some of them may be invalid
for example nslookup for the domain
test-unicode.definbox.com
returns "some" valid MX recordsI think we should return True in cases when at least one MX record exist and is valid.
Currently the library will return
has_mx_records = False
in this case although I think this is incorrect behaviorInside the Go library, they made changes to support this case
https://github.com/golang/go/blob/dd96ded6c86b8a38f49fa087b758455243a0f08c/src/net/lookup.go#L515
some additional references:
https://go-review.googlesource.com/c/go/+/333331
golang/go#46979
I wanted to add a relevant test but if the tests are actually performing the MX check, if the DNS record is fixed in those domains the test will fail, making it unstable.
Any thoughts?