09/01/01 17:19:44
>>351をベースに>>356の修正ポイントを反映+α。
my $IP = $ENV{HTTP_REMOTE_ADDR};
my @DNSBL_list = qw|niku.2ch.net http.dnsbl.sorbs.net bbx.2ch.net all.rbl.jp zen.spamhaus.org b.barracudacentral.org|;
for my $DNSBL_host (@DNSBL_list){
my $host = join ".", reverse (split /\Q.\E/, $IP) , $DNSBL_host;
my $result = join ".", unpack 'C*', gethostbyname $host;
if ($result =~ /^127\./){
# スパム判定に引っかかった時の処理 ※適当に変更
printf qq|%s =>yes listed %s\n|, $IP, $DNSBL_host;
}
else {
# スパム判定に引っかからなかった時の処理 ※適当に変更
printf qq|%s =>no listed %s\n|, $IP, $DNSBL_host;
}
}
% env HTTP_REMOTE_ADDR=125.208.217.212 perl hoge.pl
125.208.217.212 =>no listed niku.2ch.net
125.208.217.212 =>no listed http.dnsbl.sorbs.net
125.208.217.212 =>no listed bbx.2ch.net
125.208.217.212 =>no listed all.rbl.jp
125.208.217.212 =>yes listed zen.spamhaus.org
125.208.217.212 =>yes listed b.barracudacentral.org