[thelist] Script lookover

CDitty mail at redhotsweeps.com
Mon Feb 4 13:24:02 CST 2002


Hello all.  I am tired of spammers trying to use my server as a spam relay
point and want to block them instantly.  Can someone look
over the script below and tell me if they see/forsee any issues with it?

Thanks.

Chris


#!/usr/local/bin/perl

$spammer_ip = $ENV{'REMOTE_ADDR'};

if('$spammer_ip' != '209.61.158.9'){ // In case they fake the ip to my
servers ip addr
     system(/sbin/ipchains -A input -s $spammer_ip -j DENY);

     open (MAIL, "|/usr/sbin/sendmail -t")
     print MAIL "To: webmaster\@redhotsweeps.com \nFrom:
server\@redhotsweeps.com\n";
     print MAIL "Subject: IP Address Banned\n";
     print MAIL "This is just to notify you that the IP
Address($spammer_ip) tried to access\n";
     print MAIL "a restricted file/program and was banned.\n\nHave a nice
day.\n";
     close (MAIL);
}





More information about the thelist mailing list