Re: a little comparison of procmail and maildrop
Here is my list extracting procmail recipes...
# one space & one tab inside '[...]'
WS_zero="[ ]*"
WS_one="[ ]+"
WS_one_not="[^ ]+"
# extract from_
:0
* $ ^From${WS_one}\/${WS_one_not}
{ from_ = "$MATCH" }
# get list id
:0
* $ ^List-ID:${WS_zero}.*\/<[a-z]+.*>
{ list_id = "$MATCH" }
# based on $list_id, assign $list
# ----
list=
# freebsd lists
:0
* list_id ?? ()<\/[a-z]+[-.a-z]+freebsd\.org>
{
# consider -gnats-submit list same as -bugs, but not -ports-bugs unless
# subject pertains to perl
:0
* list_id ?? ()(ports-bugs|cvs-ports)
{ list = f-ports }
:0 E
* list_id ?? ()(gnats-submit|bugs)
{ list = f-bugs }
# most interesting freebsd mailing lists
:0 E
* MATCH ?? ()\/(stable|ppc|cvs|mobile|questions|ports|java)
{ list = "f-${MATCH}" }
# dafault $list for/from any freebsd list
:0 E
{ list = f-misc }
}
# all the lists which have list-id: header
# ----
# This recipe isn't intelligent enough not to set $list if a
# suspicious mailing list's message sneaks in. That is, a check
# for actually subscribed lists is needed.
# ----
:0 E
* list_id ?? ()(razor|pair|procmail|mutt|fvwm|slrn|freebsd|minolta)
* list_id ?? ()<\/[a-z]+
{ list = "$MATCH" }
# use of mailing-list: instead of list-id:
:0 E
* $ ^Mailing-List:${WS_zero}\/(list
minolta|contact${WS_zero}perl[a-z0-9-]+help@perl\.org)
* $MATCH ?? ()\/(minolta|perl)
{ list = "$MATCH" }
# these mailing lists don't have any particular list-id: like
# headers
:0 E
* $ ^Sender:${WS_zero}owner-\/(mutt|fvwm)(-[a-z]+)?@.*[a-z0-9]+
{
:0
* MATCH ?? ()\/(mutt|fvwm)
{ list = "$MATCH" }
}
# confirmation related to a freebsd pr doesn't come w/ any list type
# header, so check for From_ header.
:0 E
* from_ ?? ()gnats@freebsd\.org
{ list = f-bugs }
:0 E
* 9876543210^0 subj ?? ()(Question for|Answer from) seller -- Item
\#[0-9]+
* -1^0 from_ ??
()(savedsearches|bidconfirm|aw-confirm|dailystatus)@ebay\.com
* $ 1^0 ^X-eBay-MailTracker:${WS_zero}[0-9.]+[a-z]+
{ list = ebay }
# unknown, set $list_id to empty string, or no mailing list message
:0 E
{ list = "" }
- Parv
--