Re: email validation problems
"Robert Leftwich" <[email protected]>
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
JosephSheedy <josephs@3t...> - 2007-04-26 01:34 wrote:
> I'm using the Email validator, and experiencing some trouble with domain
> resolution. After having some intermittent failures, I
> made a simple fuzz tester and found an address which doesn't work.
> So as not to generate any extra spam traffic for these guys, replace '??' with
> 'taker' below :
> However, I can dig their MX records just fine. I think it's a
> pyDNS issue, but I'm not sure.
I ran into the same issue where the 0.7.1 release failed validation on
some email addresses that an earlier release did not. Some digging
showed that the latest code uses the following pyDNS request:
a=DNS.DnsRequest(domain).req().answers
dnsdomains=[x['data'] for x in a if x['typename'] in
('A', 'MX')]
but pyDNS defaults to only looking for A records and if the domain only
has MX records then it will fail. Changing the code in validators.py to:
a=DNS.DnsRequest(domain, qtype = 'mx').req().answers
dnsdomains=[x['data'] for x in a if x['typename'] in
('A', 'MX')]
fixes my problem (and works for the 'taker' domain as well).
However, not knowing what Ian had in mind when making this change I
don't know if this is the best fix for the problem?
Robert
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/