[Mimedefang] Script for categorizing spam by hits?
Renaud PASCAL
renaud.pascal at atosorigin.com
Tue Jul 19 10:29:10 EDT 2005
Le Jeudi 14 Juillet 2005 17:19, Matthew Thomas a écrit :
> 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.
Well, not exactly the same slices, and not in the same cols/rows order,
also, hum, let's say "the beautifying is quite rough" ...
but it may give you a start ;-)
# gawk '/spam,/{ v[int( $4/5)]++}; END{for(i in v){print " scores "5*i" to "5*(i+1)", have:" v[i]" hits"} }' FS=, .../yourmaillog
scores 20 to 25, have:253 hits
scores 25 to 30, have:245 hits
scores 30 to 35, have:53 hits
scores 35 to 40, have:11 hits
scores 40 to 45, have:1 hits
scores 5 to 10, have:467 hits
scores 10 to 15, have:327 hits
scores 15 to 20, have:138 hits
Anad, a quick check of the count
(as these roundings and indexes are quite often a booby trap ;-) :
# grep -c spam,3.\. .../yourmaillog
64
More information about the MIMEDefang
mailing list