I would like to use maildrop to bounce a message that has a high SpamAssassin
score.
Here is my setup so far:
in courierd:
===================
DEFAULTDELIVERY="| /usr/local/bin/maildrop"
in maildroprc
===================
logfile "/var/vmail/maildroplogs/filter.log"
# do SpamAssassin and get score
exception {
xfilter "/usr/local/bin/spamc"
}
/^X-Spam-Score: (\d\d\.\d)/:h
log "Spam Score Test: [$MATCH1]"
# Spam Management Begins Here
# bounce high score messages
if ( $MATCH1 > 15.0 )
{
log "Message Reject :: EXITCODE 0 :: Exiting Delivery"
EXITCODE=0
exit
}
# divert spam to junk folder
if ( $MATCH1 >= 8.0 )
{
to /var/vmail/aldisa/admin/Maildir-Junk/.junk
}
# diver suspect to spam folder
if ( $MATCH1 >= 5.0 )
{
to /var/vmail/aldisa/admin/Maildir-Junk/.spam
}
===================
There is no problem with deliverying the junk and spam messages to the
respective folders. The high score messages do not get delivered -- they just
disappear -- and the mail logs show a successful message delivery. This is
not a bad thing, but I would prefer to bounce them. The localmailfilter docs
state that for rcptfilters, you can specify an exit code between 0 and 99, and
it will bounce the message. I tried to use an EXITCODE of 1, but this just
defers delivery. The maildropfilter docs don't really say how to bounce a
message, except maybe mailing it back to the sender.
Thanks in advance for any advice and Happy New Year to all.
Abid