🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #6058

Re: alt.* volume doubled

#6058
From: Duncan Gibson
Date: Wed, 27 Mar 1996 00:00
112 lines
3907 bytes
Paul Smee <P.Smee@bristol.ac.uk> wrote:
> It was, though, this occurrence which led to my posting a couple weeks
> ago, to the effect that I wanted to be able to mark groups in the
> active file with a capital 'X' - an 'I really mean it, dammit' X -
> which would mean something like 'not only do I not want this group, but
> if any article shows up which is crossposted to this group and others
> then I don't want it in any of the other groups either, even if I do
> normally take them'.  (I'm still trying to find time to investigate
> that, sigh.  Looks like it should be do-able (in Cnews).)

I also proposed something similar in news.admin.misc a few weeks ago
although I proposed the '!!newsgroup' notation for use in the Cnews sys
file.

As a stop-gap measure I hacked together a utility which just happens to
work here, YMMV, because I was under the impression that we were still
receiving 200Mb per day cross-posted from groups that we definititely
didn't want. [I've since found that our newsfeed was still sending us the
groups! Those groups are now definitely cut off, but there is still a
significant amount of cross-posting to 'more innocuous' groups.]


Anyway, I run the following every hour using 'cron':

	#!/bin/sh

	SPOOL=/yc/news/spool
	UNWANTED="$SPOOL/alt/binaries $SPOOL/alt/sex"
	export SPOOL UNWANTED

	for article in `find $UNWANTED -type f -print`
	do
		/users/duncan/jnk/zap $article > /tmp/drg.zap
		for xref in `cat /tmp/drg.zap`
		do
			ls -l $SPOOL/$xref
			rm -f $SPOOL/$xref
		done
	done

As you can see, this calls the following C program:


	#include <stdio.h>
	
	int main(
		int argc,
		char *argv[]
	)
	{
		FILE *pFile;
		char *szLeadingText = "Xref: esatst ";
		char szArticlePath[100];
		int inLeadingText;
		int error;
		int nchars;
		int ch;
		int i;
	
		while (*++argv != NULL) {
			pFile = fopen(*argv, "r");
			if (pFile != NULL) {
				nchars = 0;
				error = 0;
				for (i = 0; i < strlen(szLeadingText); i++) {
					ch = fgetc(pFile);
					if (ch != szLeadingText[i]) {
						error = 1;
						break;
					}
				}
				if (error == 0) {
					while ((ch = fgetc(pFile)) != EOF) {
						if (ch == ' ' || ch == '\n') {
							szArticlePath[nchars] = '\0';
							printf("%s\n", szArticlePath);
							nchars = 0;
							if (ch == '\n') {
								break;
							}
						} else
						if (ch == '.' || ch == ':') {
							szArticlePath[nchars] = '/';
							nchars++;
						} else {
							szArticlePath[nchars] = ch;
							nchars++;
						}
					}
				}
				(void)fclose(pFile);
			}
		}
		return(0);
	}

Obviously you will need to change a couple of paths, the newsgroups in which
you are definitely not interested, and the name of your news machine as seen
in the XRef: header in your articles (i.e. change 'esatst').

I lashed this together without referring to the RFCs and it works well enough
here. I can't guarantee how it works at your site.

Cheers
Duncan

This is my article, not my employer's, with my opinions and my disclaimer!
--
Duncan Gibson, ESTEC/YCV, Postbus 299, 2200AG Noordwijk, The Netherlands
Tel: +31 71 5654013   Fax: +31 71 3512142  Email: duncan@yc.estec.esa.nl

Technical Details
Message-ID: <Dox36x.LIw@yc.estec.esa.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <4ii91m$o0d@hpax.cup.hp.com> <4j53hn$n1k@frodo.ShireNet.com> <russell.827783458@news.probe.net> <DovEyK.K5E@uns.bris.ac.uk>

Show Full Headers
Complete Article Headers
Message-ID: <Dox36x.LIw@yc.estec.esa.nl>
Subject: Re: alt.* volume doubled
Date: Wed, 27 Mar 1996 00:00:00 +0000
From: duncan@yc.estec.esa.nl (Duncan Gibson)
References: <4ii91m$o0d@hpax.cup.hp.com> <4j53hn$n1k@frodo.ShireNet.com> <russell.827783458@news.probe.net> <DovEyK.K5E@uns.bris.ac.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 144433390
Distribution: inet
Organization: ESA/ESTEC/YC, Noordwijk, The Netherlands
Newsgroups: news.software.nntp