procmail
[Top] [All Lists]

Suggestions for a non expensive (overhead wise) routine

2001-12-02 12:24:25
Setup: OS = Redhat Linux 7.1
       procmail = procmail-3.21-0.71

I'm using the match operator to capture the first part of a 
`Newsgroups' header then create the delivery target from that match.
The snippet of procmailrc below is being fed by this formula
(wrapped for mail)

nntpserver_output =>| formail -d -e -s procmail -m \
 ${HOME}/projects/proc/.proc_nntp_split

Writing an nntp feed to mbox style files.

cat .procmailrc:   
     :0fh
    * Newsgroups:[     ]*\/[^( |,)]+
   {
      DELIVERY=$MATCH
   }
   
   ## If we have a bonafide `PATH: ' header then write it to DELIVERY
    :0
   * ^Newsgroups:
   * ^PATH: 
   ${DELIVERY}.in
   
   ## If we get some goofy thing with no PATH header
   ## dump it here
   
    :0
    * ! ^(PATH|Newsgroups): 
    misc_news.in

This is later processed into mail style groups in my mail client
'gnus'

It is a way to turn nntp output into mail-like format.  And works
well.  One little snag I ran into is that some messages come thru with
a number of groups in the Newsgroups field.  Although the SERVER is
sending them as from a newsgroup on my newsrc list, Some of them may
not be part of my setup.  Or included in those groups I download.

My technique above writes a file named after the first element in
'Newsgroups: ' header.  So I may end up with some groups that are
really not groups I'm after.  This is not a huge problem and could
possibly just be ignored.

However I would like to make some attempt at a nicer setup.  I can
imagine a couple of ways to iterate over the names on my newsrc file and
compare them to any in the Newsgroups header.  Writing to the first
match.  I think that would be sufficient for my small setup.

However it seems this would be quite drastice in processing overhead.
 
Another way may be an regex that includes all my newsrc groups after
the \/ and write to $MATCH.  I haven't actually tried that out and
it looks like it could be pretty cumbersome too.  Maybe even generate
names that are pretty bizarre.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Suggestions for a non expensive (overhead wise) routine, Harry Putnam <=