#!/bin/sh # cd /u9/psionic/mail/spam/ [ "x$1" = "x-s" ] && SUMMARY="| head" && shift [ "x$1" != "x" ] && FILE=$1 || FILE='*' FILE=`sh -c "echo $FILE"` # Where is the spam actually aimed at? grep '^Delivered-To' $FILE | cut -d" " -f 2 - | sort | \ uniq -c | sh -c "sort -rn $SUMMARY" # What kind of point values are we getting? grep '^X-Spam-Level' $FILE | grep '\*' | \ cut -d" " -f 2 - | sort | uniq -c | \ perl -ne 'm!^\s*(\d+)\s+(\*+)!; print "$1 emails with ".length($2)." points\n";' | sh -c "sort -rn $SUMMARY"