procmail
[Top] [All Lists]

Re: Question About Logging.

2003-05-30 00:50:35
At 22:02 2003-05-29 -0700, Multimedia Fan wrote:

VERBOSE=On

SO, you set this BEFORE defining a logfile... You're much better off defining a logfile before enabling verbose. This is akin to turning on the faucet before putting a bucket under it.

LOGFILE=/var/log/test/procmail-test.log

A rather nonstandard place to put procmail logs, but I presume it's set up for you to work that way on your system (I _really_ hope you're not tinkering as root, because that's a bad practice to get into).

LINEBUF=65536

Perhaps a little overboard with the linebuf there?

NL="
"

:0
* B ?? (spammerdomain.com)
 {
  LOG="Bodyspam: $MATCH
  "

You DO realize what the NL= assignment a few lines earlier is for? So you don't have to embed newlines into log outputs in this fashion. Instead, use:

        LOG="Bodyspam: $MATCH$NL"

The recipe works as expected, except that it doesn't log what I am
telling it to.
[snip]

How so?

As you see procmail is  not adding the $MATCH string in the log file,
after the

Your message actually trailed off just as above.

What gives you the idea that $MATCH will be magically set? $MATCH is only set when you use the match operator \/, like so:

* B ?? ()\/(spammerdomain\.com)

(note that the dot in the domain really should be escaped, which you're not doing).

Having that \/ in that line will set the matched text into $MATCH - without it, you won't "capture" anything to $MATCH.


---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


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