procmail
[Top] [All Lists]

Re: regarding OR's on multiple lines

2008-06-17 04:31:13
In message <4856BB25(_dot_)9070404(_at_)stimulacra(_dot_)com>,
        TLD Procmail (tld(_dot_)procmail(_at_)stimulacra(_dot_)com) wrote:
N.J. Mann wrote:
Which won't work as you intend.  I suggest you look at the
example again a little more carefully.

  Are you suggesting I need to block-quote the OR part, like:

No.

The problem is the way you are using the continuation.  It _is_ a
continuation and not a separate rule line!  (And, you don't need the H's
as others have pointed out.)

:0
* H ?? ! ^TO_tld\(_dot_)procmail(_at_)stimulacra\(_dot_)com
* H ?? ! ^From:.*stimulacra\.com
{
  :0:
  * H ?? ^Subject:.*(phrase1|phrase2|phrase3)|\
  * H ?? ^Subject:.*(phrase4|phrase5|phrase6)|\
  * H ?? ^Subject:.*(phrase7|phrase8|phrase9)
  /mail/has_catch_phrase
}

:0:
* ! ^TO_tld\(_dot_)procmail(_at_)stimulacra\(_dot_)com
* ! ^From:.*stimulacra\.com
* ^Subject:.*(phrase1|phrase2|phrase3|\
phrase4|phrase5|phrase6|\
phrase7|phrase8|phrase9)
/mail/has_catch_phrase

Personally, I would have used one combined regexp or, if your real
application is much longer than you example above, scoring.  Another

  The real phrases are much longer.

  Quite frankly, the scoring thing flabbergasts me.  I don't
know why but I cannot seem to wrap my brain around it, and
therefore ignore it.. (=  I've tried examining the man pages
but the switch in my head that toggles misunderstanding to
understanding seems to be fused.

I have to admit the first time I tried scoring I felt the same way as
you.  But the kind folk on this mailing list soon pointed out what was
needed.  I now use scoring for all sorts of things including matching
filenames on a very busy CVS commit mailing list.  (The only problem I
have had is during debugging when I run with verbose logging the log
file quickly becomes enormous!)


Cheers,
       Nick.
-- 
Thanks to the IAU Gustav Holst can now rest easy in his grave.  As for
Mr. Colin Matthews, I suggest he look elsewhere for employment, perhaps
as a vampire!
____________________________________________________________
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