lib/spf/model.rb in spf-0.0.32 vs lib/spf/model.rb in spf-0.0.33
- old
+ new
@@ -324,10 +324,15 @@
def match_in_domain(server, request, domain)
domain = self.domain(server, request) unless domain
ipv4_prefix_length = @ipv4_prefix_length || self.default_ipv4_prefix_length
ipv6_prefix_length = @ipv6_prefix_length || self.default_ipv6_prefix_length
- packet = server.dns_lookup(domain.to_s, 'ANY')
+ begin
+ packet = server.dns_lookup(domain.to_s, 'ANY')
+ rescue SPF::DNSError => e
+ @errors << e
+ return false
+ end
server.count_void_dns_lookup(request) unless (rrs = packet)
rrs.each do |rr|
if Resolv::DNS::Resource::IN::A === rr
network = IP.new("#{rr.address}/#{ipv4_prefix_length}")