Article View: news.software.nntp
Article #74384Re: Cleanfeed config to allow HTML and binary attachments
From: Jeffrey M. Vinocur
Date: Tue, 17 Oct 2006 02:15
Date: Tue, 17 Oct 2006 02:15
81 lines
4695 bytes
4695 bytes
In article <4WSYg.73790$QZ1.22699@bgtnsc04-news.ops.worldnet.att.net>,
John F. Morse <xanadu.bbs@invalid.net> wrote:
>
>I can't explain the earlier test (which I mentioned in the message of
>20061012 0317Z), where the attached gif file worked. I believe I used a
>Debian computer in the basement which may have had that host listed as
>"special" in readers.conf at the time.
Incidentally, there's nothing you can do in readers.conf that
will bypass the Cleanfeed checks.
>"A News (NNTP) error occurred: 437 Attached HTML file"
Okay, that's what I needed to know.
So you're seeing this error not because of the attached image,
but because of how the newsreader is encoding the textual part of
the post that's going along with the image. I'm not sure this is
something you should allow out onto greater Usenet, but if it's
only for use in your local hierarchies, and it works with the
newsreaders that your users use (without making the text part of
the message incomprehensible to some users), I guess you can
patch the source to allow it. Let's see...there we go.
You should probably read about the "unified diff" format so you
can figure out how to apply these changes to your Cleanfeed.
This adds an allow_mime_html setting that works like the
allow_html setting you already know.
--- /usr/local/news/cleanfeed/filter_innd.pl 2002-11-20 18:57:55.000000000 -0500
+++ /tmp/filter_innd.pl 2006-10-16 21:50:09.000000000 -0400
@@ -128,6 +128,9 @@
### HTML allowed here (if block_html or block_multi_alt is turned on)
html_allowed => '^microsoft\.',
+ ### MIME HTML allowed here (if block_mime_html is turned on)
+ mime_html_allowed => '',
+
### groups where we restrict crossposts even more than normal
low_xpost_groups => 'test|jobs|forsale',
@@ -223,7 +226,7 @@
# config_append adds to the config regexps
if (%config_append) {
foreach (qw(bin_allowed bad_bin md5exclude poison_groups
- allexclude html_allowed low_xpost_groups no_cancel_groups
+ allexclude html_allowed mime_html_allowed low_xpost_groups no_cancel_groups
baddomainpat phl_exempt supersedes_exempt
refuse_messageids net_abuse_groups spam_report_groups
adult_groups not_adult_groups faq_groups faq_subjects
@@ -452,6 +455,7 @@
$gr{binary}++ if $config{bin_allowed} and /$config{bin_allowed}/o;
$gr{bad_bin}++ if $config{bad_bin} and /$config{bad_bin}/o;
$gr{html}++ if $config{html_allowed} and /$config{html_allowed}/o;
+ $gr{mime_html}++ if $config{mime_html_allowed} and /$config{mime_html_allowed}/o;
$gr{poison}++ if $config{poison_groups}
and /$config{poison_groups}/o;
$gr{reports}++ if $config{spam_report_groups}
@@ -479,6 +483,7 @@
$gr{binary} = ($gr{binary} == scalar @groups);
$gr{binary} = 0 if $gr{bad_bin};
$gr{html} = ($gr{html} == scalar @groups);
+ $gr{mime_html} = ($gr{mime_html} == scalar @groups);
$gr{allmod} = ($gr{mod} == scalar @groups);
# If all newsgroups are excluded from filtering, bail now
@@ -645,7 +650,7 @@
# mime-encapsulated HTML (attached *.html file)
return reject('Attached HTML file')
- if $config{block_mime_html}
+ if $config{block_mime_html} and not $gr{mime_html}
and $hdr{'Content-Disposition'} =~ /filename.*\.html?/
or $hdr{'Content-Base'} =~ /file:.*\.html?/
or ($lch{'content-type'} =~ m#multipart/(?:mixed|related)#
--
Jeffrey M. Vinocur
jeff@litech.org
Technical Details
Message-ID:
<eh1ebc$d4c$5@puck.litech.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!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn12feed!worldnet.att.net!199.218.7.141!news.glorb.com!news.litech.org!not-for-mailReferences:
<O%STg.165050$QM6.101199@bgtnsc05-news.ops.worldnet.att.net> <qSYWg.242888$QM6.16449@bgtnsc05-news.ops.worldnet.att.net> <egld06$5sk$1@puck.litech.org> <4WSYg.73790$QZ1.22699@bgtnsc04-news.ops.worldnet.att.net>Show Full Headers
Complete Article Headers
Message-ID: <eh1ebc$d4c$5@puck.litech.org> Subject: Re: Cleanfeed config to allow HTML and binary attachments Date: Tue, 17 Oct 2006 02:15:08 +0000 From: jeff@litech.org (Jeffrey M. Vinocur) References: <O%STg.165050$QM6.101199@bgtnsc05-news.ops.worldnet.att.net> <qSYWg.242888$QM6.16449@bgtnsc05-news.ops.worldnet.att.net> <egld06$5sk$1@puck.litech.org> <4WSYg.73790$QZ1.22699@bgtnsc04-news.ops.worldnet.att.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!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn12feed!worldnet.att.net!199.218.7.141!news.glorb.com!news.litech.org!not-for-mail Newsgroups: news.software.nntp Organization: Litech Systems Design Lines: 81 Sender: jeff@litech.org NNTP-Posting-Host: puck.litech.org X-Trace: puck.litech.org 1161051308 13452 66.218.0.75 (17 Oct 2006 02:15:08 GMT) X-Complaints-To: usenet@litech.org NNTP-Posting-Date: Tue, 17 Oct 2006 02:15:08 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Originator: jeff@litech.org (Jeffrey M. Vinocur)