Re: procmail log tailing (was Re: mutt and noatime partitions)

2002-03-05 Thread David T-G

Cameron, et al --

...and then Cameron Simpson said...
% 
% On 17:15 02 Mar 2002, christophe barbé [EMAIL PROTECTED] wrote:
% | It seems there is no option to avoid the use of the access time.
...
% 
% Instead, I have my procmail recipe write a line to a log file when
% interesting email arrives (i.e. only when one of a few recipes fires).
% And I have a small window which tails that logfile. If I were in text mode I
% could just tail that log in the background.

I like this, and I've been looking for something this simple.  Can you
post or send your config for me to blatantly copy? :-)


TIA  HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg25045/pgp0.pgp
Description: PGP signature


Re: procmail log tailing (was Re: mutt and noatime partitions)

2002-03-05 Thread Christopher S. Swingley

David,

 % Instead, I have my procmail recipe write a line to a log file when
 % interesting email arrives (i.e. only when one of a few recipes fires).
 % And I have a small window which tails that logfile. If I were in text mode I
 % could just tail that log in the background.
 
 I like this, and I've been looking for something this simple.  Can you
 post or send your config for me to blatantly copy? :-)

I don't actually use this anymore (since someone mentioned
gkrellm-mailcheck), but this is the sort of thing I tried:

# Here's how we send the subject to the logfile
:0
* Subject: test
{
:0 c: logger.lock
| formail -X Subject: | logger -p kern.warn

:0:
/var/mail/cswingle
}

kern.warn probably isn't exactly the right facility and level to
use, but I wanted to make sure it showed up on my syslog server.
Maybe mail.info, or something.

Test first, I'm far from a procmail wizard.

Chris
-- 
Christopher S. Swingley   phone: 907-474-2689
Computer Systems Manager  email: [EMAIL PROTECTED]
IARC -- Frontier Program  GPG and PGP keys at my web page:
University of Alaska Fairbankswww.frontier.iarc.uaf.edu/~cswingle



Re: procmail log tailing (was Re: mutt and noatime partitions)

2002-03-05 Thread Mike Schiraldi

 I like this, and I've been looking for something this simple  Can you
 post or send your config for me to blatantly copy? :-)

I use a modified version of a program called root-tail
(wwwvarcx/root-tail) to tail -f my procmail log, /var/log/secure, and a
few other files Each one is displayed in a different color, directly onto
my root window (in other words, my desktop wallpaper)

If you're interested, reply directly to me and i'll send you my
modifications


-- 
Mike Schiraldi
VeriSign Applied Research



msg25053/pgp0.pgp
Description: PGP signature


Re: procmail log tailing (was Re: mutt and noatime partitions)

2002-03-05 Thread Cameron Simpson

On 15:37 05 Mar 2002, David T-G [EMAIL PROTECTED] wrote:
| % On 17:15 02 Mar 2002, christophe barb? [EMAIL PROTECTED] wrote:
| % | It seems there is no option to avoid the use of the access time.
| ...
| % Instead, I have my procmail recipe write a line to a log file when
| % interesting email arrives (i.e. only when one of a few recipes fires).
| % And I have a small window which tails that logfile. If I were in text mode I
| % could just tail that log in the background.
| 
| I like this, and I've been looking for something this simple.  Can you
| post or send your config for me to blatantly copy? :-)

Sure. Here's an example recipe:

: 0
* ^(to|cc|bcc):.*cs@zip\.com\.au
{

  : 0hc
  | mhdrs | { while read hdr body; do eval HDR_$hdr=\$body; done; alert -c 
yellow `timecode` +attn $HDR_FROM; $HDR_SUBJECT; }

  :0 whf
  | formail -A X-Label: Personal 

  : 0w
  | /usr/lib/nmh/rcvstore +attn -unseen
}

This catches email to me.

The internal part does 3 things: writes the logfile line, tags the message
with an X-Label header, and drops in into my Attention mailbox with MH.

You want the first bit.

Mhdrs is this script:

http://www.zip.com.au/~cs/scripts/mhdrs

which just recites the message headers in a shell-friendly form. For
example, this message gets:

FROM Cameron Simpson [EMAIL PROTECTED]
TO David T-G [EMAIL PROTECTED]
CC Mutt Users' List [EMAIL PROTECTED]
BCC 
SUBJECT Re: procmail log tailing (was Re: mutt and noatime partitions)
REPLY_TO [EMAIL PROTECTED]
IN_REPLY_TO [EMAIL PROTECTED]

and the while loop just picks these up and sets $HDR_FROM, $HDR_TO etc
to match.  After the while loop you do whatever you like. Which could
be as simple as:

echo $HDR_FROM; $HDR_SUBJECT your-log-filename-here

As you can see I pass it to yyet another script, but it's core purpose
it to write it to my alert logfile, in yellow.

Then my FVWM setup have a 3 line xterm running what is essentially
tail -f of this log file.
-- 
Cameron Simpson, DoD#743[EMAIL PROTECTED]http://www.zip.com.au/~cs/

This article could be hazardous to your credulity.
- Jim Brown [EMAIL PROTECTED]