🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #61890

Cleanfeed supersedes filter patch

#61890
From: Jeffrey M. Vinocur
Date: Sat, 09 Nov 2002 18:40
50 lines
2653 bytes
[ Marco, I'm assuming you read stuff posted here; if you prefer I
  CC you on this sort of thing let me know. ]

I found that the Cleanfeed "excessive supersedes" filter was
being a bit too harsh on certain FAQ-like posts not crossposted
to news.answers.  Thus the below adds a check on the Subject line
as well, provided there is no References.  I haven't tested it
yet, but the idea is sound even if I turn out to have done
something dumb in the code.

I have "faq_subjects => 'status report|[Ii]nformation'," in
cleanfeed.local %config.append, but those may not be right for
everyone.


@@ -171,6 +171,7 @@
 		'|^alt\.(?:support|teens|answers)',
 
 	faq_groups => '\.answers$|^news\.announce\.newgroups$',
+	faq_subjects => 'FAQ|[Ff]requently [Aa]sked [Qq]uestions',
 
 	# used to form domain names for filtering - depreciated!
 	badguys => 'ilovefreesex|moneyvue|backdoor|portlandplace|cure-impotency'.
@@ -225,7 +226,8 @@
 					allexclude 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 badguys)) {
+					adult_groups not_adult_groups faq_groups faq_subjects
+					badguys)) {
 				if (defined $config_append{$_}) {
 					$config{$_} .= "|$config_append{$_}";
 					$config{$_} =~ s/\|\|/\|/g;
@@ -482,6 +484,9 @@
 	# If all newsgroups are excluded from filtering, bail now
 	return '' if $gr{skip};
 
+	$gr{faq}++ if not $hdr{'References'}
+				  and $hdr{'Subject'} =~ /$config{faq_subjects}/o;
+
 	foreach (@Restricted_List) {
 		$gr{'rg_'.$_.'_only'} = ($gr{'rg_'.$_} == scalar @groups);
 	}



-- 
Jeffrey M. Vinocur
jeff@litech.org
Technical Details
Message-ID: <aqjkqd$4gk$1@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.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.litech.org!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <aqjkqd$4gk$1@puck.litech.org>
Subject: Cleanfeed supersedes filter patch
Date: Sat, 09 Nov 2002 18:40:13 +0000
From: jeff@litech.org (Jeffrey M. Vinocur)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.litech.org!not-for-mail
Newsgroups: news.software.nntp
Organization: Litech Systems Design
Lines: 49
Sender: jeff@litech.org
NNTP-Posting-Host: puck.litech.org
X-Trace: puck.litech.org 1036867213 4628 66.218.0.75 (9 Nov 2002 18:40:13 GMT)
X-Complaints-To: usenet@litech.org
NNTP-Posting-Date: Sat, 9 Nov 2002 18:40:13 +0000 (UTC)
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
Originator: jeff@litech.org (Jeffrey M. Vinocur)