🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #88482

Re: Cleanfeed and arbitrary headers.

#88482
From: U.ee
Date: Sun, 30 Aug 2020 17:43
74 lines
3317 bytes
Hi, Grant!


On 29.08.20 19:04, Grant Taylor wrote:
> 
>> You can edit your cleanfeed.local
> 
> Okay.
> 
> That's definitely better than nothing.  Though it does mean that I will 
> have to re-do this every time that I upgrade Cleanfeed, which admittedly 
> isn't that often.

cleanfeed.local should not overwritten, it's meant for local 
customisation - hopefully you got your cleanfeed.local from renaming
package provided cleanfeed.local.sample

> 
> I wonder if I can have this customization in a file that's included. 
> I'll have to go brush up on my Perl.
> 
>> sub local_filter_last {
>>     if ($hdr{Injection-Info} =~ /what you want|another spam/i/) {
> 
> I believe this is where I would list the multiple (sub)strings that I 
> wanted to match and reject based on.  E.g.  /posting-account=\w{32}/i/
> 
> I think that "\w" includes a-z A-Z 0-9 and underscore.

Indeed, \w is alphanumerics + underscore.
There are some nuances, but probably not important:
https://perldoc.perl.org/perlrecharclass.html

> 
> Though as I look at sample data, I may need to include hyphens.
> 
> I'd rather not write out this full set, but it may be needed until I 
> figure out a more concise way to do it.
> 
>     [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]
> 
>>          saveart('badhosts', 'Bad Injection-Info');
> 
> If I'm reading cleanfeed.pl correctly, saveart() saves (part of) the 
> article to a local file.  Is that strictly required?  Or can I 
> eventually forego that step by remarking that line?


no, you don't need saveart. That is nice though for validation (what you 
catch).

> 
>>          return reject('filtre local', 'Spammeur habituel');
> 
> It looks like I might want to use something like the following:
> 
>     return reject('Messages from <bla> posting-account are banned.', 
> 'Banned posting-account');
> 
> It would be really nice if I could fill <bla> with the actual value.
> 
>>      };
>> };
> 
You can put variable in your message, but then you need double quotes 
(") instead single quotes (').
Extracting needed variable is another thing though.
If your perl is rusty (and who writes perl everyday), then looking 
filter/cleanfeed (main script, probably linked by filter_innd.pl) gives 
you some ideas.


Bets regards
U.ee
Technical Details
Message-ID: <rigog4$1anu$1@news.usenet.ee>
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: <ricgun$ti2$1@tncsrv09.home.tnetconsulting.net> <rid5n1$3bl$1@nemo.pasdenom.info> <ridudk$f2c$1@tncsrv09.home.tnetconsulting.net>

Show Full Headers
Complete Article Headers
Message-ID: <rigog4$1anu$1@news.usenet.ee>
Subject: Re: Cleanfeed and arbitrary headers.
Date: Sun, 30 Aug 2020 20:43:32 +0300
From: "U.ee" <admin@invalid.usenet.ee>
References: <ricgun$ti2$1@tncsrv09.home.tnetconsulting.net> <rid5n1$3bl$1@nemo.pasdenom.info> <ridudk$f2c$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: Usenet.ee site
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 30 Aug 2020 17:43:32 -0000 (UTC)
Injection-Info: news.usenet.ee; logging-data="43774"; mail-complaints-to="abuse@usenet.ee"
In-Reply-To: <ridudk$f2c$1@tncsrv09.home.tnetconsulting.net>
Content-Language: en-US