Like everyone else said, this is better done at the MTA.
Problem is, you often can't determine wether the mail is spam
or not until after you've received the email and analyzed it - and
by that time it has already done the damage to your bandwidth
and CPU. Sending the mail back isn't going to fix anything.
My reports show that roughly 90% of incoming mail to
my server is spam.
Running tests before and after, I have found RBL's to block
about 93% of the incoming spam. Of the remaining 7%, Spamassassin
effectively detects and diverts 5%, ultimately letting through
about 1-2% of the unwanted spam. Oh, BTW, I have not had a false
positive on the spam detection in months.
A while back, when I was receiving 400+ spam emails a day,
I did an experiment with a maildrop filter that would
detect spam and send a bogus "undeliverable" message back to
the sender. Most of the spam does have forged headers and sad to say,
the experiment did not reduce the incoming spam by any detectable level.
~Rolan
Generic Player wrote:
I have maildrop setup with a simple config to check mail using
spamassassin. What I haven't been able to figure out is how I can send
back an error to the sender if spamassassin's says the mail is spam,
instead of delivering the mail. Is there a way to generate a 550: this
is spam or something from maildrop?