A procmail rule to filter perl.org messages.

[email protected] (Jacob Davies) Wed, 16 Aug 2000 13:54:06 -0700
Newsgroups perl.bootstrap
Message-ID <[email protected]>
I got tired of adding a procmail rule for each new @perl.org mailing list,
so I made a procmail rule that can automatically filter them.

Here's what I came up with for a first pass at it:

	LOGFILE=$HOME/.procmail-log
	MAILDIR=$HOME/Mail
	VERBOSE=on
	
	:0:
	* ^X-Mailing-List: contact \/(.*)-help
	$MATCH

assuming your mail goes into $HOME/Mail in Berkeley mailbox format.  I'm no
procmail wizard, but this works for me.  Unfortunately it also names
the mailboxes "bootstrap-help", "perl6-language-help" etc.  The procmail \/
regex marker and $MATCH only seem to be able to break off the right hand
side of a matched expression, there's no equivalent of $1 that I could see.

This has the disadvantage that if you subscribe to non-perl.org mailing lists
that send an X-Mailing-List: header that looks like the perl.org ones, those
will start getting filtered too.  You could change the match to:

	* ^X-Mailing-List: contact \/(.*)[email protected]

but then all the filenames would have @perl.org on the end.

If someone has a finer-tuned rule than this, excellent, send it on in!

I deal with having magically-appearing mailboxes with Mutt by having a line
like this:

	mailboxes ! mbox `echo Mail/*`

in my .muttrc, so that new mailing lists show up without my having to add
them by hand.

-- 
Jacob Davies
[email protected]