From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/9051 Path: main.gmane.org!not-for-mail From: Jason L Tibbitts III Newsgroups: gmane.emacs.gnus.general Subject: Re: [gnu.emacs.gnus] Setting up an nndir version of a mailing list or newsgroup? Date: 30 Nov 1996 18:17:17 -0600 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035149135 16177 80.91.224.250 (20 Oct 2002 21:25:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:25:35 +0000 (UTC) Return-Path: Original-Received: (qmail 21382 invoked from smtpd); 1 Dec 1996 00:36:44 -0000 Original-Received: from ifi.uio.no (0@129.240.64.2) by deanna.miranova.com with SMTP; 1 Dec 1996 00:36:34 -0000 Original-Received: from sina.hpc.uh.edu (tibbs@Sina.HPC.UH.EDU [129.7.3.5]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Sun, 1 Dec 1996 01:17:14 +0100 Original-Received: (from tibbs@localhost) by sina.hpc.uh.edu (8.7.3/8.7.3) id SAA18415; Sat, 30 Nov 1996 18:17:18 -0600 (CST) Original-To: ding@ifi.uio.no In-Reply-To: dubach1@husc.harvard.edu's message of Sat, 30 Nov 1996 18:49:40 -0500 Original-Lines: 126 X-Mailer: Red Gnus v0.70/Emacs 19.34 Xref: main.gmane.org gmane.emacs.gnus.general:9051 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:9051 >>>>> "JD" == Joev Dubach 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() { 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 () { 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<