Okay, I've successfully set up a simple perlfilter that calls spamc to
determine whether a piece of email is spam. It returns "500 Spam" or
"", depending on the return value of spamc. The relevant code is
REALLY simple:
if (system("spamc -c < $filename &>/dev/null"))
{
return "500 Spam."
} else {
return "";
}
The problem I'm having is that DSN's contain the original email and
are also detected as spam. So I'm seeing multiple errors in the log
where Courier keeps trying to send a DSN and fails because the global
filter is rejecting it.
I suppose I could just ignore the situation, as courierdsn will give
up after about 4 retries. But that means that every piece of spam
will be processed by spamassassin 5 times before going away.
I've modified my filter so that it won't bounce or scan DSN's, but I'd
really rather drop spam directly into the bit-bucket, as the DSN's are
often undeliverable because of bad envelope return addresses.
Is there any way a global filter can signal Courier to drop a message,
without sending a DSN?
I suppose I could turn off DSN's entirely, but that seems a little
extreme.
Comments? Suggestions? Criticisms?