Article View: news.software.nntp
Article #82473Re: Cleanfeed Update 306 (diff vs. news.snarked.org updated version)
From: D. Stussy
Date: Tue, 05 Jan 2010 00:50
Date: Tue, 05 Jan 2010 00:50
182 lines
9301 bytes
9301 bytes
--- cleanfeed.306 2010-01-04 22:26:12.000000000 +0000
+++ cleanfeed.txt 2010-01-05 00:43:32.000000000 +0000
@@ -89,6 +89,7 @@
low_xpost_maxgroups => 6, # max xposts in low_xpost_groups
meow_ext_maxgroups => 2, # max xposts from meow_groups to other
groups
+ politics_ext_maxgroups => 2,# max xposts from politics_groups to other
groups
off_topic1_maxgroups => 2, # How many off topic groups allowed in a
distro
on_topic1_maxgroups => 5, # How many on-topic groups allowed in a
distro
on_topic1_mingroups => 2, # How many on-topic groups req'd to
trigger
@@ -175,6 +176,7 @@
meow_groups => '^alt\.fan\.karl-malden\.nose|^alt\.flame|^alt\.troll'.
'|^alt\.alien\.vampire\.flonk\.flonk\.flonk|^alt\.romath'.
'|^alt\.snuh|^alt\.fan\.natasha',
+ politics_groups => '\.politi[ck]',
### Topic groups allow administrators to limit crossposting from
defined
### groups to undefined groups. The allowed number of groups is
defined
@@ -304,9 +306,11 @@
phl_exempt phl_exclude supersedes_exempt bad_nph_hosts
phn_exempt phr_exempt phn_exclude flood_groups
refuse_messageids net_abuse_groups spam_report_groups
- adult_groups not_adult_groups faq_groups ratio_exclude
- image_allowed image_extensions meow_groups
- topic1_groups topic2_groups)) {
+ adult_groups not_adult_groups faq_groups
politics_groups
+ image_allowed image_extensions meow_groups
ratio_exclude
+ topic1_groups on_topic1_mingroups on_topic1_maxgroups
+ topic2_groups on_topic2_mingroups on_topic2_maxgroups
+ off_topic1_maxgroups off_topic2_maxgroups)) {
if (defined $config_append{$_}) {
$config{$_} .= "|$config_append{$_}";
$config{$_} =~ s/\|\|/\|/g;
@@ -660,6 +664,8 @@
and /$config{low_xpost_groups}/o;
$gr{meow}++ if $config{meow_groups}
and /$config{meow_groups}/o;
+ $gr{politics}++ if $config{politics_groups}
+ and /$config{politics_groups}/o;
$gr{topic1}++ if $config{topic1_groups}
and /$config{topic1_groups}/o;
$gr{topic2}++ if $config{topic2_groups}
@@ -700,13 +706,13 @@
};
# checks common to all article types
#####################################
- return reject("Bad host ($postinghost)", 'Bad site')
+ return reject("Host ($postinghost)", 'Bad site')
if exists $Bad_Hosts{$postinghost}
or exists $Bad_Hosts_Central{$postinghost};
@Path_Entries = split(/!/, $hdr{Path});
foreach (@Path_Entries) {
- return reject("Bad path ($_)", 'Bad site') if exists
$Bad_Path{$_};
+ return reject("Path ($_)", 'Bad site') if exists $Bad_Path{$_};
}
# check for the most simple newsagent variations
@@ -785,7 +791,7 @@
# basic checks on headers
############################################
if ($gr{adult}) {
foreach (@Path_Entries) {
- return reject("Bad path ($_)", 'Bad site')
+ return reject("Path ($_)", 'Bad Path')
if exists $Bad_Adult_Path{$_};
}
}
@@ -795,7 +801,7 @@
# scoring element rather than a reject.
#%seen = {};
#@Path_Entries2 = grep {!$seen{$_}++ } @Path_Entries;
- #return reject('Duplicated Path entry', 'Bad Path')
+ #return reject('Duplicated Path Entry', 'Bad Path')
# if (scalar @Path_Entries) != (scalar @Path_Entries2);
return reject('U2 violation - invalid distribution', 'U2
violation')
@@ -820,9 +826,14 @@
return reject('Too many newsgroups (meow)', 'Too many newsgroups')
if $gr{meow}
and $config{meow_ext_maxgroups}
and ($fupcnt - $gr{meow}) > $config{meow_ext_maxgroups};
+ return reject('Too many newsgroups (politics)', 'Too many
newsgroups')
+ if $gr{politics}
+ and $config{politics_ext_maxgroups}
+ and ($fupcnt - $gr{politics}) >
$config{politics_ext_maxgroups};
+
return reject('Topic Filter (Off-Topic1)', 'Topic Filter')
if $gr{topic1}
and $gr{topic1} >= $config{on_topic1_mingroups}
@@ -1033,8 +1043,8 @@
if ($config{do_phl} and not $gr{allmod}
and $postinghost and not $gr{phlskip}
and not is_binary() and not $gr{alltest}
- and not $postinghost =~ /(?:$config{phl_exempt})/o
- and not $postinghost =~ /(?:$config{bad_nph_hosts})/o
+ and not $postinghost =~ /(?:$config{phl_exempt})/io
+ and not $postinghost =~ /(?:$config{bad_nph_hosts})/io
and not ($gr{binary} and $lines > 100
and $hdr{Subject} =~ /[\(\[]\d+\/\d+[\)\]]/)) {
return reject('EMP (phl)', 'EMP')
@@ -1046,8 +1056,8 @@
and not $gr{alltest} and not $gr{allmod}
and not ($gr{binary} and $lines > 100)) {
if ($postinghost
- and not $postinghost =~ /(?:$config{bad_nph_hosts})/o) {
- if (not $postinghost =~ /(?:$config{phn_exempt})/o) {
+ and not $postinghost =~ /(?:$config{bad_nph_hosts})/io) {
+ if (not $postinghost =~ /(?:$config{phn_exempt})/io) {
return reject('EMP (phn nph)', 'EMP')
if $PHNhistory->add("$postinghost $sortgrps");
};
@@ -1088,8 +1098,8 @@
if ($config{do_phr} and $gr{phrinc}
and not ($gr{binary} and $lines > 100)) {
if ($postinghost
- and not $postinghost =~ /(?:$config{bad_nph_hosts})/o) {
- if (not $postinghost =~ /(?:$config{phr_exempt})/o) {
+ and not $postinghost =~ /(?:$config{bad_nph_hosts})/io) {
+ if (not $postinghost =~ /(?:$config{phr_exempt})/io) {
return reject('EMP (phr nph)', 'EMP')
if $PHRhistory->add("$postinghost");
}
@@ -1116,7 +1126,7 @@
}
if ($config{do_supersedes_filter} and $hdr{Supersedes}
- and not $postinghost =~ /$config{supersedes_exempt}/o) {
+ and not $postinghost =~ /$config{supersedes_exempt}/io) {
my $source;
if ($postinghost) {
$source = lc $postinghost;
@@ -1148,19 +1158,18 @@
if $hdr{Subject} =~ m#\[(\d+)/(\d+)\]$# and $1 > $2;
#
- # Reject bad From headers. We also check Sender and Reply-To
headers
- # against the same Regular Expression.
+ # Reject bad From/Sender/Reply-To headers.
if ($Bad_From) {
- return reject("Banned Reply-To ($1)", 'Bad Reply-To')
+ return reject("Reply-To ($hdr{'Reply-To'})",'Bad Reply-To')
if $hdr{'Reply-To'} =~ $Bad_From_RE;
- return reject("Banned Sender ($1)", 'Bad Sender')
+ return reject("Sender ($hdr{Sender})",'Bad Sender')
if $hdr{Sender} =~ $Bad_From_RE;
- return reject("Banned From ($1)", 'Bad From')
+ return reject("From ($hdr{From})", 'Bad From')
if $hdr{From} =~ $Bad_From_RE;
- };
+ }
# Reject bad Subject headers.
- return reject("Subject ($1)", 'Bad Subject')
+ return reject("Subject ($hdr{Subject})", 'Bad Subject')
if $Bad_Subject and $hdr{Subject} =~ $Bad_Subject_RE;
# Set a flag if the message body contains a URL. This means
later,
========================================================
Comments? I fixed some of the regex matches to be case insensitive, and
added the missing variables for "topic[1,2]" so that a local configuration
file may override.
Technical Details
Message-ID:
<hhu2br$8uk$1@snarked.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!border1.nntp.ams.giganews.com!nntp.giganews.com!eweka.nl!hq-usenetpeers.eweka.nl!news.k-dsl.de!news.snarked.org!not-for-mailReferences:
<slrnhk22rh.erp.steve@news.mixmin.net> <slrnhk3lcs.erp.steve@news.mixmin.net>Show Full Headers
Complete Article Headers
Message-ID: <hhu2br$8uk$1@snarked.org> Subject: Re: Cleanfeed Update 306 (diff vs. news.snarked.org updated version) Date: Mon, 4 Jan 2010 16:50:07 -0800 From: "D. Stussy" <spam+newsgroups@bde-arc.ampr.org> References: <slrnhk22rh.erp.steve@news.mixmin.net> <slrnhk3lcs.erp.steve@news.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.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!eweka.nl!hq-usenetpeers.eweka.nl!news.k-dsl.de!news.snarked.org!not-for-mail Newsgroups: news.software.nntp Lines: 182 Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org> NNTP-Posting-Host: pool-71-118-48-161.lsanca.dsl-w.verizon.net X-Trace: snarked.org 1262652603 9172 71.118.48.161 (5 Jan 2010 00:50:03 GMT) X-Complaints-To: newsmaster+complaints@snarked.org NNTP-Posting-Date: Tue, 5 Jan 2010 00:50:03 +0000 (UTC) X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478