-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid email is seen as "valid" #2
Comments
I see you're using the check_dns functionality. Is your DNS provider returning a forwarding domain? If you're using OpenDNS, I know they always return a DNS record, since they forward your requests to a holder domain. This can lead to the check being marked as valid, even when there isn't really a domain there. |
As the same time, I check with
Can it be seen that DNS provider don't return forwarding domain? Test with Python: import dns.resolver
dns.resolver.query('virtualbox') Get |
If run is_email with the diagnose flag, you'll get an explanation as to why it's considered valid: >>> from pyisemail import is_email
>>> s = '08.00.27.d1.8c.d2@virtualbox'
>>> d = is_email(s, check_dns=True, diagnose=True)
<RFC5321Diagnosis: TLD>
>>> d.message
'Address is valid but at a Top Level Domain.' If you'd like more information on this diagnosis, you can read about it at the isemail.info diagnosis. As it is, though, pyIsEmail is functioning as intended, so I'm going to go ahead and close this issue. |
But isn't |
You have a point. Since we can get more information out of dnspython than the parent library could get from its DNS resolver, we should use that information. I'm reopening this for you to check out the change I made to make sure it works for you. |
@hongquan Since I never heard back from you, I went ahead and included that fix in a new 1.1.0 version. Thanks for reporting the bug! |
Thanks |
This bug still exists. >>> from pyisemail import is_email
>>> is_email('jace@pobox.com', check_dns=True, diagnose=True)
<ValidDiagnosis: VALID>
>>> type(is_email('jace@pobox.com', check_dns=True, diagnose=True))
<class 'pyisemail.diagnosis.valid_diagnosis.ValidDiagnosis'>
>>> type(is_email('jace@nobox.com', check_dns=True, diagnose=True))
<class 'pyisemail.diagnosis.valid_diagnosis.ValidDiagnosis'>
>>> is_email('jace@nobox.com', check_dns=True, diagnose=True)
<ValidDiagnosis: VALID>
>>> is_email('jace@hjkjjh.com', check_dns=True, diagnose=True)
<DNSDiagnosis: NO_RECORD>
>>> is_email('jace@hjkjjh.com', check_dns=True, diagnose=False)
True
>>> is_email('jace@iuiuygbhkiu7y87gt8.com', check_dns=True, diagnose=False)
True
>>> is_email('jace@iuiuygbhkiu7y87gt8.com', check_dns=True)
True |
@jace Thanks for reporting this. My apologies for not addressing it yet. I intend to, I just haven't had the time. If you'd like to write a patch, I'll be happy to review and accept it! |
This is weird:
The text was updated successfully, but these errors were encountered: