Alex Langer asked,
| Currently I use the following rule to filter my FreeBSD-Maillists:
:0
(The condition got mangled in transit, but I think Alex meant this:)
* ^TO_.*[ <]\
(freebsd-)?\/(security|isdn|ports|questions|current|announce|stable|\
hackers)@freebsd.org
/home/alex/Mail/`echo $MATCH | sed -e 's/\([a-zA-Z]*\)@.*/\1/'`
| But now, when, let's say, e.g. a msg is x-posted to hackers & current,
| it only filters it to one list. Anyone has a effective idea to filter
| it to both list-mboxes, without adding a rule for each list with :0c ?
The other drawback to having a bunch of c-flag recipes, one for each list,
is that, when you get something crossposted to N of the lists that you're
on, you'll receive N copies, so you'd get N-squared copies (N in each folder)
unless the host preserves incoming Message-Id: headers and you eliminate
duplicates.
Anyhow, the trick is to find something that is added by the list host rather
than by the person posting. The return-path in the From_ line, a Sender: or
Resent-Sender: header, a Mailing-List: or X-Mailing-List: header, for some
examples. Generally, ^TO_ is not a great way to catch mail that comes
through mailing lists (and you're not really using it right if you put .*[ <]
after it, but that's another story).
Then you'll have something that will name only one list on each copy of a
crosspost, the list that is distributing it. For an example in my own
.procmailrc, I belong to about twelve lists that run on onelist.com, and a
single recipe matching on the Mailing-List: header's contents identifies them
all. Two pairs of them get crossposts all the time, and each list's copy
goes properly into its own folder because I match on a header added by the
list instead of one inserted by the writer.
BTW, you can get rid of that shell-and-sed backquote in the folder name by
adding a second condition, at least in any version new enough to have ^TO_:
* MATCH ?? ^^\/[^(_at_)]+
Then the action line becomes simply
/home/alex/Mail/$MATCH
or if you have set MAILDIR=$HOME/Mail, just
$MATCH
Finally, are those plain folders? Then you should use a second colon to get
a local lockfile. If they aren't, then you should say "the folders are di-
rectories/MH directories/maildirs, so that's why there is no local lockfile."