25 |
+ # Migrate to use , as separator instead of : |
+ # Migrate to use , as separator instead of : |
26 |
+ if ($rbl !~ m/,/){ |
+ if ($rbl !~ m/,/){ |
27 |
+ my @zones = split /[:]/, $rbl; |
+ my @zones = split /[:]/, $rbl; |
28 |
+ my $fqdn_re = qr/[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}/; |
+ my $fqdn_re = qr/([a-zA-Z0-9][a-zA-Z0-9-]{1,}[a-zA-Z0-9]\.)*[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}/; |
29 |
+ if (scalar @zones == 2 && $zones[1] !~ m/^$fqdn_re$/){ |
+ if (scalar @zones == 2 && $zones[1] !~ m/^$fqdn_re$/){ |
30 |
+ # When we have only two entries, check if the second one looks like a valid hostname |
+ # When we have only two entries, check if the second one looks like a valid hostname |
31 |
+ # so if you only have something like dnsbl.foo.net:Sorry you are blacklisted |
+ # so if you only have something like dnsbl.foo.net:Sorry you are blacklisted |