Here's a snippet of what I did for mine. It's not a very elegant
solution, but it doesn't block all spam (only the most egregious,
that is, SPAM with a score over 10. From our experience, spam with a
score over 10 has a near zero chance of being ham).
###
# From top of script, exit codes
my $modifiedExitCode=7;
my $rejectedExitCode=4; # I don't think this code is in the original script
my $stopFiltersCode=16;
[ snip ]
###
my $isSpam="NOT SPAM";
my $exitCode=$modifiedExitCode;
if ($checkedEmail=~/X-Spam-Flag: YES/) {
$isSpam="SPAM";
$exitCode=$modifiedExitCode+$stopFiltersCode;
$checkedEmail=~s/(?<!\r)\n/\r\n/g;
$xmailHeader=~s/(?<!\r)\n/\r\n/g;
}
# If the X-Spam-Level matches 10+ *'s then reject the message
if ($checkedEmail=~/X-Spam-Level: \*\*\*\*\*\*\*\*\*\*+/) {
$isSpam="SPAM TO DELETE";
$exitCode=$rejectedExitCode+$stopFiltersCode;
}
# put first 6 lines back on returned message
# put it back in the file
open my $outHandle,">$fileName" or die("Can't open file $fileName for
writing");
print $outHandle $xmailHeader;
print $outHandle $checkedEmail;
close $outHandle;
# log results
logit($logHandle,"$isSpam from $from",$rcpt);
exit $exitCode;
###
If you wanted you could change the
if ($checkedEmail=~/X-Spam-Level: \*\*\*\*\*\*\*\*\*\*+/) {
line to be
if ($checkedEmail=~/X-Spam-Level: \*{$rejectSpamLevel}+/) {
and then set rejectSpamLevel to your preferred amount. (At least, I
think that would work -- I'm not remarkably good with Perl. Someone
else let me know).
I feel that's the best combination: reject what you know to be
complete trash, send on the maybes to your users.
Have a great day, all,
Toby
--
Toby Reiter mailto:[EMAIL PROTECTED]
Breezing Internet Communications http://www.breezing.com
1106 West Main St phone:434.295.2050
Charlottesville, VA 22903 fax:603.843.6931
-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]