Re: A procmail rule to filter perl.org messages.
[email protected] ((Johan Vromans)) Thu, 17 Aug 2000 08:18:45 +0200 (CEST)
| Newsgroups | perl.bootstrap |
|---|---|
| Message-ID | <[email protected]> |
[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