procmail
[Top] [All Lists]

Re: increasing efficiency

1997-09-04 16:47:03
Timothy Luoma asked,

| There are 3 groups, and the mailboxes are the same as the list name...  
| can I use $MATCH somehow?  Here's what I have right now:
| 
| :0
| * ^From (_dot_)*(_at_)GreatCircle\(_dot_)COM
| {
|       :0w
|       * ^(Sender|To|Cc):.*majordomo-users?(-owner)
|       | $APPNMAIL $LISTS/majordomo-users
| 
|       :0w
|       * ^(Sender|To|Cc):.*majordomo-docs?(-owner)
|       | $APPNMAIL $LISTS/majordomo-docs
| 
|       :0w
|       * ^(Sender|To|Cc):.*majordomo-workers?(-owner)
|       | $APPNMAIL $LISTS/majordomo-workers
| }
| 
| Rather than have 3 separate ones for 'users' 'docs' and 'workers' I'd rather  
| have one that used $MATCH, but I'm not sure how to do it.

My question: are you sure about the question mark after the "s"?  I don't
belong to any of those lists, but I do belong to list-managers, and the
mentions of those lists on list-managers *always* give their names as
plurals.

| I'd like to make it something like this:
| 
| :0
| * ^From (_dot_)*(_at_)GreatCircle\(_dot_)COM
| {
|       SOMEMAGICHERETOSET$MATCH
|       
|       :0w
|       | $APPNMAIL $LISTS/majordomo-$MATCH
| 
| }     

| Note: the Sender line always has the -owner part

If the regexp on the condition line doesn't include anything that will
match to the -owner part, it won't be extracted into $MATCH.

 :0w
 * ^From (.*\<)?greatcircle\.com
 * (^Sender:.*|^TO_)\/majordomo-(user|doc|worker)s
 | $APPNMAIL $LISTS/$MATCH

If you ever do get some mail where the name has no plural (but how can
the Sender: address, which is added by Majordomo and not by the submitter,
possibly be missing the final s?), here we go:

 :0
 * ^From (.*\<)?greatcircle\.com
 * (^Sender:.*|^TO_)\/majordomo-(user|doc|worker)s?
 {
  :0w
  * MATCH ?? s^^
  | $APPNMAIL $LISTS/$MATCH
  :0Ew
  | $APPNMAIL $LISTS/${MATCH}s
 }


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