I use reporter.pl http://www.spamcop.net/reporter.pl.
Does anyone have an amount of perl knowledge so that they can fix my modifications:
CODE
#!/usr/bin/perl
open(SENDMAIL, "|/usr/sbin/sendmail -oi -t") || die "Cannot open sendmail output";
print SENDMAIL <<"ENDENDEND";
From: root\@mydomain.com
To: testaddress\@mydomain.com
Subject: report spam
MIME-Version: 1.0
Content-Type: message/rfc822
ENDENDEND
# check whether the ISP has sent the reply to a junkmail address, and then just cancel
my $string = "spamcop"; #added
while (defined($_ = <STDIN>)) {
my $result = index($_, $string); #added
if ($result == -1){ #added
close (SENDMAIL); #added
exit #added
} #added
print SENDMAIL;
}
close (SENDMAIL);
open(SENDMAIL, "|/usr/sbin/sendmail -oi -t") || die "Cannot open sendmail output";
print SENDMAIL <<"ENDENDEND";
From: root\@mydomain.com
To: testaddress\@mydomain.com
Subject: report spam
MIME-Version: 1.0
Content-Type: message/rfc822
ENDENDEND
# check whether the ISP has sent the reply to a junkmail address, and then just cancel
my $string = "spamcop"; #added
while (defined($_ = <STDIN>)) {
my $result = index($_, $string); #added
if ($result == -1){ #added
close (SENDMAIL); #added
exit #added
} #added
print SENDMAIL;
}
close (SENDMAIL);
The scri_pt above does not work correctly.
if the lines with #added are removed then it works perfectly.
The aim of the crude changes was to modifiy the behaviour of the scri_pt so that it checked for the presence of the word spamcop and then just abort sending that email.
Thinking about it it would be nicer to forward the email to a different location upon finding mention of spamcop.