procmail
[Top] [All Lists]

Re: \< and \> don't quite make it

2006-09-12 13:56:10
Hi,


On Thu 07 Sep 20:16, Mike Peeler wrote:
N.J. Mann <njm(_at_)njm(_dot_)f2s(_dot_)com> wrote:

I am trying to use scoring

You don't need to count, you only need to know if the filename occurs.

True for my example, but in the real recipe there are actually over 180
different pathnames.  I had never used scoring before and thought this
was a chance to give it a try.  It also seemed the easiest way of doing
a very long logical OR.

    :0 f
    * 1^1 ^Subject:.*\<ports/x11/xterm\>
    | formail -I "X-Status: F"

As well as matching on    ports/x11/xterm
it also matches on        ports/x11/xterm-whatever
which I do not want.

So far, this would do:

      *     ^Subject:.*\<ports/x11/xterm\/\>
      * ! MATCH ?? ^^-

The Subject line may contain one pathname/filename combination or
many.  Thus the ability to detect the end of a word by encountering
either whitespace or newline is what I am looking for.

OK, that tells me why you were trying to count.  Here's one that won't
get spoofed in the first place.  If "whitespace" simply means a space:

      *     ^Subject:.*\<ports/x11/xterm( |$)

This seems to work quite well: I haven't had any false positives so far
and have had lots of true positives since I switched to your suggestion.

Many thanks.


Cheers,
       Nick.
-- 
Captain Muller: "You boy! Your name will also go on the list. What is it?"
Captain Mainwaring: "Don't tell him Pike!"

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail