Fwd: [SLUG] procmail and mailing lists

Tony Green <[email protected]> Thu, 4 Nov 2004 06:11:33 +1100
Newsgroups gmane.org.user-groups.slug.pearls
Message-ID <[email protected]>

Begin forwarded message:

> From: Jamie Wilkinson <[email protected]>
> Date: 3 November 2004 5:31:51 PM
> To: [email protected]
> Subject: [SLUG] procmail and mailing lists
>
> For a while now, ezmlm has been the bane of my procmail existence; its
> Mailing-List header was just different enough that all mail delivered
> through it ended up in a mailbox called 'contact'.
>
> Today I went and fixed it good; what follows here is a block of 
> procmail shlock  that'll find the magic identifiers for the ezmlm 
> lists and file them away by site and localpart -- the way that most of 
> the ezmlm lists I'm subscribe to are set up.
>
> # generic ezmlm filter, comes before mailman otherwise mailman's filter
> # will put everything into .list.contact/
> :0
> * ^Mailing-list: contact .*; run by ezmlm
> * ^List-Post: [<]mailto:\/.*
> {
>         LISTID=$MATCH
>
>         :0
>         * LISTID ?? ^ *\/[^@]*
>         {
>                 LIST=$MATCH
>
>                 :0
>                 * LISTID ?? ^.*@\/[^>\.]*
>                 .list.$MATCH-$LIST/
>         }
> }
>
> The double nest lets me use the match twice, firstly to get the 
> localpart of
> the list address, and the second to get the part between the @ and the 
> first
> dot in the domain name.
>
> Hope that helps someone; for a full set of mailing list procmail check 
> out
> http://spacepants.org/conf/dot.procmailrc
> -- 
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>
-- 
Tony Green <[email protected]>

-- 
SLUG Pearls
http://lists.slug.org.au/listinfo/pearls