🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81411

Re: Cleanfeed (v227) comments:

#81411
From: Steve Crook
Date: Tue, 16 Jun 2009 10:09
41 lines
2503 bytes
On Mon, 15 Jun 2009 13:48:37 -0700, D. Stussy wrote in
Message-Id: <h16b3g$ltr$1@snarked.org>:

> I prefer to say "Banned From|Sender|Reply-To" than "Bad From..." - It's
> more precise.
How about this:

 if ($Bad_From) {
     return reject("Reply-To ($1)", 'Bad originator (Reply-To)')
         if $hdr{'Reply-To'} =~ $Bad_From_RE;
     return reject("Sender ($1)", 'Bad originator (Sender)')
         if $hdr{Sender} =~ $Bad_From_RE;
     return reject("From ($1)", 'Bad originator (From)')
         if $hdr{From} =~ $Bad_From_RE;
 };

Each will now generate a unique reject but for admins who want to log
all rejections against Bad_From, they can use something like:
saveart('cf.from', $vr) if $sr =~ /^Bad originator/;

>> The whole URL matching section needs some rework.  It functions on the
>> principle that all posted URL's are prefixed with http:// which is often
>> not true.  I'll try and clean this section up over the next week, time
>> permitting.
>
> Note that my point here was efficiency and ease of reading the code.  If it
> executes faster "as is", then it should NOT be changed.
I think it needs changing as a post containing "www.badurl.foo" will not
be matched unless it's prefixed with "http://".  Quickly scanning
through my logs, there are thousands of URL's posted without the
scheme name.

For the bad_url checking I use:
(?:www\.|http:\/\/(?:www\.)?)
This matches http://www.badurl.foo, www.badurl.foo and
http://badurl.foo.

-- 
pub   1024D/228761E7 2003-06-04 Steven Crook
      Key fingerprint = 1CD9 95E1 E9CE 80D6 C885  B7EB B471 80D5 2287 61E7
uid                  Steven Crook <steve@mixmin.net>
Technical Details
Message-ID: <slrnh3err9.7fb.steve@news.mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!not-for-mail
References: <h1137j$i7k$1@snarked.org> <slrnh3civj.fbg.steve@news.mixmin.net> <h16b3g$ltr$1@snarked.org>

Show Full Headers
Complete Article Headers
Message-ID: <slrnh3err9.7fb.steve@news.mixmin.net>
Subject: Re: Cleanfeed (v227) comments:
Date: Tue, 16 Jun 2009 10:09:45 +0000
From: Steve Crook <steve@mixmin.net>
References: <h1137j$i7k$1@snarked.org> <slrnh3civj.fbg.steve@news.mixmin.net> <h16b3g$ltr$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!not-for-mail
Newsgroups: news.software.nntp
Organization: Mixmin
Lines: 41
NNTP-Posting-Host: b421ff0445b5e915dcbceaec1788b827
X-Complaints-To: abuse@mixmin.net
NNTP-Posting-Date: Tue, 16 Jun 2009 10:09:45 +0000 (UTC)
User-Agent: slrn/pre1.0.0-11 (Linux)