procmail
[Top] [All Lists]

Re: recipe problem

1998-10-07 04:54:18
On Tue, 6 Oct 1998 18:38:40 -0500, Chuck Campbell 
<campbell(_at_)inexs(_dot_)com>
wrote:
:0:
LOG=sender
* ^Sender:.*porschelist
porsche

Like Vivek Mittal already pointed out, the basic syntax error is that
you need to put the LOG assignment and the delivering action inside a
block. The other thing is what exactly you want logged. The following
looks like you would really like to see the literal string "sender"
in the log, but I'll assume that's not really what you want.

and I hoped to see something like this in the log file:
From campbell(_at_)Starbase(_dot_)NeoSoft(_dot_)COM  Tue Oct  6 17:07:01 1998
 Subject: Re: Case of the bizarre bootstrap...
  Folder: rh                                                               
3959
sender

Usually, the log entry for the present delivery is the last thing
Procmail writes out before quitting. You can play around with the TRAP
pseudovariable if you really absolutely want the log message to be
after the regular log entry. The following will extract the keyword
matched in the condition into the log before the regular log message:

    :0
    * ^Sender:(.*\<)?\/porschelist
    {
        LOG="$MATCH
"
        :0:
        porsche
    }

Even more generally, you could do something like

    LOG="Sender: "`formail -rzx`"
"

to get some fairly useful stuff in the log.

Hope this helps,

/* era */

-- 
Bot Bait: It shouldn't even matter whether  (`')  Just  (`')  http://www.iki
I am a resident of the State of Washington   \/ Married! \/   .fi/~era/

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