procmail
[Top] [All Lists]

Re: Counting hits

2004-06-03 09:39:58
On Thu, 3 Jun 2004, Dallman Ross wrote:


On Wed, Jun 02, 2004 at 10:02:00PM -0400, fleet(_at_)teachout(_dot_)org wrote:

I've come up with the following scheme to count "hits." I have a
couple of questions below the example:

I am not clear on what you are counting.  What do you consider "hits"?

"Hit" is any reaction to the condition line that would "activate" the
action line.  I'm looking for spam indicators, of course.

I have in any case trimmed all but some action lines in order to make
a point:

| echo -e 0 > spamtest/$PID.ctr

  | read var < spamtest/$PID.ctr && let var=var+1 && echo $var > 
spamtest/$PID.ctr

SPAMVAL=`cat spamtest/$PID.ctr`

| rm spamtest/$PID.ctr

Whatever you're counting, I have a hard time understanding why you need
four different pipes to shell and/or file writes to do it.  That seems
tremendously inefficient.

I agree it's inefficient.  I just can't come up with anything better to do
what I'm trying to do.  I want to be able to identify the condition that
got tripped, and total the "hits" for each message.

You ought to be able to count most anything right in native procmail
language.

I tried scoring; but got confused.  In any event, I wasn't sure I could
construct a scoring recipe that looked like:

:0
* -5^0
* 1^1 condition
* 1^1 condition
* 1^1 condition

# repeated 35 or 40 times (with different conditions on each line, of
course.)

spam

Even if I did something like the above, how would I identify which of the
conditions got "hit" and place that info into the header.

Maybe you can explain at a more basic level what you are trying to do?

Basically, I'm trying to identify a spam condition, assign a number value
to it, and "formail" the condition description into the header of the
message. (I can do the formail part - in an equally inefficient manner -
and don't have that part included in the example.  I suppose it would
replace the "LOG" function eventually.)

                                - fleet -



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