procmail
[Top] [All Lists]

Re: match on: ^TO or ^Subject

1996-10-29 12:05:27
why doesn't this work

* ^TO luomat|^Subject: [peak]

1. ^TO is a macro which skips break characters, including blanks, so
   trying to match a blank after it will fail if there is only *one* blank,
   because the ^TO regexp wants at least *one* break character before the
   text following the "^TO" macro.

   The desire to separate the ^TO macro from the following text is
   strong, so you should either parenthesize it, or insert an empty
   parenthesis pair, such as "^TO()foo" or  "^TO(foo)".

2. Square brackets mark a character set; if you are trying to match one
   of four characters after the colon and blank, then it is fine, but,
   if you are trying to match the literal text: "[peak]", you'll need
   to quote the brackets.

3. The subject regepx will match *only* if there is exactly one blank between 
   the colon and the '[peak]' text.  Using a '*' after most blanks will 
   make your recipes handle subtle formatting changes which many mail
   user agents perform gratuitiously.

4. I've never used alternation without the parens, but if the changes above
   do not improve things, try parenthesizing your alternation.

Incorporation all my suggestions, the recipe condition should look like this:

    * (^TO()luomat|^Subject: *\[peak\])

actually it is part of this:

:0c
* ! ^Sender: nextppp(_at_)chinx1(_dot_)ThoughtPort(_dot_)COM
* ! ^FROM_DAEMON
* ! ^X-Mailing-List:
* ! ^X-Loop: TopTen(_at_)pobox(_dot_)com
* ! ^Subject: Read Receipt
* ^TO luomat|^Subject: [peak]

Thanks
TjL


<Prev in Thread] Current Thread [Next in Thread>