procmail
[Top] [All Lists]

Re: logging Date, From To and CC?

2012-09-15 11:22:25

Subject: Re: logging Date, From To and CC?
Date: Fri, 14 Sep 2012 07:48:02 -0500
From: rader(_at_)hep(_dot_)wisc(_dot_)edu

 > > Does anyone have a recipe (patch?) for logging Date From To and CC
 > > when LOGABSTRACT is set??
  

[ sneck -- original recipe details ]


Hum.  That makes me wonder: how does one log the matching rule??
 
To do -that-, you either assign a 'name' to the recipe, and log the name,
e.g. 

    :0  # recipe foobar
    * {whatever}
    {  LOG="** Recipe: foobar ${NL}"
       ... {as above]

or you explicitly write the rule(s) twice, as in
    :0
    * {whatever no 1}
    * {whatever no 2}
    * {whatever no 3}
    {  LOG="** Match on: {whatever no 1} ${NL}"
       LOG="** Match on: {whatever no 2} ${NL}"
       LOG="** Match on: {whatever no 3} ${NL}"
       ... {as above]
    
Approach #2 has the disadvantange that you have to update the rule
in two places to maintain "consistency" between what is actually 
being tested, and what is being reported.
Depending on your needs, it might be simpler to simply set
the VERBOSE variable to yes, or 1.  this will auto-log _all_
rule matches, *non* matches, variable substitutions, etc.
'Noisy', but shows exactly what's going on, at every step.

BTW, if it wasn't  obvious. all this works *without* LOGABSTRACT being set.
If you want the logging _only_if_ LOGABSTRACT is set, then bracket the 
group of LOG= lines with
  :0
  * LOGABSTRACT ?? (1|yes|true)
    {
       [[ LOG= lines go here ]]
    }


Note well that the variable name before the '??' does *NOT* have  $ in front
of it.


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail