[Mimedefang] Reject er bounce message, but send the message to a central mbox or file?
Tory Blue
tmblue at responsys.com
Mon Aug 9 20:42:57 EDT 2004
I'm having some issues here.
I have tried to add a few things to filter_end to no avail. I have a bounce
notice if any score is higher then X, that works fine (it's a return
action_bounce).
I would like to bounce the message but retain it for future investigation,
analysis or cleanup and bayes learning. Alternatively if I was not going to
try to train the system, it would be nice just to capture the header and
send that to a separate box for investigating complaints that messages were
rejected or not received.
Filter_end:
Stuff......
my($hits, $req, $names, $report) = spam_assassin_check();
if ($hits > 8) {
return action_bounce("Your message from $RelayAddr scored
$hits on our Spam meter and therefore is being rejected. If you feel this is
in error, please contact the user by alternative means to have this issue
resolved.");
}
Above works fine: But when I try to move the mail to a central spam
respository, I fail.
if ($hits >= $req) {
# Add a header with original recipients, just for info
action_add_header("X-Orig-Rcpts", join(", ", @Recipients));
# Remove original recipients
foreach $recip (@Recipients) {
delete_recipient($recip); }
# Send to spam address
add_recipient('is_spam at example.com');
}
Above all inclusive does not work. I have tried to add a return discard at
the end but that doesn't work, I reject and discard but don't seem to send
the message off to (is_spam at example.com)
Below works fine:
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...
if ($hits >= $req) {
action_add_header("X-Spam-Status", "Yes, hits=$hits
required=$req $names");
action_add_header("X-Spam-Level", $score);
action_add_header("Precedence", "bulk");
md_graphdefang_log('spam', $hits, $RelayAddr);
} else {
# Delete any existing X-Spam-Score header?
action_delete_header("X-Spam-Score");
}
}
}
Thanks
Tory
More information about the MIMEDefang
mailing list