🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87968

Re: Cleanfeed bug in yEnc handling

#87968
From: Steve Crook
Date: Sat, 01 Jun 2019 15:26
54 lines
2552 bytes
On Fri, 31 May 2019 15:50:17 +0100, Matthew Vernon wrote in
Message-Id: <np3d0jyr846.fsf@sanger.ac.uk>:

> Hi,
>
> Cleanfeed's matching of yEnc lines is a little too strict, and this has
> lead to spam with header lines like:
>
> ## =ybegin line=128 size=716800 name=a

Hi Matthew,

Thanks for providing the patch.  Unfortunately it appears to be against
a different version of cleanfeed to the one I maintain at:
https://github.com/crooks/cleanfeed

I've attempted to convert your patch into the current version (see
below) but I've nowhere currently to test it.  Please give it a try and
let me know how it goes.

Cheers,
Steve

diff --git a/cleanfeed b/cleanfeed
index 9c4c8b5..3d36c7d 100644
--- a/cleanfeed
+++ b/cleanfeed
@@ -1614,12 +1614,14 @@ sub is_binary {
     # =ybegin.
     if ($body =~ /(?:^|\n)=ybegin$hws+(.+)/o) {
         local $_ = $1;
-        # Further confirmation that this is a yEnc message and extract
-        # the file extension.  Greedy is good in this instance.
-        if (/line=/ and /size=/ and /name=.*\.(\w{2,4})/) {
-            $state{file_extension} = $1;
-            $state{cache_is_binary} = "yEnc Encoded";
-            return $state{cache_is_binary};
+        if (/line=/ and /size=/) {
+           # Further confirmation that this is a yEnc message and extract the
+           # file extension.  Greedy is good in this instance.
+            if (/name=.*\.(\w{2,4})/) {
+                $state{file_extension} = $1;
+                $state{cache_is_binary} = "yEnc Encoded";
+                return $state{cache_is_binary};
+            };
         };
     };

-- 
What shall we use 
To fill the empty spaces 
Where we used to talk?

Technical Details
Message-ID: <slrnqf5692.u39.steve@fleegle.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.(19219).mbox.7z!not-for-mail
References: <np3d0jyr846.fsf@sanger.ac.uk>

Show Full Headers
Complete Article Headers
Message-ID: <slrnqf5692.u39.steve@fleegle.mixmin.net>
Subject: Re: Cleanfeed bug in yEnc handling
Date: Sat, 01 Jun 2019 15:26:26 +0000
From: Steve Crook <steve@mixmin.net>
References: <np3d0jyr846.fsf@sanger.ac.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
Newsgroups: news.software.nntp
Organization: Mixmin
Injection-Date: Sat, 1 Jun 2019 15:26:26 -0000 (UTC)
Injection-Info: news.mixmin.net; posting-host="c4af4a3027e8317d29ea238d8aa6bb2f616aa3fc";
 logging-data="15313"; mail-complaints-to="abuse@mixmin.net"
User-Agent: slrn/pre1.0.4-2 (Linux)
X-Received-Bytes: 2401
X-Received-Body-CRC: 4128960730