🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #6096

Re: alt.* volume doubled

#6096
From: J. Porter Clark
Date: Thu, 28 Mar 1996 00:00
110 lines
4432 bytes
jpc@hammer.msfc.nasa.gov (J. Porter Clark) writes:

>ccpes@sun.cse.bris.ac.uk (Paul Smee) writes:

>>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).)

>With INN, I use a script I wrote called 'uxfxn' (Usenet crucifixion--a
>really bad pun on "crosspost killing") that operates from a channel
>feed.  I use it to locally kill alt.binaries.* articles that are
>crossposted to groups that match certain patterns.  It is smart enough
>to not kill articles that are crossposted to alt.answers, for example.

By popular request, here is my 'Usenet crucifixion' script.

I welcome constructive criticism of this script.

#! /usr/bin/perl
##  uxfxn -- Usenet Crucifixion
##  Blot out articles crossposted (hence the name <ewww...>) to
##  groups specified via file named on the command line.
##  Borrowed somewhat from Usenet Death Penalty by Rich Salz.
##  By jpc@hammer.msfc.nasa.gov (J. Porter Clark)
##
##  Typical use is via this entry in newsfeeds file:
##	uxfxn:*:Tc,WNm:/full/path/to/uxfxn regexpfile
##  Only removes articles from your spool.
##  First (and only) arg is file containing exactly two lines.
##  Each line is a perl regexp.  Article is cancelled if any
##  newsgroups on the Newsgroups: line match the first line and
##  none of them match the second.
##
##  An example.  Here's a newsfeeds entry:
##
##  uxfxn\
##	:!*,alt.binaries.*\
##	:Tc,WNm:/news/lbin/uxfxn /news/uxfxn.ctl
##
##  (You could also use Tp instead of Tc, particularly if you only
##  occasionally receive articles in the selected groups,
##  alt.binaries.* in this case.)
##
##  The /news/uxfxn.ctl file has:
##
##  ^alt\..*(sex|erotic|nudism|girlfriend|celebrities|tasteless)
##  ^(alt\.answers)|(news\.answers)$
##
##  This combinations will autocancel any articles posted to the
##  "naked GIF" groups that are crossposted to alt.binaries.* groups
##  that you do carry.  Except:  It won't cancel them if they were
##  crossposted to alt.answers or news.answers.
##  If you are using a Tc feed and change uxfxn.ctl, do a
##  "ctlinnd flush uxfxn" to make the change take effect.

##  Customize these for your site:
$cancellog = '/var/log/news/uxfxn.log';
$ctlinnd = '/news/bin/ctlinnd';


##  Parse JCL.
$patfile = shift || die "Not enough args.\n";
shift && die "Too many args.\n";

open (PAT, $patfile) || die "Can't open $patfile\n";
$ngpattrue = <PAT>;
$ngpatfalse = <PAT>;
close PAT;

chop($ngpattrue);
chop($ngpatfalse);

line: while (<STDIN>)
{
  # format is newsgroup1,newsgroup2 <message-id>
  next line unless ($ngheader, $msgid) = split(/\s/, $_);
  # don't bother to proceed unless this article is in multiple newsgroups
  next line unless ($ngheader =~ /,/);
  # handle each newsgroup
  $matchtrue = 0;
  $matchfalse = 0;
  foreach $ng (split(/,/, $ngheader))
  {
    if ($ng =~ /$ngpattrue/o)
    {
      $matchtrue++;
    }
    if ($ng =~ /$ngpatfalse/o)
    {
      $matchfalse++;
    }
  }
  if ($matchtrue && !$matchfalse)
  {
    open (LOG, ">> $cancellog") || die "Can't open $cancellog\n";
    print LOG "$ngheader $msgid\n";
    close LOG;
    system "$ctlinnd -s cancel \'$msgid\'\n";
    next line;
  }
}
exit 0;


Technical Details
Message-ID: <4jehkb$rli@hammer.msfc.nasa.gov>
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> <4irns2$mfp@nnrp1.news.primenet.com> <4j53hn$n1k@frodo.ShireNet.com> <russell.827783458@news.probe.net> <DovEyK.K5E@uns.bris.ac.uk> <4j8uut$843@anvil.msfc.nasa.gov>

Show Full Headers
Complete Article Headers
Message-ID: <4jehkb$rli@hammer.msfc.nasa.gov>
Subject: Re: alt.* volume doubled
Date: Thu, 28 Mar 1996 00:00:00 +0000
From: jpc@hammer.msfc.nasa.gov (J. Porter Clark)
References: <4ii91m$o0d@hpax.cup.hp.com> <4irns2$mfp@nnrp1.news.primenet.com> <4j53hn$n1k@frodo.ShireNet.com> <russell.827783458@news.probe.net> <DovEyK.K5E@uns.bris.ac.uk> <4j8uut$843@anvil.msfc.nasa.gov>
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: 144692657
Organization: NASA/MSFC
Newsgroups: news.software.nntp