cowboy me, 2.0: jose nazario beauty and the street


mail sorting and reporting

just this evening was talking with jeff about sorting incoming mail via procmail and jeff mentioned how unwieldy his logs get. i pointed out my shell initialization script reports the sorting it did:
echo "new mails:"
grep -i folder ~/proclog | awk '{print $2}' | sort | uniq -c
cp /dev/null ~/proclog
of course i also use ifile to sort between spam and non-spam:
$ cat .procmailrc 
SHELL=/bin/sh
VERBOSE=no
PATH=/home/jose/bin:/usr/local/bin
DEFAULT=/var/spool/mail/jose
LOGFILE=$HOME/proclog
IFILEFOLDER=`/home/jose/bin/ifile -q | /bin/head -1 | /usr/bin/awk '{print \$1}'`

# Deliver to folder ifile told you to; this is for Berkeley folders :0 :$IFILEFOLDER.lock mail/$IFILEFOLDER
this is pretty handy. now when i log in i get my mail counts as part of my login message:
new mails:
      5 mail/spam
and at the end of it i get a blank procmail logfile, which makes it consume less disk space and always be fresh. if you're not doing large scale trending on your filtering this can be useful. (if you are, you can always push it off to the side and keep your immediate logfile as a counter.)

|

----

| archives

Last modified: Sunday, Jul 20, 2003 @ 10:27pm
Weblog Commenting and Trackback by HaloScan.com

Your Ad Here

copyright © 2002-2014 jose nazario, all rights reserved.