Mail::Toaster::DNS - Common DNS functions
Mail::Toaster::DNS is a grouping of DNS functions I've written.
These functions are used by toaster-watcher to determine if RBL's are available when generating qmail's smtpd/run control file.
use Mail::Toaster::DNS; my $r = RblTest("bl.example.com"); if ($r) { print "bl tests good!" };
After the demise of osirusoft and the DDoS attacks currently under way against RBL operators, this little subroutine becomes one of necessity.
The routine expects to receive the zone of a blacklist to test as it's first argument and a possible debug value (set to a non-zero value) as it's second.
It will then test to make sure that name servers are found for the zone and then run several test queries against the zone to verify that the answers it returns are sane. We want to detect if a RBL operator does something like whitelist or blacklist the entire planet.
If the blacklist fails any test, the sub willl return zero and you should not use that blacklist.
use Mail::Toaster::DNS; GetRblTestNS($rbl);
$rbl is the reverse zone we use to test this rbl.
use Mail::Toaster::DNS; GetRblTestPositiveIP($rbl);
$rbl is the reverse zone we use to test this rbl. Positive test is a test that should always return a RBL match. If it should and doesn't, then we assume that RBL has been disabled by it's operator.
use Mail::Toaster::DNS; GetRblTestNegativeIP($rbl);
This test is difficult as RBL operators don't typically have an IP that's whitelisted. The DNS location based lists are very easy to test negatively. For the rest I'm listing my own IP as the default unless the RBL has a specific one. At the very least, my site won't get blacklisted that way. ;) I'm open to better suggestions.
Matt Simerson <matt@tnpi.biz>
None known. Report any to author.
http://www.tnpi.biz/computing/ http://www.tnpi.biz/computing/perl/MATT-Bundle/
Mail::Toaster::CGI, Mail::Toaster::DNS, Mail::Toaster::Logs, Mail::Toaster::Qmail, Mail::Toaster::Setup
Copyright 2003, The Network People, Inc. All Rights Reserved.
To install Mail::Toaster, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::Toaster
CPAN shell
perl -MCPAN -e shell install Mail::Toaster
For more information on module installation, please visit the detailed CPAN module installation guide.