procmail
[Top] [All Lists]

Multiple matches

2004-07-08 12:04:07
Hi,

I want to add more function to an automatic list sorter.
List adresses will always hav a category-listname(_at_)domain(_dot_)tld
format. This list would be sorted to category/listname. If
this doesn't exist it should be sorted to /dev/null.

I have a similar receipe that matches mail-\/[^(_at_)]+@domain.tld
and would write test to $MATCH if the mail would have been
sent to mail-test. But how to get both vales? I can think of
something like this:

:0
* _TO \/[^(_at_)]+
{
        LOCALPART=$MATCH

  :0
  * $LOCALPART \/[^\-]+-[^(_at_)]+
  {
                :0
                * $LOCALPART \/[^\-]+
                {
                        CATEGORY=$MATCH

                        :0
                        * $LOCALPART $CATEGORY-\/[^(_at_)]+
                        {
                                
                                # not sure about this one
                                :0
                                * -e $CATEGORY/$MATCH
                                {
                                        $CATEGORY/$MATCH
                                }

                                /dev/null
                        }
  }
}

Are there any solutions more elegant?

-sa

-- 
sa at programmers-world dot com http://www.livingit.de
Internet sites:
  http://www.not2long.net - Make long links short
  Boomarks online: http://www.mobile-bookmarks.info

____________________________________________________________
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

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