[Mimedefang] MD 2.30 having probs with SpamAssassin 2.50
Paul
freebsd at pksnet.com
Wed Mar 12 11:31:01 EST 2003
I've looked at it from all different angles but can't seem to get it to work like I want to.
What I want is for the MD/SA Combo to bounce all mails SA rates 12 or higher and not stick on the SA report. I changed /etc/mail/mimedefang.cf accordingly based on the How-To page. But still, although flagged with an SA attachment and the ***** in the header, they get thru to the user.
Anybody able to tell me what I did wrong? (System FreeBSD 4.7) Also, although I have both NAI and clamav installed, mimedefang.pl -features shows both as missing.
Thanks in advance for your help
Here's my modified 'filter_end()'
=======================
sub filter_end ($) {
my($entity) = @_;
# If you want quarantine reports, uncomment next line
# send_quarantine_notifications();
# IMPORTANT NOTE: YOU MUST CALL send_quarantine_notifications() AFTER
# ANY PARTS HAVE BEEN QUARANTINED. SO IF YOU MODIFY THIS FILTER TO
# QUARANTINE SPAM, REWORK THE LOGIC TO CALL send_quarantine_notifications()
# AT THE END!!!
# No sense doing any extra work
return if message_rejected();
# Spam checks if SpamAssassin is installed
if ($Features{"SpamAssassin"})
{
if (-s "./INPUTMSG" < 100*1024)
{
# Only scan messages smaller than 100kB. Larger messages
# are extremely unlikely to be spam, and SpamAssassin is
# dreadfully slow on very large messages.
my($hits, $req, $names, $report) = spam_assassin_check();
if ($hits >= $req)
{
md_log('spam', $hits, $RelayAddr);
my($score);
if ($hits < 40)
{
$score = "*" x int($hits);
}
else
{
$score = "*" x 40;
}
# We add a header which looks like this:
# X-Spam-Score: 6.8 (******) NAME_OF_TEST,NAME_OF_TEST
# The number of asterisks in parens is the integer part
# of the spam score clamped to a maximum of 40.
# MUA filters can easily be written to trigger on a
# minimum number of asterisks...
action_change_header("X-Spam-Score", "$hits ($score) $names");
action_add_header("X-Spam-Status", "Yes, hits=$hits required=$re
q");
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 > 12)
{
action_quarantine_entire_message();
action_bounce("Message seems to be spam, rejected");
}
# If you find the SA report useful, add it, I guess...
# action_add_part($entity, "text/plain", "-suggest",
# "$report\n",
# "SpamAssassinReport.txt", "inline");
}
else
{
# Delete any existing X-Spam-Score header?
action_delete_header("X-Spam-Score");
}
send_quarantine_notifications();
}
}
# DO NOT delete the next line, or Perl will complain.
1;
============================
--
Paul
More information about the MIMEDefang
mailing list