Subject: Re: Finger And Procmail

From: [email-masked] (David W. Tamkin)
Date: Mon, 15 Aug 1994 10:54:18 -0500 (CDT)

Jerry Alexandratos wrote,

+ Then, just to be complete, I put the following recipe in as the first
+ line of my .procmailrc
+ 
+ :0 c
+ | /usr/5bin/touch `date +%m%d%H%M%y` /usr/spool/mail/darkstar

When I saw Jerry's recipe, I was all ready to comment with unsolicited
advice, but ...

+ So, when I'm fingered it looks right.  However, I've noticed that
+ sometimes I get an error from procmail.  It's only with the processing
+ of the touch recipe.   It reads as follows
+ 
+ ## procmail: Error while writing to "/usr/5bin/touch"
+ 
+ My question is this--Should I just ignore it?  At first I thought that
+ maybe it was making multiple attempts to touch the file, while one was
+ actually touching it (thus locking out the other attempts).  Or, is
+ there something going on?

So it won't be unsolicited after all.  That's the very question I was going
to answer.

procmail feeds text to pipe actions when the recipe conditions match; touch
is a program that couldn't care less about standard input and doesn't read
it.  Thus procmail is writing to a pipe that won't read.

Suggestion 1: use the 'i' flag.  Use it whenever a pipe action will ignore
input.  It tells procmail not to care if there is a write error.

Suggestion 2: you can't prevent procmail from trying to write to the pipe,
so at least cut the work down by using the 'h' flag (usually headers are
smaller than bodies; headers are never larger than entire messages).

Suggestion 3: use the $ORGMAIL variable instead of hard-coding the path
to /usr/spool/mail/darkstar, just in case the mail administrator moves
the spool and doesn't make a symlink under the old name.
  
  :0 chi
  | /usr/5bin/touch `date +%m%d%H%M%y` $ORGMAIL

Suggestion 4: doesn't your version of touch default to using the current date
and time?  Do you really have to run date every time a letter arrives?
  
  :0 chi
  | /usr/5bin/touch $ORGMAIL

+ Now I don't think that I'm losing any mail, but you never know.

If you are, that recipe isn't the reason.

David W. Tamkin  P. O. Box 3284  Skokie IL  60076-6284
[email-masked]   MCI Mail: 426-1818   +1 312 714 5610