Article View: news.software.nntp
Article #15575Re: Refusing articles based on number of crossposts?
From: James Brister
Date: Thu, 06 Mar 1997 00:00
Date: Thu, 06 Mar 1997 00:00
59 lines
2046 bytes
2046 bytes
Joe Hartley <jh@brainiac.com> writes:
[ rejecting articles with massive cross-posts ]
> Since there's nothing new under the sun, I was wondering if either
> this feature already exists (and I've just been dense and missed it)
> or if anyone's ever patched INN to support this type of thing.
There are two answers: use the perl hooks, or run a channel subfeed to
automatically cancel the post. The perl hooks are already there and the
sample will show you what to do. The channel feed would be something as
simple as:
in newsfeeds:
canceller!:*:Tc,WmN:/usr/local/bin/canceller
and /usr/local/bin/canceller is like:
#!/usr/bin/perl
$0 =~ s!.*/!! ;
$usage = "$0 [ -v -l limit ]\n" ;
$limit = 6 ;
$logfile = "/var/log/news/canceller.log" ;
require 'getopts.pl' ;
open (STDOUT,">>$logfile") ; # too bad if it fails.
open (STDERR,">&STDOUT") ;
$| = 1 ;
&Getopts ("vl:") || die $usage ;
$limit = $opt_l if ($opt_l =~ /^\d+/) ;
while (<STDIN>) {
chop ;
($mid,$ng) = split (' ',$_) ;
@ng = split (',',$ng) ;
next if (@ng < $limit) ;
print "Cancelling (locally) $mid due to these newsgroups: @ng\n"
if $opt_v ;
system ("ctlinnd cancel '$mid'") ;
}
This works, but is a bit heavy (a ctlinnd exec'd for each article to cancel).
James
--
James Brister brister@vix.com
Internet Software Consortium http://www.isc.org/isc inn@isc.org
Technical Details
Message-ID:
<yy3lo81cii1.fsf@velo.pp.vix.com>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-mailReferences:
<331E181D.41C67EA6@brainiac.com>Show Full Headers
Complete Article Headers
Message-ID: <yy3lo81cii1.fsf@velo.pp.vix.com> Subject: Re: Refusing articles based on number of crossposts? Date: Thu, 06 Mar 1997 00:00:00 +0000 From: James Brister <brister@vix.com> References: <331E181D.41C67EA6@brainiac.com> 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: 223500875 Organization: Internet Software Consortium Newsgroups: news.software.nntp