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

Re: A procmail rule to filter perl.org messages.

Thread Previous
From:
JVromans
Date:
August 17, 2000 00:04
Subject:
Re: A procmail rule to filter perl.org messages.
Message ID:
14747.33733.552067.574820@plume.nl.compuware.com
[Quoting Jacob Davies, on August 16 2000, 13:54, in "A procmail rule to f"]
> 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.
> [...] 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.

Exactly for this reason I finally decided to dump procmail and write
an alternative. It's called Mail::Procmail and available on CPAN.

  http://search.cpan.org/search?module=Mail%3A%3AProcmail

(And yes, I _was_ heavily insprired by Simon Cozen's Mail::Audit.) 

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

This is the relevant section from my filter:

for ( pm_gethdr("x-mailing-list"),
      pm_gethdr("list-post"),
      pm_gethdr("mailing-list"),
      pm_gethdr("x-loop"),
    ) {

    my ($topic, $host);

    if ( ($topic, $host) = /($wordpat)@($wordpat)/i ) {

	if ( $host eq "perl.org" ) {
	    $topic = "perl6-bootstrap" if lc eq "bootstrap";
	    $topic = "perl-" . $topic unless $topic =~ /^perl/;
	}
	$topic =~ s/-help$//;
    }

    pm_deliver(maillist($topic)) if defined $topic;
}

-- Johan

Thread Previous


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