A couple weeks ago someone asked here about forcing $MATCH to lower case so
that mail that belongs in folder foo wouldn't end up creating eight files
named foo, Foo, fOo, foO, fOO, fOO, FoO, and FOO (or so that he or she
wouldn't need to keep seven symlinks around to make sure those all point
to the same place ... 1023 symlinks if the folder's name is ten letters
long).
I have the same problem, and I have been using tr to take care of it, but
something just occurred to me, and I'm going to try it out. It usually
comes up in the course of mailing list subscription filing recipes. We
have something like this:
:0:
* ^(From |(Resent-)Sender:).*\/(list1|list2|list3|list4|list5)
$MATCH
But if one or more of those list names may come in assorted cases, we have
the trouble under discussion and need an extra step:
:0
* ^(From |(Resent-)Sender:).*\/(list1|list2|list3|list4|list5)
{ LIST=$MATCH }
:0D:
* ! LIST ?? [A-Z]
$LIST
:0:
`echo $LIST | tr A-Z a-z`
This is my thought; it is still not too streamlined, but it avoids running
an outside program.
SUBSCRIPTIONS="(list1|list2|list3|list4|list5)" # names in lower case
:0
* $ ^(From |(Resent-)Sender:).*\/$SUBSCRIPTIONS
{
LIST=$MATCH
:0D:
* ! LIST ?? [A-Z]
$LIST
:0E: # Is $\LIST needed or is $LIST as good (or even better)?
* $ SUBSCRIPTIONS ?? ()\/$\LIST
$MATCH
}
The drawback is that I think you can't put any wildcards (except for the
case-insensitivity) into the individual list names in $SUBSCRIPTIONS.