procmail
[Top] [All Lists]

Re: upper/lower- case conversion of $MATCH

1997-09-26 06:32:36
Lars Hecking <lhecking(_at_)nmrc(_dot_)ucc(_dot_)ie> writes:
I'd say the following recipe should to the trick:

MAJORDOM="majordomo-(users|docs|workers)"
:0w
* $ ^(Sender|To|Cc):.*\/$MAJORDOM
* $ MAJORDOM ?? ()\/$\MATCH
| $APPNMAIL $LISTS/$MATCH

The second condition will never match.  The variable being matched against
needs to have the full names:

    MAJORDOMRE = "majordomo-(users|docs|workers)"
    MAJORDOMO  = "majordomo-users majordomo-docs majordomo-workers"
    :0w
    * $ ^(Sender|To|Cc):.*\/$MAJORDOMRE
    * $ MAJORDOMO ?? ()\/$\MATCH
    | $APPNMAIL $LISTS/$MATCH

...unless you extract out the "majordomo-" part:

    parts = "(users|docs|workers)"
    :0w
    * $ ^(Sender|To|Cc):(.*[^-a-zA-Z0-9_.])?majordomo-\/$parts\>
    * $ parts ?? ()\/$\MATCH
    | $APPNMAIL $LISTS/majordomo-$MATCH

Do you see why?


Philip Guenther