develooper Front page | perl.bootstrap | Postings from August 2000

A procmail rule to filter perl.org messages.

Thread Next
From:
Jacob Davies
Date:
August 16, 2000 14:20
Subject:
A procmail rule to filter perl.org messages.
Message ID:
20000816135406.A21455@lx.viriconium.net

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 \/(.*)-help@perl.org

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
jacob@well.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About