[Mimedefang] Both_Receive
Carol Man
mimedefang at yahoo.com
Tue Jul 8 08:53:00 EDT 2003
Hi,
well, I really tried to make it work, but it didn't
work!! Can anybody help me? =)
I would like my Mimedefang/SpamAssassin do two
things:
- administrator receive the Mimedefang Report,
SpamAssassin Report and entire message
- sender receive a notification telling that his
message was blocked (don't send his message back to
him)
Here is part of my code:
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");
# If you find the SA report useful,
add
# it, I guess...
action_add_part($entity, "text/plain",
"-suggest",
"$report\n",
"SpamAssassinReport.txt", "inline");
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");
foreach $recip (@Recipients) {
delete_recipient($recip);
}
add_recipient($AdminAddress);
} else {
action_add_header("X-Spam-Status",
"No");
}
# if we're quite confident it actually
# IS spam, just bounce it
if ($hits > 5) {
return
action_quarantine_entire_message();
action_bounce("Message seems to be
spam, rejected");
}
} else {
# Delete any existing X-Spam-Score
# header?
action_delete_header("X-Spam-Score");
}
# Now this is the real filter_end
sub filter_end ($) {
my($entity) = @_;
# Do the real work
filter_end_aux($entity);
# And send notifications
send_quarantine_notifications();
}
}
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
More information about the MIMEDefang
mailing list