function rbl_lookup($ipv4) {
$ip = explode(".", $ipv4);
$rbl_url = ".rbl.blockedservers.com";
$rbl_hostname = $ip[3].".".$ip[2].".
".$ip[1].".".$ip[0]."". $rbl_url;
$rbl_lookup = gethostbyname($rbl_hostname);
if($rbl_lookup == $rbl_hostname) {
return 1;
}
else {
return 0;
}
}
#!/usr/bin/perl
# ./api_perl.pl 123.234.123.234
use Net::DNS;
$check_host = join(".", reverse(split(/\./, $ARGV[0]))) .
'.rbl.blockedservers.com';
$check_data = Net::DNS::Resolver->new;
$check_query = $check_data->search("$check_host");
if($check_query) {
print "$ARGV[0] is listed.\n";
}
else {
print "$ARGV[0] is not listed.\n";
}
#
# Main.cf
#
smtpd_client_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
reject_rbl_client rbl.blockedservers.com,
permit
@dnsbl_score = (
"pbl.spamhaus.org", 3.25, 0, "DYN_PBL_SPAMHAUS",
"dnsbl.njabl.org", 4.25, -1.5, "BL_NJABL",
"bl.spamcop.net", 1.75, -1.5, "SPAMCOP",
"sbl-xbl.spamhaus.org", 4.35, -1.5, "SBL_XBL_SPAMHAUS",
"list.dsbl.org", 4.35, 0, "DSBL_ORG",
"ix.dnsbl.manitu.net", 4.35, 0, "IX_MANITU",
"relays.ordb.org", 3.25, 0, "ORDB_ORG",
"rbl.blockedservers.com", 1.25, 0, "BLOCKEDSERVERS_COM"
);
Status: Running
rbl.blockedservers.com
Status: Running
netscan.rbl.blockedservers.com
Status: Running
spam.rbl.blockedservers.com
Status: Running
torexit.rbl.blockedservers.com