🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #82472

Re: Cleanfeed Update 306 (additional comments)

#82472
From: D. Stussy
Date: Tue, 05 Jan 2010 00:14
133 lines
7307 bytes
Just to establish the baseline:

--- cleanfeed.txt  2009-10-13 12:23:08.000000000 +0000
+++ cleanfeed.txt  2010-01-04 22:26:12.000000000 +0000
@@ -5,7 +5,7 @@
 #
 # Modified by Steve Crook <steve@mixmin.net>
 # Redistributed in accordance with the terms of the Artistic license.
-# $Id: cleanfeed 271 2009-10-13 12:23:08Z cleanfeed $
+# $Id: cleanfeed 306 2010-01-04 10:48:45Z cleanfeed $
 #
 # This software is distributed under the terms of the Artistic License.
 # Please see the LICENSE file in the distribution.

Although you're using some sort of auto-versioning software, shouldn't the
version number and date variables logically be closer to the top of the
file?  There's no harm leaving it embedded in the middle, and we do have
the text version in the comments at the header, but it just seems out of
place to be buried in the middle.
@@ -254,6 +256,10 @@

     );

+    # Store the Cleanfeed development revision number
+    ($version) = q$Revision: 306 $ =~ /(\d+)/;
+    ($version_date) = q$Date: 2010-01-04 10:48:45 +0000 (Mon, 04 Jan 2010)
$ =~ /(\d{4}(\-\d{2}){2})/;
+
     ### List of group patterns that don't allow outside crossposts.
     ### Key is "friendly" name, value is the pattern.
     %Restricted_Groups = (


OK, so we removed the "off_topic_maxgroups" variable, but shouldn't we add
"off_topic1_maxgroups" and the other 5 like variables (on_topic min/max)
here?
@@ -300,7 +306,7 @@
                     refuse_messageids net_abuse_groups spam_report_groups
                     adult_groups not_adult_groups faq_groups ratio_exclude
                     image_allowed image_extensions meow_groups
-                    topic1_groups topic2_groups off_topic_maxgroups)) {
+                    topic1_groups topic2_groups)) {
                 if (defined $config_append{$_}) {
                     $config{$_} .= "|$config_append{$_}";
                     $config{$_} =~ s/\|\|/\|/g;


SEVEN regex comparisons across 3 diff-sections, but no "i" flag to make
them case insensitive?  We may know what's in the variables, but we don't
know whether "Injection-Info" or "NNTP-Posting-Host" will be all lowercase.
Did we ever "tolower($postinghost)" globally?  The last added line of the
3rd patch of this section implies not.  I note that at line
1589(old)/1615(new), you did catch that the message-ID comparison is now
case insensitive.  ;-)
@@ -994,25 +1031,25 @@
         if (not $gr{reports}) {
             # create posting-host/lines hash
             if ($config{do_phl} and not $gr{allmod}
-            and $hdr{'NNTP-Posting-Host'} and not $gr{phlskip}$postinghost
+            and $postinghost and not $gr{phlskip}
             and not is_binary() and not $gr{alltest}
-            and not $hdr{'NNTP-Posting-Host'} =~
/(?:$config{phl_exempt})/o
-            and not $hdr{'$NNTP-Posting-Host'} =~
/(?:$config{bad_nph_hosts})/o
+            and not $postinghost =~ /(?:$config{phl_exempt})/o
+            and not $postinghost =~ /(?:$config{bad_nph_hosts})/o
             and not ($gr{binary} and $lines > 100
                 and $hdr{Subject} =~ /[\(\[]\d+\/\d+[\)\]]/)) {
                     return reject('EMP (phl)', 'EMP')
-                        if $PHLhistory->add("$hdr{'NNTP-Posting-Host'}
$lines");
+                        if $PHLhistory->add("$postinghost $lines");
             }; # End of PHL filter

             # create posting-host/newsgroups hash
-            if ($config{do_phn} and not $gr{allmod}
-            and not $gr{phrinc} and not $gr{phnskip} and not $gr{alltest}
+            if ($config{do_phn} and not $gr{phrinc} and not $gr{phnskip}
+            and not $gr{alltest} and not $gr{allmod}
             and not ($gr{binary} and $lines > 100)) {
-                if ($hdr{'NNTP-Posting-Host'}
-                and not $hdr{'$NNTP-Posting-Host'} =~
/(?:$config{bad_nph_hosts})/o) {
-                    if (not $hdr{'NNTP-Posting-Host'} =~
/(?:$config{phn_exempt})/o) {
+                if ($postinghost
+                and not $postinghost =~ /(?:$config{bad_nph_hosts})/o) {
+                    if (not $postinghost =~ /(?:$config{phn_exempt})/o) {
                         return reject('EMP (phn nph)', 'EMP')
-                            if $PHNhistory->add("$hdr{'NNTP-Posting-Host'}
$sortgrps");
+                            if $PHNhistory->add("$postinghost $sortgrps");
                     };
                 } elsif ($config{phn_aggressive}) {
                     my $server;
@@ -1050,11 +1087,11 @@
         # create high-risk newsgroups hash
         if ($config{do_phr} and $gr{phrinc}
             and not ($gr{binary} and $lines > 100)) {
-            if ($hdr{'NNTP-Posting-Host'}
-            and not $hdr{'NNTP-Posting-Host'} =~
/(?:$config{bad_nph_hosts})/o) {
-                if (not $hdr{'NNTP-Posting-Host'} =~
/(?:$config{phr_exempt})/o) {
+            if ($postinghost
+            and not $postinghost =~ /(?:$config{bad_nph_hosts})/o) {
+                if (not $postinghost =~ /(?:$config{phr_exempt})/o) {
                     return reject('EMP (phr nph)', 'EMP')
-                        if $PHRhistory->add("$hdr{'NNTP-Posting-Host'}");
+                        if $PHRhistory->add("$postinghost");
                 }
             } elsif ($config{phr_aggressive}) {
                 my $server;
@@ -1079,12 +1116,10 @@
         }

         if ($config{do_supersedes_filter} and $hdr{Supersedes}
-            and not
$hdr{'NNTP-Posting-Host'}=~/$config{supersedes_exempt}/o) {
+            and not $postinghost =~ /$config{supersedes_exempt}/o) {
             my $source;
-            if ($hdr{'NNTP-Posting-Host'} =~ /^(\d+\.\d+.\d+)\.\d+/) {
-                $source = $1;
-            } elsif ($hdr{'NNTP-Posting-Host'}) {
-                $source = lc $hdr{'NNTP-Posting-Host'};
+            if ($postinghost) {
+                $source = lc $postinghost;
                 $source =~ tr/a-z.//cd;
             }


Technical Details
Message-ID: <hhu094$8q5$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.dca.giganews.com!nntp.giganews.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!news.linkpendium.com!news.linkpendium.com!news.snarked.org!not-for-mail
References: <slrnhk22rh.erp.steve@news.mixmin.net> <slrnhk3lcs.erp.steve@news.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <hhu094$8q5$1@snarked.org>
Subject: Re: Cleanfeed Update 306 (additional comments)
Date: Mon, 4 Jan 2010 16:14:32 -0800
From: "D. Stussy" <spam+newsgroups@bde-arc.ampr.org>
References: <slrnhk22rh.erp.steve@news.mixmin.net> <slrnhk3lcs.erp.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.dca.giganews.com!nntp.giganews.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!news.linkpendium.com!news.linkpendium.com!news.snarked.org!not-for-mail
Newsgroups: news.software.nntp
Lines: 133
Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org>
NNTP-Posting-Host: pool-71-118-48-161.lsanca.dsl-w.verizon.net
X-Trace: snarked.org 1262650468 9029 71.118.48.161 (5 Jan 2010 00:14:28 GMT)
X-Complaints-To: newsmaster+complaints@snarked.org
NNTP-Posting-Date: Tue, 5 Jan 2010 00:14:28 +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