RBL(3pm) | User Contributed Perl Documentation | RBL(3pm) |
Mail::RBL - Perl extension to access RBL-style host verification services
use Mail::RBL; my $list = new Mail::RBL('list.org'); # You can also specify a resolver to use with Net::DNS::Resolver my $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);
This module eases the task of checking if a given host is in the list. The methods available are described below:
An optional DNS resolver can be specified. An object of the Net::DNS::Resolver(3) class is expected.
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.
Results and return values are the same as "->check()".
$Log: RBL.pm,v $ Revision 1.10 2007/04/25 04:22:04 lem Finished adding support for the custom resolver code - Implementation was incomplete Revision 1.9 2006/12/08 00:01:14 lem Get version straight from the CVS revision. Revision 1.8 2006/12/07 23:58:07 lem Allow the user to provide a Net::DNS::Resolver object to perform DNS resolution - This allows finer control over how the queries are performed. Suggested by Eric Langheinrich.
Luis E. Munoz <luismunoz@cpan.org>
Net::DNS::Resolver(3), perl(1).
2022-06-15 | perl v5.34.0 |