🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #74387

Re: Cleanfeed config to allow HTML and binary attachments

#74387
From: John F. Morse
Date: Tue, 17 Oct 2006 03:16
137 lines
6747 bytes

Jeffrey M. Vinocur wrote:

>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.
>  
>


Thanks for that info.


>>"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.
>  
>


It is local only. It does not fail without the attachment, even though 
it (the text) is an HTML message containing two inserted images (the 
same inserted file as the attached file).

HTML messages do post OK, except when there is a file attachment (at 
least tested with a jpg attachment -- which shouldn't make that filetype 
unique).

I could try attaching the jpg to a text-only (non-HTML) message, but 
that is a rare method of posting.

Usenet is full of attached files. They have their purpose, and they 
supposedly have their place. Cleanfeed catches those that are "out of 
place."

I'm not going to argue pro or con about Usenet filling up with what 
should be on an FTP server, or a Web server. That is not my calling.

My users use a wide assortment of newsreaders. There is no guarantee, so 
assumptions are dangerous. The safest assumption is to assume the vast 
majority, mostly elderly, still use Outlook Express, with 
Mozilla/Thunderbird coming in second. A few Windows users will use 
Gravity, Agent or 40tude, or old Netscape. Mac users will use whatever 
they can get. A few Linux/BSD people use Pan, Knews or KNode. I know of 
nobody who uses the text-only readers, like slrn, trn, etc., with the 
exception of trying them out, and returning to something that will 
handle the HTML (and image) messages that are popular in these local 
groups for the past 12 or so years.


>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)#
>  
>


I'll try and find "unified diff" and read up on it. Unless you have a 
better link, I'll start here: 
http://www.google.com/search?hl=en&q=unified+diff&btnG=Google+Search

Thanks for this info, Jeff. I do appreciate all of your effort.

-- 
John
Technical Details
Message-ID: <iWXYg.291236$QM6.2991@bgtnsc05-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!bgtnsc05-news.ops.worldnet.att.net.POSTED!17a21c27!not-for-mail
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> <eh1ebc$d4c$5@puck.litech.org>

Show Full Headers
Complete Article Headers
Message-ID: <iWXYg.291236$QM6.2991@bgtnsc05-news.ops.worldnet.att.net>
Subject: Re: Cleanfeed config to allow HTML and binary attachments
Date: Tue, 17 Oct 2006 03:16:30 GMT
From: "John F. Morse" <xanadu.bbs@invalid.net>
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> <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!bgtnsc05-news.ops.worldnet.att.net.POSTED!17a21c27!not-for-mail
Reply-To: xanadu.bbs@invalid.net
Organization: Xanadu BBS
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040514
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: news.software.nntp
In-Reply-To: <eh1ebc$d4c$5@puck.litech.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 137
NNTP-Posting-Host: 7fae71a0f2971d8d9a799a1f75b75a15
X-Complaints-To: abuse@worldnet.att.net
X-Trace: bgtnsc05-news.ops.worldnet.att.net 1161054990
NNTP-Posting-Date: Tue, 17 Oct 2006 03:16:30 GMT