procmail
[Top] [All Lists]

Re: notification

1996-11-08 09:39:47
On Nov 8, "R. Wayne McCorkle" wrote:

I am fairly new to procmail, but seem to have it working smoothly. It is 
certainly nice if one is subscribed to multiple mailing lists. My 
question concerns biff, or other mail notification. I wanted to know what 
people use in general in conjunction with procmail. If possible, I would 
like a running tallly of where mail is going, maybe like a console type 
of application.

Well, I'm not very good at this- but this is the sleazy hack solution
I use for that. The recipes for high-priority mail that I'd like to be
notified about specify a little script I call "biffilter", which
echoes the appropriate stuff to the console device with a ^G to flash
the window (my machine has no speaker, thank Gawd...), just like good
old biff used to. Here's a recipe that uses it- it calls the filter
with an argument, which is the name of the folder the mail is going
to:

BIFFILTER=/home/skod/bin/biffilter

:0              
* ^X-Diagnostic
| $BIFFILTER listadmin >> listadmin


And here's the script itself:

#! /bin/sh

owner=skod
maildir=/home/skod/mail
mboxdir=/usr/spool/mail
mbox=$mboxdir/$owner

cd $mboxdir
file=newmail$$

# grab the mail form procmail and stick it in a temp file
cat > $file 

echo -n "New $1 mail from" >> /dev/console

# strip out the headers you want to see and dump 'em to the console
formail -x From: < $file >> /dev/console
formail -X To: -X Subject: < $file >> /dev/console
echo "-----------" >> /dev/console

# reassemble the mail and hand it back to procmail
formail < $file 

rm -f $file
exit 0

It dumps a quick little 3-line summary to the console, viz:

-----------
New procmail mail from "R. Wayne McCorkle" 
<wmccorkl(_at_)porter(_dot_)psl(_dot_)nmsu(_dot_)edu>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: notification
-----------
        
It's pretty simpleminded, but it works for me. I'm sure that it can be
done much more elegantly by the folks here who've been at this for a
long time- but since I'm a hardware guy and not a software guy, I
chose the lazy man's way out. Use it in good health!

-skod

--
Scott Griffith, Sun Microsystems Lumpyware
Who didn't have _anything_ to do with the 386i...
Nope, not a bit. Nothing at all. Not me, nosir. Nope.
Return Path : skod(_at_)Sun(_dot_)COM



<Prev in Thread] Current Thread [Next in Thread>