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

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

Thread Previous | Thread Next
From:
JVromans
Date:
August 21, 2000 02:54
Subject:
Re: A procmail rule to filter perl.org messages.
Message ID:
wl37l9bc52v.fsf@plume.nl.compuware.com
Alan Burlison <Alan.Burlison@uk.sun.com> writes:

> Jacob Davies wrote:
> 
> > 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
> 
> [snip]
> 
> > If someone has a finer-tuned rule than this, excellent, send it on in!
> 
> Here's what I use:
> 
> PERL_LIST='(perl|bootstrap|scripts)[^@,;= ]*'
> :0 Wh: .perl-lists.lock
> * $ ^TO_\/${PERL_LIST}@perl\.org
> * MATCH ?? ^^\/[^@]+
> | formail -D 8192 .perl.msgid
>         :0 e:
>         perl-lists/$MATCH

Perl power to the people!

  use Mail::Procmail;
  pm_init();
  pm_deliver("perl-lists/$1")
    pm_gethdr("x-mailing-list") =~ /(\S+)-help\@perl.org/i;

Alternatively, 

  pm_deliver("perl-lists/$1")
    if pm_gethdr("x-mailing-list-name") =~ /^(\S+)/;

would suffice, thanks to Ask adding the X-Mailing-List-Name header.

-- Johan

Thread Previous | 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