procmail
[Top] [All Lists]

Re: Question About Logging.

2003-05-30 11:09:20
On Fri, 30 May 2003 00:09:36 -0700, PSE-L(_at_)mail(_dot_)professional(_dot_)org
(Professional Software Engineering) wrote:

Hi Sean,

Thank you for responding.

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).


That was for the purpose of just setting the sandbox, to test the recipe
before going live with it.


LINEBUF=65536

Perhaps a little overboard with the linebuf there?

Ture, for this small recipe, but I copied this from my main procmailrc
where I had a problem with procmail exceeding line buffer, and had to
increase it.


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"

Oops!

You got me here, it was a bit late in the night.


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).


Forgot that too, thank you for pointing it out.

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


Thank you for the explanation.




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