procmail
[Top] [All Lists]

Re: How to change LOG verbosity?

2002-05-04 11:25:03
Ruud asked,

| My LOG-entries all come from LOG=. I could collect everything
| in a TOLOG-variable first, and use LOG="$TOLOG" at the end,
| but would rather do that through TRAP.

Yes, it's much better to do it through a trap, because that way you don't have
to make sure that every message will get to the place where you assign
LOG="$TOLOG" in your .procmailrc.

| Is that possible?

Easy as pie:

 TRAP='echo "$TOLOG"'

Note the strong quotes around the command [so that $TOLOG will be evaluated
when the trap is executed, not when the trap is defined] and the weak quotes
around the variable [so that tabs, newlines, and multiple spaces inside it
will be preserved].  Stdout of TRAP goes to the logfile (unless you redirect
it).  If there by some oddity should be no 'echo' executable in $PATH, force a
shell:

 TRAP='echo "$TOLOG";'

I do nearly the same thing now, except that, being a silly person, I call the
variable FLOG.



_______________________________________________
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>