🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #79980

Re: Cleanfeed - "body ()" rejections (and IPv6)

#79980
From: D. Stussy
Date: Tue, 06 Jan 2009 01:39
129 lines
6761 bytes
"Steve" <steve@mixmin.net> wrote in message
news:slrngm3pic.5c4.steve@news.mixmin.net...
> On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
> Message-Id: <gjs7fc$s4a$1@snarked.org>:
>
> >=> $1 doesn't seem to be set to anything.  What I am seeing is "437
> > Body ()".  Bad_Body is set to NULL (or whatever value is chosen if
the
> > file doesn't exist in "read_hashes").
>
> That's interesting.  So if bad_body (the file) doesn't exist,
$Bad_Body
> is set to NULL and then matches articles that (presumably) have no
> payload or at least match an empty regex.  I've applied a patch to
svn
> that should fix this behaviour.

I wasn't certain what the exact behavior is, but in my case, I have no
bad_body file, so the expression should be null or empty.

>          if ($config{aggressive}) {
> -            if (not $gr{reports} and not $hdr{References}) {
> +            if (not $gr{reports} and not $hdr{References}
> +                and $Bad_Body) {
>                  return reject("Body ($1)", 'Bad Body')
>                      if $body =~ /($Bad_Body)/;
>          };

I agree that should fix the "null/empty" condition.  However, what is
"$1" supposed to be set to?  The expression found?  (Sorry, I never
properly learned perl.)  If an empty regex expression "~//" matches
everything, that would be a problem, and explains why $1 is also null.

> This can be downloaded from
> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are
some
> other updates since the previous release).
>
> > What's triggering this:  I think the inclusion of a URL (of a news
> > server's web site) in a post attempted to news.admin.peering is
where
> > I have most recently seen this.  URLs for the servers' statistics
> > pages need to pass this filter.
> >
> > Should we have a list of groups where URLs are allowed in article
> > bodies (NOT including "shorturls")?
>
> Reporting groups are currently excluded from that filter but
> news.admin.peering is not defined in spam_report_groups.  Therefore
if a
> post contains a URL that matches a regex defined in bad_body, it
would
> be rejected.  Would you like a $bad_body_exclude regex so that
additional
> groups can be excluded from this filter?  If so, should all groups
in a
> distribution have to match or just a single group?

What I was thinking of is a group list/regex that contains groups
where LIMITED URL posting is permitted.  By limited, I imply 1 but
certainly NOT more than 3.  "news.admin.peering" is such a group.  So
would be some groups like "alt.review-my-website" or
"alt.on-what-website-can-I-find-X".  Certain software-support groups
might want to be included if it is customary to include web page URLs
to the manual, etc., in articles (and replies).

Skipping ONLY bad_body might not be the correct approach.  Defining
"aggressive" = 0 also bypasses a few other checks, and if I read the
script correctly, some of those [bypassed] checks are checks in the
body for URLs (in the scoring filter).

I believe that the URL-permitted groups should be subjected to other
tests (besides containing a URL) that spam_report_groups skip.
Therefore, adding these to "score_exclude" is not what I suggest.  I
suggest yet another list of groups:  url_groups

   score .=  "whatever" ...  if (some url condition) and NOT
url_groups;
(adding AND NOT ....) - but not for "shorturl" URLs.

> > Note also - the definition of "IP" assumes IPv4 only.  What about
IPv6?
>
> Yes, Cleanfeed's IP regex's currently only match IPv4.  I'll try and
> update this in the near future.

OK.  I do understand the mess with IPv6 BNF syntax.

Forms without "::" seem easy:  [0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}
(or something like that).

The problem is the forms with "::" (including itself).

I don't know if these will occur, but they could:  ::IPv4 and
::[Ff]{4}:IPv4  (where "IPv4" is the existing expression for that AF).

Other forms with "::" can be covered with 6 expressions (depending on
how many quad-groups prefix "::": 0-5, with a corresponding maximum of
5-0 trailing groups).

Therefore, if I've counted this correctly, all IPv6 addresses can be
covered with an expression that is a union (OR, "|") of 9 individual
expressions.  That's a mess.

Instead of writing this from scratch, is there a perl library routine
on CPAN that has already been written to validate/match IPv6
addresses?  I think it's worth looking for one.

-------- Other notes:

1) spam_report_groups:  includes "\.spamtrap\." - which would NOT
catch group "alt.alt.spamtrap".

2)  "alt.usenet.kooks" seems out-of-control with some of its recent
(off-topic) cross-postings.  One posting from 28 Dec 2008 had 9 groups
(alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
of interest only to AUK.  I may not like censorship, but I am also
against disruptive stupidity such as this (which seems to happen alot
with alt.BSG).  Any thoughts as to adding anything with "kook" and
certain other miscreant words in the group name to the
anti-cross-posting (or limited cross-posting) filters for everyone (as
oposed to local settings)?  Perhaps meow_groups or low_xpost_groups?
(I may do this locally if there's no global consensus.)

(meow_groups are not currently config_appendable).

Technical Details
Message-ID: <gjuhme$uv1$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!feeder3.cambrium.nl!feed.tweaknews.nl!postnews.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-02.newsfeed.easynews.com!easynews.com!easynews!news.he.net!news.snarked.org!not-for-mail
References: <gjs7fc$s4a$1@snarked.org> <slrngm3pic.5c4.steve@news.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <gjuhme$uv1$1@snarked.org>
Subject: Re: Cleanfeed - "body ()" rejections (and IPv6)
Date: Mon, 5 Jan 2009 17:39:01 -0800
From: "D. Stussy" <spam@bde-arc.ampr.org>
References: <gjs7fc$s4a$1@snarked.org> <slrngm3pic.5c4.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!feeder3.cambrium.nl!feed.tweaknews.nl!postnews.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-02.newsfeed.easynews.com!easynews.com!easynews!news.he.net!news.snarked.org!not-for-mail
Newsgroups: news.software.nntp
Lines: 129
Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org>
NNTP-Posting-Host: pool-71-106-211-175.lsanca.dsl-w.verizon.net
X-Trace: snarked.org 1231211023 31713 71.106.211.175 (6 Jan 2009 03:03:43 GMT)
X-Complaints-To: newsmaster@snarked.org
NNTP-Posting-Date: Tue, 6 Jan 2009 03:03:43 +0000 (UTC)
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478