[Mimedefang] MDLOG Problem
Mike Carlson
mike at mcarlson.net
Tue Jul 24 15:56:33 EDT 2007
I am running into a slight problem with the MDLOG it seems to be adding
duplicate lines to the log file. Here is a sample:
Jul 24 12:34:23 hades mimedefang.pl[10701]:
MDLOG,l6OHYM2D012980,spam,8.952,70.241.254.162,<xktg at ppll.fsnet.co.uk>,<to
rres at domain.com>,You've received a greeting ecard from a Neighbour!
Jul 24 12:34:23 hades mimedefang.pl[10701]:
MDLOG,l6OHYM2D012980,mail_in,,,<xktg at ppll.fsnet.co.uk>,<torres at domain.com>
,You've received a greeting ecard from a Neighbour!
I assume its something I munged in the filter. Here is a snippet from the
mimedefang-filter. This is the only part I made mods to other than the
variables at the top.
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();
my($score);
if ($hits < 40) {
$score = "*" x int($hits);
} else {
$score = "*" x 40;
}
# delete all inbound email if it scores higher than 11
if ($hits >= 12) {
# md_graphdefang_log('spam', $hits, $RelayAddr);
md_graphdefang_log('sa_discard_score', $hits, $RelayAddr);
return action_discard();
}
# 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...
# We want to know what tests triggered the scores for each
email.
action_change_header("X-Spam-Score", "$hits ($score)
$names");
if ($hits >= $req) {
#action_change_header("X-Spam-Score", "$hits ($score)
$names");
action_change_header("Subject", "(SPAM) $hits $Subject");
md_graphdefang_log('spam', $hits, $RelayAddr);
# 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");
}
}
}
# I HATE HTML MAIL! If there's a multipart/alternative with both
# text/plain and text/html parts, nuke the text/html. Thanks for
# wasting our disk space and bandwidth...
# If you want to strip out HTML parts if there is a corresponding
# plain-text part, uncomment the next line.
# remove_redundant_html_parts($entity);
md_graphdefang_log('mail_in');
Any help is appreciated.
More information about the MIMEDefang
mailing list