[Mimedefang] Script for categorizing spam by hits?

Arthur Corliss corliss at digitalmages.com
Thu Jul 14 14:56:44 EDT 2005


On Thu, 14 Jul 2005, Matthew Thomas wrote:

> Does anyone have a script written to loop through mail logs and return
> the number of spams (via spamassassin) categorized by hits?
>
> For example:
>
> Hits:     	Count:
> 5-7		1234
> 7.01-9      2345
> 9.01-12     3456
>
> And so on.  If you have such and would be willing to send it to me, I'd
> appreciate it.

I do have a script that I use to figure out what rules are being effective by
looking at the number of ham & spam it matched against, along with the average
score of those e-mails.  Generates a report in the format of:

Rule                                 Pts       Ham     Spam   Pcnt  Avg Scr
---------------------------------------------------------------------------
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  @>>>>>>   @>>>>>>  @>>>>>>  @>>>>  @>>>>>>
$rule,                           $pts,     $ham,    $spam,   $pcnt, $avgsc

This lets you see how strongly the artifact you're testing for is affiliated
with actual spam, and what percentage of ham might be impacted.  I find this
helpful in assigning scores to the various tests, among other things.

The only problem with this is that it requires that you save a copy of each
spam report (I save every report that my custom rules hit against for a
period).

I also have a mail reporting script that somewhat does what the above asks
indirectly.  It reports the total mail handled, tagged, quarantined, and
denied altogether, which correlates with different score thresholds in my
implementation.  Of course, this script also relies on debugging entries in
the syslogs, so it may require modification to your filter script.

If anyone wants the scripts, I can make them available.

	--Arthur Corliss
	  Bolverk's Lair -- http://arthur.corlissfamily.org/
	  Digital Mages -- http://www.digitalmages.com/
	  "Live Free or Die, the Only Way to Live" -- NH State Motto



More information about the MIMEDefang mailing list