procmail
[Top] [All Lists]

mailing list sorting recipe

1997-10-04 13:59:57
Recently on the list I came across a recipe that sorts mailing lists
into separate folders AND guarantees that these folders will be
lowercase. My previous recipe used 'tr' to that end:


LISTS = "(\
mutt|\
procmail|\
zsh|\
linux-laptop|\
vim|\
kaffe|\
guavac|\
lynx-dev|\
java-linux|\
lftp|\
linux-kernel|\
djb-qmail\
)"
:0
* $ ^TO_\/$LISTS
{
        FOLDER=$MATCH

        :0D: # D flag makes regexps case-sensitive.
        * ! FOLDER ?? [A-Z]
        $FOLDER

        :0Ehi # catch only elses and not errors
        folder=|echo $FOLDER | tr A-Z a-z

        :0A:
        $folder
}

But the new recipe (by Phillip Guenter?) does away completely with
external programs:

:0
* $ ^TO_\/$LISTS
* $ LISTS ?? ()\/$\MATCH
$MATCH

The problem is it dosen't work for me, for example my logfile says:

procmail: Assigning 
"LISTS=(mutt|procmail|zsh|linux-laptop|vim|kaffe|guavac|lynx-dev|java-linux|lftp|linux-kernel|djb-qmail)"
procmail: Assigning "MATCH="
procmail: Matched "linux-kernel"
procmail: Match on 
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)\/(mutt|procmail|zsh|linux-laptop|vim|kaffe|guavac|lynx-dev|java-linux|lftp|linux-kernel|djb-qmail)"
procmail: No match on "\/linux-kernel"
                      ^^^^^^^^^^^^^^^
Why does procmail take the fence operator as part of the regexp? Did I
miss something important in the example that was posted.

Thanks in advance for some enligthement.

-- 

     Louis-David Mitterrand
     http://www.aparima.com/F1/
     mito(_at_)aparima(_dot_)com

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