SpamCop Opinions?
Alan Jackson
ajackson
Sat Nov 6 20:09:59 PST 2004
On Sat, 6 Nov 2004 08:39:07 -0500
Kurt Wall <kwall at kurtwerks.com> wrote:
> Anyone here use (or used) SpamCop? Have any opinions about it?
>
I obsess too much over spam. http://www.ajackson.org/Spamstats/index.html
If all you want to do is send a complaint to the ISP, I use this script
in Sylpheed (Note it depends on zcw to get the address and is customized
to the correct number of internal handoffs that occur at my 2 isp's. It also
runs Spamassassin in cleanup mode to remove all it's cruft. zcw from
http://www.cyberabuse.org/whois/):
#!/usr/bin/perl -w
use strict;
use Mail::Header;
use LockFile::Simple qw(lock trylock unlock);
chomp $ARGV[0];
my $lockfile = '/tmp/lock_bitch';
my $sleep = int(rand(10))+1;
sleep $sleep;
my $lockmgr = LockFile::Simple->make(-hold=>120,
-max => 30, -delay => $sleep, -warn => 0, -stale=>1);
while ( ! $lockmgr->lock($lockfile)) {
sleep $sleep;
$lockmgr = LockFile::Simple->make(-hold=>120,
-max => 30, -delay => $sleep, -warn => 0, -stale=>1);
}
# filespam.pl filename fromfolder
my $f = `basename $ARGV[0]`;
chomp $f;
open (MSG,"cat $ARGV[0]| spamassassin -d |") || die "Can't open $ARGV[0], $!\n";
my $head = new Mail::Header \*MSG;
my $header = $head->as_string;
$header =~ s/\n\s+//g;
my @header = split(/\n/,$header);
my @received = grep /Received/, @header;
my $received = $received[3];
$received =~ s/\].*$//;
$received =~ s/^.*\[//;
my @code = grep /X-Filter:/, @header;
my $code = (split(/\s*#\s*/,$code[0]))[1];
print "---> $received $code\n";
my $abuse = `zcw -h $received | grep Abuse`;
if (length $abuse < 1) {$abuse = 'UNK';}
if ($abuse eq 'reached') {$abuse = 'UNK';}
chomp $abuse;
$abuse = (split(/\s+/,$abuse))[-1];
$abuse =~ s/\.$//;
if ($abuse eq 'ip at thrunet.com') {$abuse = 'abuse at thrunet.com';}
if ($abuse eq 'nospam at hanaro.com') {$abuse = 'abuse at hanaro.com';}
if ($abuse eq 'agnelo.fernandes at pandora.com.pt') {$abuse = 'abuse at mail.telepac.pt';}
my $newheader; my $r=0;
foreach (@header) {
if (/^Received/) {
$r++;
next if $r<4;
}
$newheader .= $_ ."\n";
}
my $msg = join '', <MSG>;
$msg =~ s/^(.*?\n)\n//s; # body only
if (defined $received && ($abuse eq 'UNK' || $abuse eq "Whois")) {
print "===> $f $received\@abuse.net\n";
open(MAIL,"| mhmail -subject \"Please stop your user from spamming : IP $received : $code\" $received\@abuse.net")|| die "open MAIL failed, $!\n";
print MAIL "-"x45,"\n","Spam received from IP address $received\n","-"x45,"\n";
print MAIL "$newheader, $msg";
}
if (defined $received && $abuse ne 'UNK') {
if ($abuse eq 'ipadm at nic.bora.net') {$abuse = 'abuse at bora.net';}
print "===> $f $abuse\n";
open(MAIL,"| mhmail -subject \"Please stop your user from spamming : IP $received : $code\" $abuse")|| die "open MAIL failed, $!\n";
print MAIL "-"x45,"\n","Spam received from IP address $received\n","-"x45,"\n";
print MAIL "$newheader, $msg";
}
$lockmgr->unlock($lockfile);
--
-----------------------------------------------------------------------
| Alan K. Jackson | To see a World in a Grain of Sand |
| alan at ajackson.org | And a Heaven in a Wild Flower, |
| www.ajackson.org | Hold Infinity in the palm of your hand |
| Houston, Texas | And Eternity in an hour. - Blake |
-----------------------------------------------------------------------
More information about the Linux-users
mailing list