procmail
[Top] [All Lists]

Re: List sorting

2001-02-17 13:59:12
On 17 Feb, Glen Solsberry wrote:
| I want to be able to sort list mail with procmail.  All of the recipes I
| have found don't do what I want.  So I wrote my own.  The only problem
| is that it creates lists., instead of lists.(listname)  Can anybody
| help?
| 
| Recipe::
| 
| #Recipe for sorting through mailing lists.
| :0:
| * $ ^Subject: \[([a-z]+)\]
| lists.$1
| 
| # Everything else to the Inbox
| :0:
| Inbox
| 

This is procmail, not perl. ;-)  Seriously though, there's nothing in
the man pages that could be misconstrued as supporting that syntax. The
fact that $1 was obviously unassigned should've been a clue.

Untested:

:0:
* ^Subject:[    ]\[\/[^]]+
lists.$MATCH

The '$' isn't necessary in the condition because you're not expanding
any variables, and the procmail match operator '\/' does roughly what
you expected the parentheses to do. You appear to want to enforce that a
space (and nothing else) must appear between Subject: and [...], so the
character class includes a <space><tab> pair. You may choose to change
that back to the single space. The rest of it breaks down like this:

\[   match literal [
\/   capture the rest of the matching pattern to MATCH variable
[^]] character class consisting of anything but ]
+    one or more of the characters from the class


Don Hammond



_______________________________________________
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>
  • List sorting, Glen Solsberry
    • Re: List sorting, D E Hammond <=