From miguel.filho at gmail.com Wed Apr 23 13:52:36 2008 From: miguel.filho at gmail.com (Miguel Filho) Date: Wed, 23 Apr 2008 14:52:36 -0300 Subject: [Pymilter] SPF timeout Message-ID: <394cf6840804231052i1e55bc74lff5593c0d906daa4@mail.gmail.com> Hello, I use pyspf to verify SPF in my project[1] and works great. Although, there is no parameter to set a timeout and limit for how long pydns will try to resolve a name. Would be possible to add this? I think just a global variable would be sufficient and use it on the DNSLookup function. pydns default timeout is 30 seconds, and that too high for a busy e-mail server to wait. Another question: is there any plan to make the DNSLookup function "modular"? I'm using twisted already and it would be very cool if I could use only the twisted.names stuff for DNS, so it wouldn't be necessary to have twisted AND pydns in the same code for the same purpose. Regards, Miguel [1] http://www.apolicy.org From stuart at bmsi.com Wed Apr 23 14:36:42 2008 From: stuart at bmsi.com (Stuart D. Gathman) Date: Wed, 23 Apr 2008 14:36:42 -0400 (EDT) Subject: [Pymilter] SPF timeout In-Reply-To: <394cf6840804231052i1e55bc74lff5593c0d906daa4@mail.gmail.com> Message-ID: On Wed, 23 Apr 2008, Miguel Filho wrote: > Another question: is there any plan to make the DNSLookup function > "modular"? I'm using twisted already and it would be very cool if I > could use only the twisted.names stuff for DNS, so it wouldn't be > necessary to have twisted AND pydns in the same code for the same > purpose. Check out version 2.1 in CVS. That has a modular DNSLookup, with implementations for both pydns and dnspython. -- Stuart D. Gathman Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial. From miguel.filho at gmail.com Wed Apr 23 14:46:12 2008 From: miguel.filho at gmail.com (Miguel Filho) Date: Wed, 23 Apr 2008 15:46:12 -0300 Subject: [Pymilter] SPF timeout In-Reply-To: References: <394cf6840804231052i1e55bc74lff5593c0d906daa4@mail.gmail.com> Message-ID: <394cf6840804231146x1b7bf105pc44c880b44a0c748@mail.gmail.com> On Wed, Apr 23, 2008 at 3:36 PM, Stuart D. Gathman wrote: > On Wed, 23 Apr 2008, Miguel Filho wrote: > Check out version 2.1 in CVS. That has a modular DNSLookup, with > implementations for both pydns and dnspython. Nice! Any chance for a twisted implementation? I could do it. And what about the timeout parameter? Regards, Miguel From stuart at bmsi.com Wed Apr 23 14:50:50 2008 From: stuart at bmsi.com (Stuart D. Gathman) Date: Wed, 23 Apr 2008 14:50:50 -0400 (EDT) Subject: [Pymilter] SPF timeout In-Reply-To: <394cf6840804231052i1e55bc74lff5593c0d906daa4@mail.gmail.com> Message-ID: On Wed, 23 Apr 2008, Miguel Filho wrote: > Although, there is no parameter to set a timeout and limit for how > long pydns will try to resolve a name. Would be possible to add this? > I think just a global variable would be sufficient and use it on the > DNSLookup function. pydns default timeout is 30 seconds, and that too > high for a busy e-mail server to wait. In DNSLookup, add timeout= to DnsRequest. E.g. req = DNS.DnsRequest(name, qtype=qtype, timeout=10) As far as adding to pyspf API, I'm thinking that a keyword arg to the query constructor would be best. -- Stuart D. Gathman Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.