MIMEDefang Script Modification by Jeffrey Thompson:
# Thanks Martin Bene for helping me get started with this script
#
sub filter_begin {
my $bounce = "no";
# Don't run SA against messages bigger than 200k
if ((-s "./INPUTMSG") <= (200 * 1024)) {
my($hits, $req, $names, $report) = spam_assassin_check();
$SAReport = $report;
if ($hits >= $req) {
action_add_header("X-Spam-Warning", "SpamAssassin says this message is SPAM");
action_add_header("X-Spam-Status", "Yes, hits=$hits required=$req");
action_add_header("X-Spam-Report","$report");
} else {
action_add_header("X-Spam-Status", "No");
}
# if we're quite confident it actually IS spam, just bounce it
if ($hits > 10) {
$bounce = "yes";
action_quarantine_entire_message();
action_bounce("Message seems to be spam, rejected");
}
}
# if we haven't bounced the msg yet lets do some more tests
if($bounce eq "no") {
open(IN, "<./HEADERS");
while() {
if(/beleskari/i) {
$bounce = "yes";
action_quarantine_entire_message();
action_bounce("Porn not welcome here");
last;
}
}
# if($bounce eq "yes") {
# send_quarantine_notifications();
# }
close(IN);
}
}
It's a start :-) I'm learning too. Feel free to suggest improvements or modifications.