Mail::RBL3pm
Perl extension to access rbl-style host verification services
Usage
use Mail::RBL;my $list = new Mail::RBL('list.org');# You can also specify a resolver to use with Net::DNS::Resolvermy $list = new Mail::RBL('list.org', $res);if ($list->check($host)) {print "$host is in the list";}my ($ip_result, $optional_info_txt) = $list->check($host);# $optional_info_txt will be undef if the list does not provide TXT# RRs along with the A RRs.print "The list says ", ($list->check($host))[1], " in its TXT RR\n";my ($ip_result, $optional_info_txt) = $list->check_rhsbl($hostname);
Overview
This module eases the task of checking if a given host is in the list. The methods available are described below:
- "->new(suffix, resolver)"
-
Creates a list handle. The
"suffix"parameter is mandatory and specifies which suffix to append to the queries. If left unspecified, defaults to"bl.spamcop.net".An optional DNS resolver can be specified. An object of the Net::DNS::Resolver(3) class is expected.
- "->check($host)"
-
$hostcan be either a hostname or an IP address. In the case of an IP Address. In the case of a hostname, all the IP addresses will be looked up and checked against the list. Ifanyof the addresses is in the list, the host will be considered in the list as a whole.Returns either a
"NetAddr::IP"object as returned by the RBL itself, or"undef"in case the RBL does not supply an answer. This is important because many lists inject some semantics on the DNS response value, which now can be recovered easily with the program that uses this module.In array context, any IP addresses are returned, followed by any TXT RR (or undef if none). If no match is found, an empty list is returned instead. In scalar context, only the first IP address (or undef) is returned.
- "->check_rhsbl($host)"
-
Analogous to
"->check()", but queries RHSBLs instead of IP-based lists. This is useful for using lists such as some ofhttp://www.rfc-ignorant.org/.Results and return values are the same as
"->check()".
Releases
5 releases since Debian 9 (Stretch); the text changed 1 time.