Volker Kuhlmann wrote:
[...]
What is the advantage of the method for matching list emails discussed
in this thread, over using reusable filters for each mailing list
manager?
Nothing more than personal preference rather than any grand technical
merit. I found my ~/.procmailrc growing rather large, even when
combining rules, and the occasional regex error (my fault) would have
messy consequences. I just prefer to do the logic once, and modify the
datafile.
Thinking further out, I would also find it far easier to support other
users who wanted similar capabilities. Rather than teaching them to
craft their own .procmailrc, I can put up a page telling how to create a
simple data file. If they botch that, they don't lose their mail and
blame me. I can simply have the one recipe in the system procmailrc do
it for everyone consistently.
It also opens up possibilities like a nice web gui interface to sort
imap folders by simply modifying a file via CGI (or whatever), rather
than trying to craft regex lines by hand.
> [...] Because list mails have
distinctive characteristics depending on which list manager software is
used, I made filters for the most common managers and call them eg like:
LISTNAME="abc-xyz"
LISTSERVERDOMAIN="list.domain"
LISTFOLDER=$THISLISTS/$LISTNAME-List
INCLUDERC=$PROCDIR/lm_mailman.rc
I'm not sure I understand how this is working for you. You call a
different .rc based on the list manager you detect for the mailing list?
How are you associating $LISTNAME with a specific list? Header matches?
Where's $LISTSERVERDOMAIN come into the picture?
If you want multiple lists in the same folder, specify the same
LISTFOLDER. All online for download.
That sounds like what I had been doing before (with apologies in advance
to Dallman for my less-than-optimal regexps -- I realize many of these
could be combined.):
:0:
* 1^0
^Delivered-To:.*(antionline|infosec|InternetCrime-L|securitytech|computer
security|network-sec|computersecurity)@yahoogroups\.com
* 1^0 ^From: (_dot_)*editor(_at_)riskanalysisgroup\(_dot_)com
* 1^0 ^From: (_dot_)*secured(_at_)TECHWIRE\(_dot_)COM
* 1^0 ^TOi_isp-security(_at_)isp-security\(_dot_)com
* 1^0 ^(List-Id|To): .*securityfocus\.com
* 1^0
^TO_(nessus(_at_)list\(_dot_)nessus\(_dot_)org|aide(_at_)cs\(_dot_)tut\(_dot_)fi)
* 1^0 ^TO_(snort|nessus)-announce@
* 1^0 ^TO_prelude-user(_at_)prelude-ids\(_dot_)org
* 1^0 ^From: .*eSecurity Planet
Security
So as I subscribed to a new list, I had to identify a new pattern to
match and edit the recipe. Not hard, by any means. But now I can just
view the headers, and copy the hash value to a line in a data file to do
the same thing. I suspect it will also be less susceptible to unintended
regex matches on other rules, so I won't have to worry about keeping
more specific rules up at the top of my procmailrc. There's ONE unique
string for each list (the hash using my md5sum example). I don't have to
worry about inadvertently matching even if list names are very similar.
Lest anybody take offence, I'm not implying that procmail is limited! I
still use it for the bulk of the "neat stuff" I do with mail. I simply
got tired of creating new recipes for mailing lists. I do wonder if one
recipe, plus a call to 3 external programs is quickier than banging
through an ever-growing list of recipes for list headers.
- Bob
____________________________________________________________
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