procmail
[Top] [All Lists]

Re: Multiple matches

2004-07-08 14:53:04
On Thu, Jul 08, 2004 at 08:47:37PM +0200, Sascha Andres wrote:

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.

  :0
  * ^TO_\/[a-z]+-[a-z]+@
  * MATCH ?? ()\/[^-]+
  { CATEGORY=$MATCH }

  :0 A
  * ^TO_[a-z]+-\/[a-z]+@
  * MATCH ?? ()\/[^(_at_)]+
  { LISTNAME=$MATCH }

Assuming, of course, that your categories and listnames are alpha-only.
Of course, it would probably be better to match on RFC1919 or even
RFC2369 headers instead -- a "List-Id:" header should be included by
your mailing list software, containing more predictable content which
can be parsed without the overhead and potential inaccuracy of ^TO_ .
(What if a message has <bob-smith(_at_)example(_dot_)com> in the CC list?)

-- 
  Paul Chvostek                                             
<paul(_at_)it(_dot_)ca>
  Operations / Abuse / Whatever
  it.canada, hosting and development                   http://www.it.ca/


____________________________________________________________
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>