Lines 187-192
Link Here
|
187 |
Note that, as with C<urirhsbl>, you must also define a body-eval rule calling |
187 |
Note that, as with C<urirhsbl>, you must also define a body-eval rule calling |
188 |
C<check_uridnsbl()> to use this. |
188 |
C<check_uridnsbl()> to use this. |
189 |
|
189 |
|
|
|
190 |
=item tflags NAME_OF_RULE ips_only |
191 |
|
192 |
Only URIs containing IP addresses as the "host" component will be matched |
193 |
against the named rule. |
194 |
|
195 |
=item tflags NAME_OF_RULE domains_only |
196 |
|
197 |
Only URIs containing a non-IP-address "host" component will be matched against |
198 |
the named rule. |
199 |
|
190 |
=back |
200 |
=back |
191 |
|
201 |
|
192 |
=head1 ADMINISTRATOR SETTINGS |
202 |
=head1 ADMINISTRATOR SETTINGS |
Lines 370-376
Link Here
|
370 |
} |
380 |
} |
371 |
else { |
381 |
else { |
372 |
# trim down to a limited number - pick randomly |
382 |
# trim down to a limited number - pick randomly |
373 |
my $i; |
|
|
374 |
while (@domains && keys %domlist < $umd) { |
383 |
while (@domains && keys %domlist < $umd) { |
375 |
my $r = int rand (scalar @domains); |
384 |
my $r = int rand (scalar @domains); |
376 |
$domlist{splice (@domains, $r, 1)} = 1; |
385 |
$domlist{splice (@domains, $r, 1)} = 1; |
Lines 644-651
Link Here
|
644 |
|
653 |
|
645 |
my $obj = { dom => $dom }; |
654 |
my $obj = { dom => $dom }; |
646 |
|
655 |
|
|
|
656 |
my $tflags = $scanner->{conf}->{tflags}; |
657 |
my $cf = $scanner->{uridnsbl_active_rules_revipbl}; |
658 |
my $dnsbl_lookup_ips = 0; |
659 |
foreach my $rulename (keys %{$cf}) { |
660 |
if ($tflags->{$rulename} !~ /\bdomains_only\b/) { |
661 |
$dnsbl_lookup_ips++; |
662 |
} |
663 |
} |
664 |
|
665 |
my $is_ip = 0; |
647 |
my $single_dnsbl = 0; |
666 |
my $single_dnsbl = 0; |
648 |
if ($dom =~ /^\d+\.\d+\.\d+\.\d+$/) { |
667 |
if ($dnsbl_lookup_ips && $dom =~ /^\d+\.\d+\.\d+\.\d+$/) { |
649 |
my $IPV4_ADDRESS = IPV4_ADDRESS; |
668 |
my $IPV4_ADDRESS = IPV4_ADDRESS; |
650 |
my $IP_PRIVATE = IP_PRIVATE; |
669 |
my $IP_PRIVATE = IP_PRIVATE; |
651 |
# only look up the IP if it is public and valid |
670 |
# only look up the IP if it is public and valid |
Lines 655-660
Link Here
|
655 |
if ($dom =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) { |
674 |
if ($dom =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) { |
656 |
$dom = "$4.$3.$2.$1"; |
675 |
$dom = "$4.$3.$2.$1"; |
657 |
$single_dnsbl = 1; |
676 |
$single_dnsbl = 1; |
|
|
677 |
$is_ip = 1; |
658 |
} |
678 |
} |
659 |
} |
679 |
} |
660 |
} |
680 |
} |
Lines 670-675
Link Here
|
670 |
if ($single_dnsbl) { |
690 |
if ($single_dnsbl) { |
671 |
# look up the domain in the RHSBL subset |
691 |
# look up the domain in the RHSBL subset |
672 |
foreach my $rulename (keys %{$rhsblrules}) { |
692 |
foreach my $rulename (keys %{$rhsblrules}) { |
|
|
693 |
next if ($is_ip && $tflags->{$rulename} =~ /\bdomains_only\b/); |
694 |
next if (!$is_ip && $tflags->{$rulename} =~ /\bips_only\b/); |
695 |
|
673 |
my $rulecf = $scanner->{conf}->{uridnsbls}->{$rulename}; |
696 |
my $rulecf = $scanner->{conf}->{uridnsbls}->{$rulename}; |
674 |
$self->lookup_single_dnsbl($scanner, $obj, $rulename, |
697 |
$self->lookup_single_dnsbl($scanner, $obj, $rulename, |
675 |
$dom, $rulecf->{zone}, $rulecf->{type}); |
698 |
$dom, $rulecf->{zone}, $rulecf->{type}); |