I use this for dropping virus infected emails. You could apply the same
to SPAM, but it would not be recommended because no spam filter is 100%
effective and that would result in a small percentage of good mails
being deleted.
**********************************
if (/was a virus\/worm\/trojan. It was removed./:b)
{
logfile "/var/log/maildrop.log"
log "VIRUS DETECTED"
to "/dev/null"
}
**********************************
~Rolan
This will cause maildrop to error out, believing that mail delivery
failed for a temporary reason. Maildrop will retry for 3 days or so
and then give up, possibly returning a delivery failure to the sender
(which in the case of spam, will be faked). This also is not what you
want.
Once maildrop is handling an email, the SMTP session has ended, your
mail server has accepted the message, there is no way to then reject
it. You could *bounce* the email back to the sender but this is very
bad form and most spam has a faked sender anyways so it's quite
pointless, don't do it. To toilet bowl a message use: