Subject: | Add support for custom queries / Http:BL |
The patch below allows for custom queries where a key needs to be added
to the domain (as in the Http:BL API).
Best regards.
-lem
$ diff -u Client.pm.orig Client.pm
--- Client.pm.orig 2011-07-04 14:40:26.526480748 -0400
+++ Client.pm 2011-07-04 14:43:19.731270399 -0400
@@ -67,7 +67,15 @@
sub lookup_all{
my ($self, $partial, $lists) = @_;
foreach my $list (@$lists){
- my $query = join '.', ($partial, $list);
+ my $query;
+ if ($list =~ m{%s})
+ {
+ $query = sprintf($list, $partial);
+ }
+ else
+ {
+ $query = join '.', ($partial, $list);
+ }
# Send the A lookup
$self->send_packet_a($query);
@@ -333,6 +341,9 @@
blacklist. Use this if you want to query a specific list of RBLs - if
this
argument is omitted, a large list of default RBLs is used.
+The domains can contain the string C<%s>, in which case the inverted
+quad address will be replaced where indicated as in L<sprintf()>.
+
=item lists_domain
Similar to lists_ip, but these are used when querying domains with
@@ -340,6 +351,9 @@
a list of IP RBLs to check domains is a bad plan. Currently, the URIBL
and
SURBL services are used by default.
+The domains can contain the string C<%s>, in which case the query
+parameter will be replaced where indicated as in L<sprintf()>.
+
=item query_txt
This option controls whether Net::Blacklist::Client looks up
corresponding
@@ -422,6 +436,9 @@
Based on L<Net::RBLClient> by Asher Blum
E<lt>F<asher@wildspark.com>E<gt>
+Support for custom domains / queries added by Luis Muñoz
+E<lt>F<lem@itverx.com.ve>E<gt>
+
=head1 COPYRIGHT
Copyright (C) 2007 Dan Thomas. The original Net::RBLClient is Copyright