[Mimedefang] Spam Assassin Reject

Ken March ken at implant.net
Tue Jul 2 21:19:56 EDT 2002


On Tue, 2 Jul 2002, Chad Stalvey wrote:

> Mimedefang is working and calling spamassassin fine. The email goes through
> with an attachment of the spamassassin report. How or where can I make it
> just reject those messages?

I do this in my filter_end():

# if hits > req * 2, then its definite spam, and bounce it - dont deliver
if ($hits >= ($req * 2)) {
   syslog ('info', "Bouncing mail - SpamAssassin reports $hits hits");
   return action_bounce ("@Recipients... User Unknown");
}

The return code is, of course, not a real user unknown message.. but
there are some braindead mass emailers out there who will remove your
address from their list upon seeing the text, so I figure why not.

Incase you're wondering why, I do required * 2 because my actual number of
required hits is low (to catch some of the less-obnoxious spam).  If it's
my required hits * 2, then as far as I'm concerned, it's DEFINITELY spam,
so I toss it.

In your case if you wanted to toss anything that was considered spam, then
a quick little thing like this would do the trick:

if ($hits >= $req)
   return action_bounce ("Spam spam spam eggs and spam");

or you could use action_discard() to silently discard it, etc..  All
depends on what you want to do.

Just make sure you don't set your required hits too low, cause you'll
start tossing legit mail!





More information about the MIMEDefang mailing list