Article View: news.software.nntp
Article #87970Cleanfeed bug in yEnc handling
From: Matthew Vernon
Date: Fri, 31 May 2019 14:50
Date: Fri, 31 May 2019 14:50
56 lines
2680 bytes
2680 bytes
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
(but without the ## ) getting through - Cleanfeed insists on an
extension on the failname in the name= parameter.
Ian Jackson provided the fix after I discovered the problem, because he
has Perl skills:
diff --git a/cleanfeed b/cleanfeed
index 5141379..02f0320 100644
--- a/cleanfeed
+++ b/cleanfeed
@@ -1562,13 +1562,19 @@ sub is_binary {
# =ybegin.
if ($hdr{__BODY__} =~ /(?:^|\n)=ybegin\s+(.+)/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})/) {
- $file_extension = $1;
- $Cache_Is_Binary = "yEnc Encoded";
- return $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})/) {
+ $file_extension = $1;
+ $Cache_Is_Binary = "yEnc Encoded";
+ return $Cache_Is_Binary;
+ } elsif (/name=/) {
+ $file_extension = '';
+ $Cache_Is_Binary = "yEnc Encoded (no extension)";
+ return $Cache_Is_Binary;
+ }
+ }
};
# uuEncoded check
HTH,
Matthew
--
`O'-----0 `O'---. `O'---. `O'---.
\___| | \___|0-/ \___|/ \___|
| | /\ | | \ | |\ | |
The Dangers of modern veterinary life
Technical Details
Message-ID:
<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-mailShow Full Headers
Complete Article Headers
Message-ID: <np3d0jyr846.fsf@sanger.ac.uk> Subject: Cleanfeed bug in yEnc handling Date: Fri, 31 May 2019 15:50:17 +0100 From: Matthew Vernon <matthew@debian.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.(19219).mbox.7z!not-for-mail Newsgroups: news.software.nntp Organization: A header line that ends up very out of date Lines: 54 NNTP-Posting-Host: chiark.greenend.org.uk Mime-Version: 1.0 Content-Type: text/plain X-Trace: chiark.greenend.org.uk 1559314247 1723 212.13.197.229 (31 May 2019 14:50:47 GMT) X-Complaints-To: abuse@chiark.greenend.org.uk NNTP-Posting-Date: Fri, 31 May 2019 14:50:47 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cancel-Lock: sha1:v74ce2SH9ijKNzTgf2yP0PqBOOY= Originator: @sanger-morgan-nat.sanger.ac.uk ([193.62.205.6]) X-Received-Bytes: 2604 X-Received-Body-CRC: 691145966