procmail
[Top] [All Lists]

Re: Optimizing recipes.

2000-07-31 14:31:00
The friends thing is easy:

   # Note that the leading whitespace after the line continuation 
   # below is ignored.
   :0:
   * ^From:.*(myfriend(_at_)somewhere|friend2(_at_)elsewhere|\
              morefriends(_at_)somewhereelse)
   FRIENDS


The lists thing is more tricky.  Below is something i came up
with.  It's a little silly, and i have no idea how well it would
work, but it was fun to try without going to a shell.  Use at
your own risk!   Comments/criticism welcome.  BTW the idea for
this came from something Philip Guenther posted a while ago 
about parsing dates, but don't blame him if my recipe sucks. :)


    LISTS="(zoot|redhat(-announce)?|apollo|hedwig|cartman)-list"
    # Note that the leading whitespace below does *not* get ignored
    # (i think), but the way we match against the variable, it doesn't 
    # matter either way.
    FOLDERS="zoot-list,ZOOT-LIST,redhat-list,REDHAT-LIST,\
             redhat-announce-list,REDHAT-ANN,apollo-list,APOLLO-LIST,\
             hedwig-list,HEDWIG-LIST,cartman-list,CARTMAN-LIST"
    :0
    * $ ^Mailing-List:.*\/${LISTS}
    {
        :0:
        * $ FOLDERS ?? ${MATCH},\/[^,]*
        $MATCH

        # Just in case the above recipe didn't match for some reason:
        :0E:
        LISTS-RECIPE-SCREWUPS
    }



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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