Gnus development mailing list
 help / color / mirror / Atom feed
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Subject: Re: [gnu.emacs.gnus] Setting up an nndir version of a mailing list or  newsgroup?
Date: 30 Nov 1996 18:17:17 -0600	[thread overview]
Message-ID: <ufaybfj6rua.fsf@sina.hpc.uh.edu> (raw)
In-Reply-To: dubach1@husc.harvard.edu's message of Sat, 30 Nov 1996 18:49:40 -0500

>>>>> "JD" == Joev Dubach <dubach1@husc.harvard.edu> writes:

JD> Um, I mean, from an administrative standpoint: how do I shove the
JD> mailing list into that /that/directory/where/it/wants/to/reside/?  With
JD> the .overview being set up properly?  On a reasonably continuous
JD> schedule?

Well, I'm the one that keeps ding-list and ding-list-recent.  Everything is
done with Procmail and and old hack that was used before (ding) could
handle Procmail spools.  Use this at your own risk, and don't use it on
modifiable groups, where Gnus will ever delete anything or touch the
.overview file.

Here is the Procmail rule for ding-list and ding-list-recent:

UMASK=022

:0
*^TOding@ifi.uio.no
{
        :0 c
        ding-list/. ding-list-recent/.

        :0 hw :ding.lock
        | ( /home/tibbs/bin/add-active-nov $LASTFOLDER; \
            /usr/local/bin/tail -500 ding-list/.overview > ding-list-recent/.overview ; \
            rm -f blurgh `ls -1t ding-list-recent/* | sed -e 1,500d` )
}


Here's add-active-nov:

#!/usr/local/bin/perl

($dir=$ARGV[0]) =~ s#/[0-9]+$##;
($num=$ARGV[0]) =~ s#.*/([0-9]+)$#$1#;
($group=$dir)   =~ s#/#\.#g;

$lines      = 0;
$chars      = (stat($ARGV[0]))[7];
$references = "";

open (HEADERS, "formail -c -a Subject: -X subject: -a From: -X from: -a Date: -X date: -a Message-ID: -X message-id: -X in-reply-to: -X references: -X lines: -X content-length: < $ARGV[0] |") || "Could not open formail";
while(<HEADERS>)
{
  chop;
  if (s/^from:[ \t]*//i) {
      $from = $_;
    }
  elsif (s/^subject:[ \t]*//i) {
    $subject = $_;
  }
  elsif (s/^date:[ \t]*//i) {
    $date = $_;
  }
  elsif (s/^message-id:[ \t]*//i) {
    $id = $_;
  }
  elsif (s/^references:[ \t]*//i) {
    s/.*\t([^\t]+)/\1/;
    $references = $_;
  }
  elsif (s/^in-reply-to:[ \t]*//i) {
    s/.*\t([^\t]+)/\1/;
    if (   $references eq "" && $_ =~ /(<[^>]+>)/) {
      $references = $1;
    }
  }
  elsif (s/^lines:[ \t]*//i) {
    $lines = $_;
  }
  elsif (s/^content-length:[ \t]*//i) {
    $chars = $_;
  }
  else {
    die "Unknown field: $_";
  }
}

close (HEADERS);

if (-f "$dir/.overview") {
  $nov = "$dir/.overview";
} elsif (-f "$dir/.nov") {
  $nov = "$dir/.nov";
} else {
  $nov = "$dir/.overview";
}

system("lockfile -! $nov.lock") || die "Could not get lock";

open (NOV, ">>$nov") || die "Could not open $nov";
printf NOV ("$num\t$subject\t$from\t$date\t$id\t$references\t$chars\t$lines\t\n");
close (NOV);

system("rm -f $nov.lock");

$act = "$ENV{'HOME'}/Mail/active";
$actold = $act . ".old";

system("lockfile -! $act.lock") || die "Could not get lock";

rename($act,$actold) || die "rename $act $!";

open(ACTIVE, "$actold") || die "Could not open $actold";
open(NEW_ACTIVE, ">$act") || die "Could not open $act";

while (<ACTIVE>) {
  s/^$group [0-9]+/$group $num/;
  print NEW_ACTIVE;
}

close ACTIVE;
close NEW_ACTIVE;
system("rm -f $act.lock");


JD> I'd think people would have a bunch of scripts for this, seeing as
JD> there are actual mailing lists (ding-list, ding-list-recent at least)
JD> that get filtered into nndir-friendly directories.

Well, not a bunch, but the above gross hacks have fed over 11000 articles
into those two groups with zero barfs so far.  I just noticed that it will
miss BCCd articles, but a match on envelope sender should fix that.

 - J<


      reply	other threads:[~1996-12-01  0:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-29  8:21 Joev Dubach
1996-11-30 13:13 ` Lars Magne Ingebrigtsen
1996-11-30 23:49   ` Joev Dubach
1996-12-01  0:17     ` Jason L Tibbitts III [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ufaybfj6rua.fsf@sina.hpc.uh.edu \
    --to=tibbs@hpc.uh.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).