procmail
[Top] [All Lists]

Re: help with scoring & size condition

2003-01-10 16:09:38
Matt Garretson <mattg(_at_)assembly(_dot_)state(_dot_)ny(_dot_)us> wrote:


I'm having a problem with a scoring recipe, in which
I want one of the conditions to hinge on the message
size.   Let's say i want to match messages greater
than 5000 bytes (temporarily ignoring the other scoring
conditions):

:0
* -1^0
*  2^0 > 5000
{
    LOG="SIZE GREATER THAN 5000${NEWLINE}"
}

In fact I can't find a message, no matter how large or small,
that will not match that recipe.  Am i doing something wrong?


I fell for the same issue a couple of months ago.  It seems
to be an area of procmail that is not at all well-documented
(ahem, Phillip!).  The upshot, though, is that you can't
combine scoring and the match token ( `<' or `>' ).
It's a bit of a pain in the rear, actually.  This issue
caused me hours of testing before I figured it out.

That is the reason my recipe for finding "list noise," as I
call it, looks the way it does.  I posted it a few days
ago, but here it is again:

     :0  # 030106 () look for list noise
      *             SUBJECT  ??  ()\<(remove|unsubscribe)\>
      *           ! SUBJECT  ??  ^^(Fw(d)?|Re):
      *    850^0    CTYPE    ??  (html|multipart)
      *    500^0    CTYPE    ??  (ascii|plain)
      * $  500^0    CTYPE    ??  $FALSE
      {
          :0:  # 030106 () if body within limits, delete list noise
           * $  B  ??  < $=
           $TRASH/listnoise
      }


Be careful: "$SUBJECT" and "$CTYPE" are private variables of
mine -- as is "$TRASH".  I have defined them earlier in
my rc to the contents of Subject:, Content-Type:, and
space under /var/tmp, respectively.  Oh, and "$FALSE"
is another one: it has been defined in my rc to "^^^^".

Anyway, back to your issue, I had to sort of kludge my
size test to avoid having to use it with scoring, for
the same reason you cite.

Btw, I wrote a longish response earlier tonight to another
list question, about supremum, but I foolishly sent the
mail off using an address that is not subscribed to the
list.  So who knows when, if ever, the administrator
will get around to approving that submission.  I don't
have a backup copy, unfortunately, which ticks me off no
end (because I refrained from Cc'ing the person asking,
on account of flack about Cc's that ensued on the 1st;
so no nobody has a copy but the list administrator.  And
he has not been heard from for weeks and weeks). :-(

-- 
dman


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