summaryrefslogtreecommitdiff
path: root/lib/custodian
diff options
context:
space:
mode:
Diffstat (limited to 'lib/custodian')
-rw-r--r--lib/custodian/protocoltest/dnsbl.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/custodian/protocoltest/dnsbl.rb b/lib/custodian/protocoltest/dnsbl.rb
index 7cdf0b9..b043f61 100644
--- a/lib/custodian/protocoltest/dnsbl.rb
+++ b/lib/custodian/protocoltest/dnsbl.rb
@@ -34,9 +34,9 @@ module Custodian
raise ArgumentError, "The target must be an IP address" unless( @host =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/ )
#
- # Save the host we're testing against
+ # See which blacklist(s) we're testing against.
#
- if ( line =~ /via\s+([0-9]+)/ )
+ if ( line =~ /via\s+([^\s]+)\s+/ )
@zones = $1.dup
else
@zones = "zen.spamhaus.org"
@@ -82,6 +82,7 @@ module Custodian
# 4.3.2.1.$zone
#
if ( @host =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/ )
+
name = "#{$4}.#{$3}.#{$2}.#{$1}.#{zone}"
result = Custodian::Util::DNS.hostname_to_ip( name )
@@ -91,8 +92,10 @@ module Custodian
return true
end
+ else
+ @error "#{@host} wasn't an IP address"
+ return true
end
- #
end
return false