procmail
[Top] [All Lists]

Re: stripping MATCH's right hand side

2001-12-07 12:33:09
Paul wrote,

| I'm probably missing something simple, but I can't figure out how to
| strip arbitrary text off the end of a variable.

There isn't, at least not within procmail.  You have to write something
special for each case.  For your Lyris example [folding mine to appease
MSOE],

| List-Unsubscribe: 
<mailto:leave-isp-colo-762587K(_at_)lists(_dot_)isp-lists(_dot_)com>
| List-Unsubscribe:\
 <mailto:leave-isp-webhosting-762586E(_at_)lists(_dot_)isp-lists(_dot_)com>
| List-Unsubscribe: 
<mailto:leave-isp-equipment-458649T(_at_)lists(_dot_)isp-lists(_dot_)com>

I'd write [condition wrapped to appease MSOE]:

 :0:
 * ^List-Unsubscribe:.*:leave-isp-\/\
   (colo|webhosting|equipment)-[^     ]+@([^     ]+\.)?isp-lists\.com>
 * MATCH ?? ^\/[^(_at_)]+
 isp-$MATCH

or a little less efficiently,

 :0:
 * ^List-.*\.isp-lists\.com>$
 * ^List-Unsubscribe:.*:leave-isp-\/(colo|webhosting|equipment)
 $MATCH

and every time I joined another list at that host, I'd add its name and
delete names of lists I had unsubbed from.

Something I wonder: suppose I belonged to all those lists and also to the
colonoscopies list.  Then

 leave-isp-\/(colo(noscopies)?|webhosting|equipment)

would match each correctly, because matching to the right of \/ is greedy.
But what would happen if I used

 leave-isp-\/(colo|colonoscopies|webhosting|equipment)

instead?  Would messages from the colonoscopies list be matched to "colo"
instead?  (And a big public merry Christmas to the first ten people who tell
me where I can stick messages from the colonoscopies list.)


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