procmail
[Top] [All Lists]

Re: LOGFILE

1998-03-04 13:25:38
Christopher Lindsey suggested,

| If you want to avoid the extra system call and don't need $MATCH for
| anything else, you can do this

|    :0 c:
|    * ^From:\/.*
|    Mail/archives/$DATE.in
| 
|    LOG="From: $MATCH"

Actually, it's going to be more like this ... and Terry would have to do it 
for EVERY delivering recipe:

   :0c:
   * other conditions
   * ^\/From: .*
   folder
    :0A
    { LOG="$MATCH
"
      LOGABSTRACT=off

     :0h
     /dev/null
    }

because Terry wanted a From: line logged for all deliveries.  Worse, because
the logfile is not locked, a separate LOG= assignment runs a greater risk of
intermixing log data from different pieces being delivered at the same time
than TRAP does, because TRAP output and the logabstract are pretty much
written together.

Era Eriksson has suggested extracting the From: line into MATCH (as was
Christopher's idea, but with some small fixes) and then logging it with
an echo command in TRAP.  The thing I'm thinking is that a process to run
/bin/echo is not much worse than a process to run formail, and if there is no
/bin/echo a shell call to use a built-in echo is if anything worse than
running formail, and it doesn't require resetting MATCH at the last minute
with an extra condition in every delivering recipe.

Usually I'm near the front of the line to campaign for saving processes,
but this, I think, is an exception because of the extra work for the human
and for procmail.

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