🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #88693

Re: Blocking using cleanfeed

#88693
From: Julien ÉLIE
Date: Mon, 21 Jun 2021 13:39
59 lines
2995 bytes
Hi Grant and The Doctor,

>> IS there any way using
>>
>> cleanfeed.local file
>>
>> to block
>>
>> news.neodome.net abuse
> 
> I think there is.
> 
> Take a look at the various options in cleanfeed.pl and cleanfeed.local. 
> There should be at least one thing that jumps out at you.

I see that Cleanfeed contains:

     # Try and ascertain the source news service.
     if ($hdr{'Injection-Info'} =~ /^$hws*($Hostname)[ \t;]/) {
         $state{injection_host} = "$1"
     } elsif ($hdr{'X-Trace'} =~ /^$hws*($Hostname)$hws/) {
         $state{injection_host} = "$1"
     } else {
         $state{injection_host} = first_path_host($hdr{Path});
     };

     # Extract the right-most FQDN from a Path header
     sub first_path_host{
         local $_ = shift;
         s/(![^\.]+)+$//; # Strip RH non-FQDNs
         s/!\.POSTED.*//; # Strip diagnostic host entry
         s/.*!//; # Strip all but RH path entry
         return $_;
     };



So I bet adding that to cleanfeed.local would do the trick:

     return reject('Banned injecting news server')
         if ($state{injection_host} =~ /news.server.to.ban/i);

or if %state is not recognized there (defined in filter_art), just 
re-use first_path_host code like this:

     local $injection_host = $hdr{'Path'};
     $injection_host =~ s/(![^\.]+)+$//; # Strip RH non-FQDNs
     $injection_host =~ s/!\.POSTED.*//; # Strip diagnostic host entry
     $injection_host =~ s/.*!//; # Strip all but RH path entry
     return reject('Banned injecting news server')
         if ($injection_host =~ /news.server.to.ban/i);

Not tested, but would be happy to know if that works.
And maybe to then add to cleanfeed.local as an example!

-- 
Julien ÉLIE

« La science consiste à passer d'un étonnement à l'autre. » (Aristote)
Technical Details
Message-ID: <saq4pv$7q1$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <s41rkk$2d0l$16@gallifrey.nk.ca> <s43lj4$2ih$1@tncsrv09.home.tnetconsulting.net>

Show Full Headers
Complete Article Headers
Message-ID: <saq4pv$7q1$1@news.trigofacile.com>
Subject: Re: Blocking using cleanfeed
Date: Mon, 21 Jun 2021 15:39:06 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <s41rkk$2d0l$16@gallifrey.nk.ca> <s43lj4$2ih$1@tncsrv09.home.tnetconsulting.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: Groupes francophones par TrigoFACILE
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 21 Jun 2021 13:39:11 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="san13-h02-176-143-2-105.dsl.sta.abo.bbox.fr:176.143.2.105"; logging-data="8001"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0
In-Reply-To: <s43lj4$2ih$1@tncsrv09.home.tnetconsulting.net>
Content-Language: fr
Lines: 58