procmail
[Top] [All Lists]

Re: LOG & LOGABSTRACT question

2001-02-19 06:25:05
David and List;
Tom and Dallman, thanks for jumping in on this one.
David, a  warm thank you for such an elegant and comprehensive answer.
No wonder I've learned so much from this list over the years!!!
I post rarely with questions, but when they are answered, I always take
big forward strides in knowledge as a result.
-Colin
On Sun, 18 Feb 2001, David W. Tamkin wrote:

Colin asked,

| I've never tried this, but can you define on a per-recipe basis whether to
| log not to log? as opposed to per xxxrc file?

Yes.  S. Toms started to illustrate how and came pretty close.  In the
following examples, don't use a local lockfile if the folder is a directory:

 :0 flags
 * conditions
 {
  LOGABSTRACT=on
  :0:
  folder
 }

or

 :0 flags
 * conditions
 {
  LOGABSTRACT=off
  :0:
  folder
 }

Of course, you would set LOGABSTRACT at the top of the rcfile to whichever
value applied to the majority of your recipes and you'd use these forms only
for the minority.  For those in the majority,

 :0 flags:
 * conditions
 folder

| As a followup question, does LOGABSTRACT give just a brief synopsis of the
| arrival and handling of a message?

If you set LOGABSTRACT to `on' (or an equivalent, such as `yes' or `true' or
a non-zero number) and a logfile is defined, procmail logs the From_ line,
the subject, the folder to which final delivery was made and the number of
bytes written to it.  If you set it to `all,' procmail also logs the same
information for every delivery of a copy.  I pad my logabstracts through use
of the LOG special and the TRAP (whose stdout goes to the logfile unless you
redirect it), so they carry a lot of additional information.

| and is LOGABSTRACT=on the default behaviour if a logfile is named?

I believe it's the default behavior, period, and a logabstract will be writ-
ten to stderr.  If you never set the LOGFILE variable, stderr goes where the
parent process that invoked procmail had it.  If the LOGFILE variable is set
but null, or if it was set and then unset, then file descriptor 2 is closed
and stderr goes nowhere.  To prevent procmail from writing the abstract, you
need to set LOGABSTRACT to `off' (or `no` or `false` or `0').


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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