David W. Tamkin schreef:
MATCHSTRING='(announce|general)'
:0:
* $ ^TO_\/$MATCHSTRING(_at_)lists\(_dot_)example\(_dot_)com
* MATCH ?? ()\/[^(_at_)]+
* $ MATCHSTRING ?? ()\/$\MATCH
lists-$MATCH
Yes, very nice approach.
I would change the 2nd condition to
* MATCH ?? ^^\/[^(_at_)]+
to emphasize that it starts at the beginning.
Variant:
LISTS = '
announce
general'
:0:
* ^TO_\/[-a-zA-Z0-9_(_dot_)]+(_at_)lists\(_dot_)example\(_dot_)com
* MATCH ?? ^^\/[^(_at_)]+
*$ LISTS ?? ^\/$\MATCH^
lists-$MATCH
But of course, there are often better headers to take
the list's name from.
Relisting variant:
LISTS = '
announce.one:announce
announce-two:announce
announce
general
announce3:announce'
:0
* ^TO_\/[-a-zA-Z0-9_(_dot_)]+(_at_)lists\(_dot_)example\(_dot_)com
* MATCH ?? ^^\/[^(_at_)]+
{
LIST = 'other'
:0
*$ LISTS ?? ^$\MATCH:\/.+
{ LIST = "$MATCH" }
:0E
*$ LISTS ?? ^\/$\MATCH^
* MATCH ?? ^^.+
{ LIST = "$MATCH" }
:0:
lists-$LIST
}
--
Grtz, Ruud
____________________________________________________________
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