Thread View: news.software.nntp
20 messages
20 total messages
Started by D. Stussy
Mon, 05 Jan 2009 05:56
Cleanfeed - "body ()" rejections
Author: D. Stussy
Date: Mon, 05 Jan 2009 05:56
Date: Mon, 05 Jan 2009 05:56
32 lines
2161 bytes
2161 bytes
It would be nice if the current filter were altered to indicate the
REASON why the body of posts are being rejected. I am sometimes
seeing this on LOCALLY originated posts, but it doesn't tell me what
needs to be fixed....
sub filter_art {
...
if ($config{aggressive}) {
if (not $gr{reports} and not $hdr{References}) {
return reject("Body ($1)", 'Bad Body')
if $body =~ /($Bad_Body)/;
};
};
=> $1 doesn't seem to be set to anything. What I am seeing is "437
Body ()". Bad_Body is set to NULL (or whatever value is chosen if the
file doesn't exist in "read_hashes").
I'm temporarily fixing this by setting aggressive=0.
What's triggering this: I think the inclusion of a URL (of a news
server's web site) in a post attempted to news.admin.peering is where
I have most recently seen this. URLs for the servers' statistics
pages need to pass this filter.
Should we have a list of groups where URLs are allowed in article
bodies (NOT including "shorturls")?
Note also - the definition of "IP" assumes IPv4 only. What about
IPv6?
Re: Cleanfeed - "body ()" rejections
Author: Steve
Date: Mon, 05 Jan 2009 10:51
Date: Mon, 05 Jan 2009 10:51
47 lines
2947 bytes
2947 bytes
On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
Message-Id: <gjs7fc$s4a$1@snarked.org>:
>=> $1 doesn't seem to be set to anything. What I am seeing is "437
> Body ()". Bad_Body is set to NULL (or whatever value is chosen if the
> file doesn't exist in "read_hashes").
That's interesting. So if bad_body (the file) doesn't exist, $Bad_Body
is set to NULL and then matches articles that (presumably) have no
payload or at least match an empty regex. I've applied a patch to svn
that should fix this behaviour.
if ($config{aggressive}) {
- if (not $gr{reports} and not $hdr{References}) {
+ if (not $gr{reports} and not $hdr{References}
+ and $Bad_Body) {
return reject("Body ($1)", 'Bad Body')
if $body =~ /($Bad_Body)/;
};
This can be downloaded from
http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are some
other updates since the previous release).
> What's triggering this: I think the inclusion of a URL (of a news
> server's web site) in a post attempted to news.admin.peering is where
> I have most recently seen this. URLs for the servers' statistics
> pages need to pass this filter.
>
> Should we have a list of groups where URLs are allowed in article
> bodies (NOT including "shorturls")?
Reporting groups are currently excluded from that filter but
news.admin.peering is not defined in spam_report_groups. Therefore if a
post contains a URL that matches a regex defined in bad_body, it would
be rejected. Would you like a $bad_body_exclude regex so that additional
groups can be excluded from this filter? If so, should all groups in a
distribution have to match or just a single group?
> Note also - the definition of "IP" assumes IPv4 only. What about
> IPv6?
Yes, Cleanfeed's IP regex's currently only match IPv4. I'll try and
update this in the near future.
--
pub 1024D/228761E7 2003-06-04 Steven Crook
Key fingerprint = 1CD9 95E1 E9CE 80D6 C885 B7EB B471 80D5 2287 61E7
uid Steven Crook <steve@mixmin.net>
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: D. Stussy
Date: Tue, 06 Jan 2009 01:39
Date: Tue, 06 Jan 2009 01:39
129 lines
6587 bytes
6587 bytes
"Steve" <steve@mixmin.net> wrote in message
news:slrngm3pic.5c4.steve@news.mixmin.net...
> On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
> Message-Id: <gjs7fc$s4a$1@snarked.org>:
>
> >=> $1 doesn't seem to be set to anything. What I am seeing is "437
> > Body ()". Bad_Body is set to NULL (or whatever value is chosen if
the
> > file doesn't exist in "read_hashes").
>
> That's interesting. So if bad_body (the file) doesn't exist,
$Bad_Body
> is set to NULL and then matches articles that (presumably) have no
> payload or at least match an empty regex. I've applied a patch to
svn
> that should fix this behaviour.
I wasn't certain what the exact behavior is, but in my case, I have no
bad_body file, so the expression should be null or empty.
> if ($config{aggressive}) {
> - if (not $gr{reports} and not $hdr{References}) {
> + if (not $gr{reports} and not $hdr{References}
> + and $Bad_Body) {
> return reject("Body ($1)", 'Bad Body')
> if $body =~ /($Bad_Body)/;
> };
I agree that should fix the "null/empty" condition. However, what is
"$1" supposed to be set to? The expression found? (Sorry, I never
properly learned perl.) If an empty regex expression "~//" matches
everything, that would be a problem, and explains why $1 is also null.
> This can be downloaded from
> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are
some
> other updates since the previous release).
>
> > What's triggering this: I think the inclusion of a URL (of a news
> > server's web site) in a post attempted to news.admin.peering is
where
> > I have most recently seen this. URLs for the servers' statistics
> > pages need to pass this filter.
> >
> > Should we have a list of groups where URLs are allowed in article
> > bodies (NOT including "shorturls")?
>
> Reporting groups are currently excluded from that filter but
> news.admin.peering is not defined in spam_report_groups. Therefore
if a
> post contains a URL that matches a regex defined in bad_body, it
would
> be rejected. Would you like a $bad_body_exclude regex so that
additional
> groups can be excluded from this filter? If so, should all groups
in a
> distribution have to match or just a single group?
What I was thinking of is a group list/regex that contains groups
where LIMITED URL posting is permitted. By limited, I imply 1 but
certainly NOT more than 3. "news.admin.peering" is such a group. So
would be some groups like "alt.review-my-website" or
"alt.on-what-website-can-I-find-X". Certain software-support groups
might want to be included if it is customary to include web page URLs
to the manual, etc., in articles (and replies).
Skipping ONLY bad_body might not be the correct approach. Defining
"aggressive" = 0 also bypasses a few other checks, and if I read the
script correctly, some of those [bypassed] checks are checks in the
body for URLs (in the scoring filter).
I believe that the URL-permitted groups should be subjected to other
tests (besides containing a URL) that spam_report_groups skip.
Therefore, adding these to "score_exclude" is not what I suggest. I
suggest yet another list of groups: url_groups
score .= "whatever" ... if (some url condition) and NOT
url_groups;
(adding AND NOT ....) - but not for "shorturl" URLs.
> > Note also - the definition of "IP" assumes IPv4 only. What about
IPv6?
>
> Yes, Cleanfeed's IP regex's currently only match IPv4. I'll try and
> update this in the near future.
OK. I do understand the mess with IPv6 BNF syntax.
Forms without "::" seem easy: [0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}
(or something like that).
The problem is the forms with "::" (including itself).
I don't know if these will occur, but they could: ::IPv4 and
::[Ff]{4}:IPv4 (where "IPv4" is the existing expression for that AF).
Other forms with "::" can be covered with 6 expressions (depending on
how many quad-groups prefix "::": 0-5, with a corresponding maximum of
5-0 trailing groups).
Therefore, if I've counted this correctly, all IPv6 addresses can be
covered with an expression that is a union (OR, "|") of 9 individual
expressions. That's a mess.
Instead of writing this from scratch, is there a perl library routine
on CPAN that has already been written to validate/match IPv6
addresses? I think it's worth looking for one.
-------- Other notes:
1) spam_report_groups: includes "\.spamtrap\." - which would NOT
catch group "alt.alt.spamtrap".
2) "alt.usenet.kooks" seems out-of-control with some of its recent
(off-topic) cross-postings. One posting from 28 Dec 2008 had 9 groups
(alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
of interest only to AUK. I may not like censorship, but I am also
against disruptive stupidity such as this (which seems to happen alot
with alt.BSG). Any thoughts as to adding anything with "kook" and
certain other miscreant words in the group name to the
anti-cross-posting (or limited cross-posting) filters for everyone (as
oposed to local settings)? Perhaps meow_groups or low_xpost_groups?
(I may do this locally if there's no global consensus.)
(meow_groups are not currently config_appendable).
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: D. Stussy
Date: Tue, 06 Jan 2009 01:39
Date: Tue, 06 Jan 2009 01:39
129 lines
6588 bytes
6588 bytes
"Steve" <steve@mixmin.net> wrote in message
news:slrngm3pic.5c4.steve@news.mixmin.net...
> On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
> Message-Id: <gjs7fc$s4a$1@snarked.org>:
>
> >=> $1 doesn't seem to be set to anything. What I am seeing is "437
> > Body ()". Bad_Body is set to NULL (or whatever value is chosen if
the
> > file doesn't exist in "read_hashes").
>
> That's interesting. So if bad_body (the file) doesn't exist,
$Bad_Body
> is set to NULL and then matches articles that (presumably) have no
> payload or at least match an empty regex. I've applied a patch to
svn
> that should fix this behaviour.
I wasn't certain what the exact behavior is, but in my case, I have no
bad_body file, so the expression should be null or empty.
> if ($config{aggressive}) {
> - if (not $gr{reports} and not $hdr{References}) {
> + if (not $gr{reports} and not $hdr{References}
> + and $Bad_Body) {
> return reject("Body ($1)", 'Bad Body')
> if $body =~ /($Bad_Body)/;
> };
I agree that should fix the "null/empty" condition. However, what is
"$1" supposed to be set to? The expression found? (Sorry, I never
properly learned perl.) If an empty regex expression "~//" matches
everything, that would be a problem, and explains why $1 is also null.
> This can be downloaded from
> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are
some
> other updates since the previous release).
>
> > What's triggering this: I think the inclusion of a URL (of a news
> > server's web site) in a post attempted to news.admin.peering is
where
> > I have most recently seen this. URLs for the servers' statistics
> > pages need to pass this filter.
> >
> > Should we have a list of groups where URLs are allowed in article
> > bodies (NOT including "shorturls")?
>
> Reporting groups are currently excluded from that filter but
> news.admin.peering is not defined in spam_report_groups. Therefore
if a
> post contains a URL that matches a regex defined in bad_body, it
would
> be rejected. Would you like a $bad_body_exclude regex so that
additional
> groups can be excluded from this filter? If so, should all groups
in a
> distribution have to match or just a single group?
What I was thinking of is a group list/regex that contains groups
where LIMITED URL posting is permitted. By limited, I imply 1 but
certainly NOT more than 3. "news.admin.peering" is such a group. So
would be some groups like "alt.review-my-website" or
"alt.on-what-website-can-I-find-X". Certain software-support groups
might want to be included if it is customary to include web page URLs
to the manual, etc., in articles (and replies).
Skipping ONLY bad_body might not be the correct approach. Defining
"aggressive" = 0 also bypasses a few other checks, and if I read the
script correctly, some of those [bypassed] checks are checks in the
body for URLs (in the scoring filter).
I believe that the URL-permitted groups should be subjected to other
tests (besides containing a URL) that spam_report_groups skip.
Therefore, adding these to "score_exclude" is not what I suggest. I
suggest yet another list of groups: url_groups
score .= "whatever" ... if (some url condition) and NOT
url_groups;
(adding AND NOT ....) - but not for "shorturl" URLs.
> > Note also - the definition of "IP" assumes IPv4 only. What about
IPv6?
>
> Yes, Cleanfeed's IP regex's currently only match IPv4. I'll try and
> update this in the near future.
OK. I do understand the mess with IPv6 BNF syntax.
Forms without "::" seem easy: [0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}
(or something like that).
The problem is the forms with "::" (including itself).
I don't know if these will occur, but they could: ::IPv4 and
::[Ff]{4}:IPv4 (where "IPv4" is the existing expression for that AF).
Other forms with "::" can be covered with 6 expressions (depending on
how many quad-groups prefix "::": 0-5, with a corresponding maximum of
5-0 trailing groups).
Therefore, if I've counted this correctly, all IPv6 addresses can be
covered with an expression that is a union (OR, "|") of 9 individual
expressions. That's a mess.
Instead of writing this from scratch, is there a perl library routine
on CPAN that has already been written to validate/match IPv6
addresses? I think it's worth looking for one.
-------- Other notes:
1) spam_report_groups: includes "\.spamtrap\." - which would NOT
catch group "alt.alt.spamtrap".
2) "alt.usenet.kooks" seems out-of-control with some of its recent
(off-topic) cross-postings. One posting from 28 Dec 2008 had 9 groups
(alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
of interest only to AUK. I may not like censorship, but I am also
against disruptive stupidity such as this (which seems to happen alot
with alt.BSG). Any thoughts as to adding anything with "kook" and
certain other miscreant words in the group name to the
anti-cross-posting (or limited cross-posting) filters for everyone (as
oposed to local settings)? Perhaps meow_groups or low_xpost_groups?
(I may do this locally if there's no global consensus.)
(meow_groups are not currently config_appendable).
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: D. Stussy
Date: Tue, 06 Jan 2009 01:39
Date: Tue, 06 Jan 2009 01:39
129 lines
6792 bytes
6792 bytes
"Steve" <steve@mixmin.net> wrote in message
news:slrngm3pic.5c4.steve@news.mixmin.net...
> On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
> Message-Id: <gjs7fc$s4a$1@snarked.org>:
>
> >=> $1 doesn't seem to be set to anything. What I am seeing is "437
> > Body ()". Bad_Body is set to NULL (or whatever value is chosen if
the
> > file doesn't exist in "read_hashes").
>
> That's interesting. So if bad_body (the file) doesn't exist,
$Bad_Body
> is set to NULL and then matches articles that (presumably) have no
> payload or at least match an empty regex. I've applied a patch to
svn
> that should fix this behaviour.
I wasn't certain what the exact behavior is, but in my case, I have no
bad_body file, so the expression should be null or empty.
> if ($config{aggressive}) {
> - if (not $gr{reports} and not $hdr{References}) {
> + if (not $gr{reports} and not $hdr{References}
> + and $Bad_Body) {
> return reject("Body ($1)", 'Bad Body')
> if $body =~ /($Bad_Body)/;
> };
I agree that should fix the "null/empty" condition. However, what is
"$1" supposed to be set to? The expression found? (Sorry, I never
properly learned perl.) If an empty regex expression "~//" matches
everything, that would be a problem, and explains why $1 is also null.
> This can be downloaded from
> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are
some
> other updates since the previous release).
>
> > What's triggering this: I think the inclusion of a URL (of a news
> > server's web site) in a post attempted to news.admin.peering is
where
> > I have most recently seen this. URLs for the servers' statistics
> > pages need to pass this filter.
> >
> > Should we have a list of groups where URLs are allowed in article
> > bodies (NOT including "shorturls")?
>
> Reporting groups are currently excluded from that filter but
> news.admin.peering is not defined in spam_report_groups. Therefore
if a
> post contains a URL that matches a regex defined in bad_body, it
would
> be rejected. Would you like a $bad_body_exclude regex so that
additional
> groups can be excluded from this filter? If so, should all groups
in a
> distribution have to match or just a single group?
What I was thinking of is a group list/regex that contains groups
where LIMITED URL posting is permitted. By limited, I imply 1 but
certainly NOT more than 3. "news.admin.peering" is such a group. So
would be some groups like "alt.review-my-website" or
"alt.on-what-website-can-I-find-X". Certain software-support groups
might want to be included if it is customary to include web page URLs
to the manual, etc., in articles (and replies).
Skipping ONLY bad_body might not be the correct approach. Defining
"aggressive" = 0 also bypasses a few other checks, and if I read the
script correctly, some of those [bypassed] checks are checks in the
body for URLs (in the scoring filter).
I believe that the URL-permitted groups should be subjected to other
tests (besides containing a URL) that spam_report_groups skip.
Therefore, adding these to "score_exclude" is not what I suggest. I
suggest yet another list of groups: url_groups
score .= "whatever" ... if (some url condition) and NOT
url_groups;
(adding AND NOT ....) - but not for "shorturl" URLs.
> > Note also - the definition of "IP" assumes IPv4 only. What about
IPv6?
>
> Yes, Cleanfeed's IP regex's currently only match IPv4. I'll try and
> update this in the near future.
OK. I do understand the mess with IPv6 BNF syntax.
Forms without "::" seem easy: [0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}
(or something like that).
The problem is the forms with "::" (including itself).
I don't know if these will occur, but they could: ::IPv4 and
::[Ff]{4}:IPv4 (where "IPv4" is the existing expression for that AF).
Other forms with "::" can be covered with 6 expressions (depending on
how many quad-groups prefix "::": 0-5, with a corresponding maximum of
5-0 trailing groups).
Therefore, if I've counted this correctly, all IPv6 addresses can be
covered with an expression that is a union (OR, "|") of 9 individual
expressions. That's a mess.
Instead of writing this from scratch, is there a perl library routine
on CPAN that has already been written to validate/match IPv6
addresses? I think it's worth looking for one.
-------- Other notes:
1) spam_report_groups: includes "\.spamtrap\." - which would NOT
catch group "alt.alt.spamtrap".
2) "alt.usenet.kooks" seems out-of-control with some of its recent
(off-topic) cross-postings. One posting from 28 Dec 2008 had 9 groups
(alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
of interest only to AUK. I may not like censorship, but I am also
against disruptive stupidity such as this (which seems to happen alot
with alt.BSG). Any thoughts as to adding anything with "kook" and
certain other miscreant words in the group name to the
anti-cross-posting (or limited cross-posting) filters for everyone (as
oposed to local settings)? Perhaps meow_groups or low_xpost_groups?
(I may do this locally if there's no global consensus.)
(meow_groups are not currently config_appendable).
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: D. Stussy
Date: Tue, 06 Jan 2009 01:39
Date: Tue, 06 Jan 2009 01:39
129 lines
6567 bytes
6567 bytes
"Steve" <steve@mixmin.net> wrote in message
news:slrngm3pic.5c4.steve@news.mixmin.net...
> On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
> Message-Id: <gjs7fc$s4a$1@snarked.org>:
>
> >=> $1 doesn't seem to be set to anything. What I am seeing is "437
> > Body ()". Bad_Body is set to NULL (or whatever value is chosen if
the
> > file doesn't exist in "read_hashes").
>
> That's interesting. So if bad_body (the file) doesn't exist,
$Bad_Body
> is set to NULL and then matches articles that (presumably) have no
> payload or at least match an empty regex. I've applied a patch to
svn
> that should fix this behaviour.
I wasn't certain what the exact behavior is, but in my case, I have no
bad_body file, so the expression should be null or empty.
> if ($config{aggressive}) {
> - if (not $gr{reports} and not $hdr{References}) {
> + if (not $gr{reports} and not $hdr{References}
> + and $Bad_Body) {
> return reject("Body ($1)", 'Bad Body')
> if $body =~ /($Bad_Body)/;
> };
I agree that should fix the "null/empty" condition. However, what is
"$1" supposed to be set to? The expression found? (Sorry, I never
properly learned perl.) If an empty regex expression "~//" matches
everything, that would be a problem, and explains why $1 is also null.
> This can be downloaded from
> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are
some
> other updates since the previous release).
>
> > What's triggering this: I think the inclusion of a URL (of a news
> > server's web site) in a post attempted to news.admin.peering is
where
> > I have most recently seen this. URLs for the servers' statistics
> > pages need to pass this filter.
> >
> > Should we have a list of groups where URLs are allowed in article
> > bodies (NOT including "shorturls")?
>
> Reporting groups are currently excluded from that filter but
> news.admin.peering is not defined in spam_report_groups. Therefore
if a
> post contains a URL that matches a regex defined in bad_body, it
would
> be rejected. Would you like a $bad_body_exclude regex so that
additional
> groups can be excluded from this filter? If so, should all groups
in a
> distribution have to match or just a single group?
What I was thinking of is a group list/regex that contains groups
where LIMITED URL posting is permitted. By limited, I imply 1 but
certainly NOT more than 3. "news.admin.peering" is such a group. So
would be some groups like "alt.review-my-website" or
"alt.on-what-website-can-I-find-X". Certain software-support groups
might want to be included if it is customary to include web page URLs
to the manual, etc., in articles (and replies).
Skipping ONLY bad_body might not be the correct approach. Defining
"aggressive" = 0 also bypasses a few other checks, and if I read the
script correctly, some of those [bypassed] checks are checks in the
body for URLs (in the scoring filter).
I believe that the URL-permitted groups should be subjected to other
tests (besides containing a URL) that spam_report_groups skip.
Therefore, adding these to "score_exclude" is not what I suggest. I
suggest yet another list of groups: url_groups
score .= "whatever" ... if (some url condition) and NOT
url_groups;
(adding AND NOT ....) - but not for "shorturl" URLs.
> > Note also - the definition of "IP" assumes IPv4 only. What about
IPv6?
>
> Yes, Cleanfeed's IP regex's currently only match IPv4. I'll try and
> update this in the near future.
OK. I do understand the mess with IPv6 BNF syntax.
Forms without "::" seem easy: [0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}
(or something like that).
The problem is the forms with "::" (including itself).
I don't know if these will occur, but they could: ::IPv4 and
::[Ff]{4}:IPv4 (where "IPv4" is the existing expression for that AF).
Other forms with "::" can be covered with 6 expressions (depending on
how many quad-groups prefix "::": 0-5, with a corresponding maximum of
5-0 trailing groups).
Therefore, if I've counted this correctly, all IPv6 addresses can be
covered with an expression that is a union (OR, "|") of 9 individual
expressions. That's a mess.
Instead of writing this from scratch, is there a perl library routine
on CPAN that has already been written to validate/match IPv6
addresses? I think it's worth looking for one.
-------- Other notes:
1) spam_report_groups: includes "\.spamtrap\." - which would NOT
catch group "alt.alt.spamtrap".
2) "alt.usenet.kooks" seems out-of-control with some of its recent
(off-topic) cross-postings. One posting from 28 Dec 2008 had 9 groups
(alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
of interest only to AUK. I may not like censorship, but I am also
against disruptive stupidity such as this (which seems to happen alot
with alt.BSG). Any thoughts as to adding anything with "kook" and
certain other miscreant words in the group name to the
anti-cross-posting (or limited cross-posting) filters for everyone (as
oposed to local settings)? Perhaps meow_groups or low_xpost_groups?
(I may do this locally if there's no global consensus.)
(meow_groups are not currently config_appendable).
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: D. Stussy
Date: Tue, 06 Jan 2009 01:39
Date: Tue, 06 Jan 2009 01:39
129 lines
6761 bytes
6761 bytes
"Steve" <steve@mixmin.net> wrote in message
news:slrngm3pic.5c4.steve@news.mixmin.net...
> On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
> Message-Id: <gjs7fc$s4a$1@snarked.org>:
>
> >=> $1 doesn't seem to be set to anything. What I am seeing is "437
> > Body ()". Bad_Body is set to NULL (or whatever value is chosen if
the
> > file doesn't exist in "read_hashes").
>
> That's interesting. So if bad_body (the file) doesn't exist,
$Bad_Body
> is set to NULL and then matches articles that (presumably) have no
> payload or at least match an empty regex. I've applied a patch to
svn
> that should fix this behaviour.
I wasn't certain what the exact behavior is, but in my case, I have no
bad_body file, so the expression should be null or empty.
> if ($config{aggressive}) {
> - if (not $gr{reports} and not $hdr{References}) {
> + if (not $gr{reports} and not $hdr{References}
> + and $Bad_Body) {
> return reject("Body ($1)", 'Bad Body')
> if $body =~ /($Bad_Body)/;
> };
I agree that should fix the "null/empty" condition. However, what is
"$1" supposed to be set to? The expression found? (Sorry, I never
properly learned perl.) If an empty regex expression "~//" matches
everything, that would be a problem, and explains why $1 is also null.
> This can be downloaded from
> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are
some
> other updates since the previous release).
>
> > What's triggering this: I think the inclusion of a URL (of a news
> > server's web site) in a post attempted to news.admin.peering is
where
> > I have most recently seen this. URLs for the servers' statistics
> > pages need to pass this filter.
> >
> > Should we have a list of groups where URLs are allowed in article
> > bodies (NOT including "shorturls")?
>
> Reporting groups are currently excluded from that filter but
> news.admin.peering is not defined in spam_report_groups. Therefore
if a
> post contains a URL that matches a regex defined in bad_body, it
would
> be rejected. Would you like a $bad_body_exclude regex so that
additional
> groups can be excluded from this filter? If so, should all groups
in a
> distribution have to match or just a single group?
What I was thinking of is a group list/regex that contains groups
where LIMITED URL posting is permitted. By limited, I imply 1 but
certainly NOT more than 3. "news.admin.peering" is such a group. So
would be some groups like "alt.review-my-website" or
"alt.on-what-website-can-I-find-X". Certain software-support groups
might want to be included if it is customary to include web page URLs
to the manual, etc., in articles (and replies).
Skipping ONLY bad_body might not be the correct approach. Defining
"aggressive" = 0 also bypasses a few other checks, and if I read the
script correctly, some of those [bypassed] checks are checks in the
body for URLs (in the scoring filter).
I believe that the URL-permitted groups should be subjected to other
tests (besides containing a URL) that spam_report_groups skip.
Therefore, adding these to "score_exclude" is not what I suggest. I
suggest yet another list of groups: url_groups
score .= "whatever" ... if (some url condition) and NOT
url_groups;
(adding AND NOT ....) - but not for "shorturl" URLs.
> > Note also - the definition of "IP" assumes IPv4 only. What about
IPv6?
>
> Yes, Cleanfeed's IP regex's currently only match IPv4. I'll try and
> update this in the near future.
OK. I do understand the mess with IPv6 BNF syntax.
Forms without "::" seem easy: [0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}
(or something like that).
The problem is the forms with "::" (including itself).
I don't know if these will occur, but they could: ::IPv4 and
::[Ff]{4}:IPv4 (where "IPv4" is the existing expression for that AF).
Other forms with "::" can be covered with 6 expressions (depending on
how many quad-groups prefix "::": 0-5, with a corresponding maximum of
5-0 trailing groups).
Therefore, if I've counted this correctly, all IPv6 addresses can be
covered with an expression that is a union (OR, "|") of 9 individual
expressions. That's a mess.
Instead of writing this from scratch, is there a perl library routine
on CPAN that has already been written to validate/match IPv6
addresses? I think it's worth looking for one.
-------- Other notes:
1) spam_report_groups: includes "\.spamtrap\." - which would NOT
catch group "alt.alt.spamtrap".
2) "alt.usenet.kooks" seems out-of-control with some of its recent
(off-topic) cross-postings. One posting from 28 Dec 2008 had 9 groups
(alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
of interest only to AUK. I may not like censorship, but I am also
against disruptive stupidity such as this (which seems to happen alot
with alt.BSG). Any thoughts as to adding anything with "kook" and
certain other miscreant words in the group name to the
anti-cross-posting (or limited cross-posting) filters for everyone (as
oposed to local settings)? Perhaps meow_groups or low_xpost_groups?
(I may do this locally if there's no global consensus.)
(meow_groups are not currently config_appendable).
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: D. Stussy
Date: Tue, 06 Jan 2009 01:39
Date: Tue, 06 Jan 2009 01:39
129 lines
6808 bytes
6808 bytes
"Steve" <steve@mixmin.net> wrote in message
news:slrngm3pic.5c4.steve@news.mixmin.net...
> On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
> Message-Id: <gjs7fc$s4a$1@snarked.org>:
>
> >=> $1 doesn't seem to be set to anything. What I am seeing is "437
> > Body ()". Bad_Body is set to NULL (or whatever value is chosen if
the
> > file doesn't exist in "read_hashes").
>
> That's interesting. So if bad_body (the file) doesn't exist,
$Bad_Body
> is set to NULL and then matches articles that (presumably) have no
> payload or at least match an empty regex. I've applied a patch to
svn
> that should fix this behaviour.
I wasn't certain what the exact behavior is, but in my case, I have no
bad_body file, so the expression should be null or empty.
> if ($config{aggressive}) {
> - if (not $gr{reports} and not $hdr{References}) {
> + if (not $gr{reports} and not $hdr{References}
> + and $Bad_Body) {
> return reject("Body ($1)", 'Bad Body')
> if $body =~ /($Bad_Body)/;
> };
I agree that should fix the "null/empty" condition. However, what is
"$1" supposed to be set to? The expression found? (Sorry, I never
properly learned perl.) If an empty regex expression "~//" matches
everything, that would be a problem, and explains why $1 is also null.
> This can be downloaded from
> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are
some
> other updates since the previous release).
>
> > What's triggering this: I think the inclusion of a URL (of a news
> > server's web site) in a post attempted to news.admin.peering is
where
> > I have most recently seen this. URLs for the servers' statistics
> > pages need to pass this filter.
> >
> > Should we have a list of groups where URLs are allowed in article
> > bodies (NOT including "shorturls")?
>
> Reporting groups are currently excluded from that filter but
> news.admin.peering is not defined in spam_report_groups. Therefore
if a
> post contains a URL that matches a regex defined in bad_body, it
would
> be rejected. Would you like a $bad_body_exclude regex so that
additional
> groups can be excluded from this filter? If so, should all groups
in a
> distribution have to match or just a single group?
What I was thinking of is a group list/regex that contains groups
where LIMITED URL posting is permitted. By limited, I imply 1 but
certainly NOT more than 3. "news.admin.peering" is such a group. So
would be some groups like "alt.review-my-website" or
"alt.on-what-website-can-I-find-X". Certain software-support groups
might want to be included if it is customary to include web page URLs
to the manual, etc., in articles (and replies).
Skipping ONLY bad_body might not be the correct approach. Defining
"aggressive" = 0 also bypasses a few other checks, and if I read the
script correctly, some of those [bypassed] checks are checks in the
body for URLs (in the scoring filter).
I believe that the URL-permitted groups should be subjected to other
tests (besides containing a URL) that spam_report_groups skip.
Therefore, adding these to "score_exclude" is not what I suggest. I
suggest yet another list of groups: url_groups
score .= "whatever" ... if (some url condition) and NOT
url_groups;
(adding AND NOT ....) - but not for "shorturl" URLs.
> > Note also - the definition of "IP" assumes IPv4 only. What about
IPv6?
>
> Yes, Cleanfeed's IP regex's currently only match IPv4. I'll try and
> update this in the near future.
OK. I do understand the mess with IPv6 BNF syntax.
Forms without "::" seem easy: [0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}
(or something like that).
The problem is the forms with "::" (including itself).
I don't know if these will occur, but they could: ::IPv4 and
::[Ff]{4}:IPv4 (where "IPv4" is the existing expression for that AF).
Other forms with "::" can be covered with 6 expressions (depending on
how many quad-groups prefix "::": 0-5, with a corresponding maximum of
5-0 trailing groups).
Therefore, if I've counted this correctly, all IPv6 addresses can be
covered with an expression that is a union (OR, "|") of 9 individual
expressions. That's a mess.
Instead of writing this from scratch, is there a perl library routine
on CPAN that has already been written to validate/match IPv6
addresses? I think it's worth looking for one.
-------- Other notes:
1) spam_report_groups: includes "\.spamtrap\." - which would NOT
catch group "alt.alt.spamtrap".
2) "alt.usenet.kooks" seems out-of-control with some of its recent
(off-topic) cross-postings. One posting from 28 Dec 2008 had 9 groups
(alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
of interest only to AUK. I may not like censorship, but I am also
against disruptive stupidity such as this (which seems to happen alot
with alt.BSG). Any thoughts as to adding anything with "kook" and
certain other miscreant words in the group name to the
anti-cross-posting (or limited cross-posting) filters for everyone (as
oposed to local settings)? Perhaps meow_groups or low_xpost_groups?
(I may do this locally if there's no global consensus.)
(meow_groups are not currently config_appendable).
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: D. Stussy
Date: Tue, 06 Jan 2009 01:39
Date: Tue, 06 Jan 2009 01:39
129 lines
6761 bytes
6761 bytes
"Steve" <steve@mixmin.net> wrote in message
news:slrngm3pic.5c4.steve@news.mixmin.net...
> On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
> Message-Id: <gjs7fc$s4a$1@snarked.org>:
>
> >=> $1 doesn't seem to be set to anything. What I am seeing is "437
> > Body ()". Bad_Body is set to NULL (or whatever value is chosen if
the
> > file doesn't exist in "read_hashes").
>
> That's interesting. So if bad_body (the file) doesn't exist,
$Bad_Body
> is set to NULL and then matches articles that (presumably) have no
> payload or at least match an empty regex. I've applied a patch to
svn
> that should fix this behaviour.
I wasn't certain what the exact behavior is, but in my case, I have no
bad_body file, so the expression should be null or empty.
> if ($config{aggressive}) {
> - if (not $gr{reports} and not $hdr{References}) {
> + if (not $gr{reports} and not $hdr{References}
> + and $Bad_Body) {
> return reject("Body ($1)", 'Bad Body')
> if $body =~ /($Bad_Body)/;
> };
I agree that should fix the "null/empty" condition. However, what is
"$1" supposed to be set to? The expression found? (Sorry, I never
properly learned perl.) If an empty regex expression "~//" matches
everything, that would be a problem, and explains why $1 is also null.
> This can be downloaded from
> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are
some
> other updates since the previous release).
>
> > What's triggering this: I think the inclusion of a URL (of a news
> > server's web site) in a post attempted to news.admin.peering is
where
> > I have most recently seen this. URLs for the servers' statistics
> > pages need to pass this filter.
> >
> > Should we have a list of groups where URLs are allowed in article
> > bodies (NOT including "shorturls")?
>
> Reporting groups are currently excluded from that filter but
> news.admin.peering is not defined in spam_report_groups. Therefore
if a
> post contains a URL that matches a regex defined in bad_body, it
would
> be rejected. Would you like a $bad_body_exclude regex so that
additional
> groups can be excluded from this filter? If so, should all groups
in a
> distribution have to match or just a single group?
What I was thinking of is a group list/regex that contains groups
where LIMITED URL posting is permitted. By limited, I imply 1 but
certainly NOT more than 3. "news.admin.peering" is such a group. So
would be some groups like "alt.review-my-website" or
"alt.on-what-website-can-I-find-X". Certain software-support groups
might want to be included if it is customary to include web page URLs
to the manual, etc., in articles (and replies).
Skipping ONLY bad_body might not be the correct approach. Defining
"aggressive" = 0 also bypasses a few other checks, and if I read the
script correctly, some of those [bypassed] checks are checks in the
body for URLs (in the scoring filter).
I believe that the URL-permitted groups should be subjected to other
tests (besides containing a URL) that spam_report_groups skip.
Therefore, adding these to "score_exclude" is not what I suggest. I
suggest yet another list of groups: url_groups
score .= "whatever" ... if (some url condition) and NOT
url_groups;
(adding AND NOT ....) - but not for "shorturl" URLs.
> > Note also - the definition of "IP" assumes IPv4 only. What about
IPv6?
>
> Yes, Cleanfeed's IP regex's currently only match IPv4. I'll try and
> update this in the near future.
OK. I do understand the mess with IPv6 BNF syntax.
Forms without "::" seem easy: [0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}
(or something like that).
The problem is the forms with "::" (including itself).
I don't know if these will occur, but they could: ::IPv4 and
::[Ff]{4}:IPv4 (where "IPv4" is the existing expression for that AF).
Other forms with "::" can be covered with 6 expressions (depending on
how many quad-groups prefix "::": 0-5, with a corresponding maximum of
5-0 trailing groups).
Therefore, if I've counted this correctly, all IPv6 addresses can be
covered with an expression that is a union (OR, "|") of 9 individual
expressions. That's a mess.
Instead of writing this from scratch, is there a perl library routine
on CPAN that has already been written to validate/match IPv6
addresses? I think it's worth looking for one.
-------- Other notes:
1) spam_report_groups: includes "\.spamtrap\." - which would NOT
catch group "alt.alt.spamtrap".
2) "alt.usenet.kooks" seems out-of-control with some of its recent
(off-topic) cross-postings. One posting from 28 Dec 2008 had 9 groups
(alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
of interest only to AUK. I may not like censorship, but I am also
against disruptive stupidity such as this (which seems to happen alot
with alt.BSG). Any thoughts as to adding anything with "kook" and
certain other miscreant words in the group name to the
anti-cross-posting (or limited cross-posting) filters for everyone (as
oposed to local settings)? Perhaps meow_groups or low_xpost_groups?
(I may do this locally if there's no global consensus.)
(meow_groups are not currently config_appendable).
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: D. Stussy
Date: Tue, 06 Jan 2009 01:39
Date: Tue, 06 Jan 2009 01:39
129 lines
6751 bytes
6751 bytes
"Steve" <steve@mixmin.net> wrote in message
news:slrngm3pic.5c4.steve@news.mixmin.net...
> On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
> Message-Id: <gjs7fc$s4a$1@snarked.org>:
>
> >=> $1 doesn't seem to be set to anything. What I am seeing is "437
> > Body ()". Bad_Body is set to NULL (or whatever value is chosen if
the
> > file doesn't exist in "read_hashes").
>
> That's interesting. So if bad_body (the file) doesn't exist,
$Bad_Body
> is set to NULL and then matches articles that (presumably) have no
> payload or at least match an empty regex. I've applied a patch to
svn
> that should fix this behaviour.
I wasn't certain what the exact behavior is, but in my case, I have no
bad_body file, so the expression should be null or empty.
> if ($config{aggressive}) {
> - if (not $gr{reports} and not $hdr{References}) {
> + if (not $gr{reports} and not $hdr{References}
> + and $Bad_Body) {
> return reject("Body ($1)", 'Bad Body')
> if $body =~ /($Bad_Body)/;
> };
I agree that should fix the "null/empty" condition. However, what is
"$1" supposed to be set to? The expression found? (Sorry, I never
properly learned perl.) If an empty regex expression "~//" matches
everything, that would be a problem, and explains why $1 is also null.
> This can be downloaded from
> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are
some
> other updates since the previous release).
>
> > What's triggering this: I think the inclusion of a URL (of a news
> > server's web site) in a post attempted to news.admin.peering is
where
> > I have most recently seen this. URLs for the servers' statistics
> > pages need to pass this filter.
> >
> > Should we have a list of groups where URLs are allowed in article
> > bodies (NOT including "shorturls")?
>
> Reporting groups are currently excluded from that filter but
> news.admin.peering is not defined in spam_report_groups. Therefore
if a
> post contains a URL that matches a regex defined in bad_body, it
would
> be rejected. Would you like a $bad_body_exclude regex so that
additional
> groups can be excluded from this filter? If so, should all groups
in a
> distribution have to match or just a single group?
What I was thinking of is a group list/regex that contains groups
where LIMITED URL posting is permitted. By limited, I imply 1 but
certainly NOT more than 3. "news.admin.peering" is such a group. So
would be some groups like "alt.review-my-website" or
"alt.on-what-website-can-I-find-X". Certain software-support groups
might want to be included if it is customary to include web page URLs
to the manual, etc., in articles (and replies).
Skipping ONLY bad_body might not be the correct approach. Defining
"aggressive" = 0 also bypasses a few other checks, and if I read the
script correctly, some of those [bypassed] checks are checks in the
body for URLs (in the scoring filter).
I believe that the URL-permitted groups should be subjected to other
tests (besides containing a URL) that spam_report_groups skip.
Therefore, adding these to "score_exclude" is not what I suggest. I
suggest yet another list of groups: url_groups
score .= "whatever" ... if (some url condition) and NOT
url_groups;
(adding AND NOT ....) - but not for "shorturl" URLs.
> > Note also - the definition of "IP" assumes IPv4 only. What about
IPv6?
>
> Yes, Cleanfeed's IP regex's currently only match IPv4. I'll try and
> update this in the near future.
OK. I do understand the mess with IPv6 BNF syntax.
Forms without "::" seem easy: [0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}
(or something like that).
The problem is the forms with "::" (including itself).
I don't know if these will occur, but they could: ::IPv4 and
::[Ff]{4}:IPv4 (where "IPv4" is the existing expression for that AF).
Other forms with "::" can be covered with 6 expressions (depending on
how many quad-groups prefix "::": 0-5, with a corresponding maximum of
5-0 trailing groups).
Therefore, if I've counted this correctly, all IPv6 addresses can be
covered with an expression that is a union (OR, "|") of 9 individual
expressions. That's a mess.
Instead of writing this from scratch, is there a perl library routine
on CPAN that has already been written to validate/match IPv6
addresses? I think it's worth looking for one.
-------- Other notes:
1) spam_report_groups: includes "\.spamtrap\." - which would NOT
catch group "alt.alt.spamtrap".
2) "alt.usenet.kooks" seems out-of-control with some of its recent
(off-topic) cross-postings. One posting from 28 Dec 2008 had 9 groups
(alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
of interest only to AUK. I may not like censorship, but I am also
against disruptive stupidity such as this (which seems to happen alot
with alt.BSG). Any thoughts as to adding anything with "kook" and
certain other miscreant words in the group name to the
anti-cross-posting (or limited cross-posting) filters for everyone (as
oposed to local settings)? Perhaps meow_groups or low_xpost_groups?
(I may do this locally if there's no global consensus.)
(meow_groups are not currently config_appendable).
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: Julien ÉLIE
Date: Tue, 06 Jan 2009 06:03
Date: Tue, 06 Jan 2009 06:03
154 lines
5041 bytes
5041 bytes
Hi D. Stussy,
> Instead of writing this from scratch, is there a perl library routine
> on CPAN that has already been written to validate/match IPv6
> addresses? I think it's worth looking for one.
Net::IP gives:
#------------------------------------------------------------------------------
# Subroutine ip_is_ipv6
# Purpose : Check if an IP address is version 6
# Params : IP address
# Returns : 1 (yes) or 0 (no)
sub ip_is_ipv6 {
my $ip = shift;
# Count octets
my $n = ($ip =~ tr/:/:/);
return (0) unless ($n > 0 and $n < 8);
# $k is a counter
my $k;
foreach (split /:/, $ip) {
$k++;
# Empty octet ?
next if ($_ eq '');
# Normal v6 octet ?
next if (/^[a-f\d]{1,4}$/i);
# Last octet - is it IPv4 ?
if ($k == $n + 1) {
next if (ip_is_ipv4($_));
}
$ERROR = "Invalid IP address $ip";
$ERRNO = 108;
return 0;
}
# Does the IP address start with : ?
if ($ip =~ m/^:[^:]/) {
$ERROR = "Invalid address $ip (starts with :)";
$ERRNO = 109;
return 0;
}
# Does the IP address finish with : ?
if ($ip =~ m/[^:]:$/) {
$ERROR = "Invalid address $ip (ends with :)";
$ERRNO = 110;
return 0;
}
# Does the IP address have more than one '::' pattern ?
if ($ip =~ s/:(?=:)//g > 1) {
$ERROR = "Invalid address $ip (More than one :: pattern)";
$ERRNO = 111;
return 0;
}
return 1;
}
#------------------------------------------------------------------------------
# Subroutine ip_is_ipv4
# Purpose : Check if an IP address is version 4
# Params : IP address
# Returns : 1 (yes) or 0 (no)
sub ip_is_ipv4 {
my $ip = shift;
# Check for invalid chars
unless ($ip =~ m/^[\d\.]+$/) {
$ERROR = "Invalid chars in IP $ip";
$ERRNO = 107;
return 0;
}
if ($ip =~ m/^\./) {
$ERROR = "Invalid IP $ip - starts with a dot";
$ERRNO = 103;
return 0;
}
if ($ip =~ m/\.$/) {
$ERROR = "Invalid IP $ip - ends with a dot";
$ERRNO = 104;
return 0;
}
# Single Numbers are considered to be IPv4
if ($ip =~ m/^(\d+)$/ and $1 < 256) { return 1 }
# Count quads
my $n = ($ip =~ tr/\./\./);
# IPv4 must have from 1 to 4 quads
unless ($n >= 0 and $n < 4) {
$ERROR = "Invalid IP address $ip";
$ERRNO = 105;
return 0;
}
# Check for empty quads
if ($ip =~ m/\.\./) {
$ERROR = "Empty quad in IP address $ip";
$ERRNO = 106;
return 0;
}
foreach (split /\./, $ip) {
# Check for invalid quads
unless ($_ >= 0 and $_ < 256) {
$ERROR = "Invalid quad in IP address $ip - $_";
$ERRNO = 107;
return 0;
}
}
return 1;
}
#------------------------------------------------------------------------------
# Subroutine ip_get_version
# Purpose : Get an IP version
# Params : IP address
# Returns : 4, 6, 0(don't know)
sub ip_get_version {
my $ip = shift;
# If the address does not contain any ':', maybe it's IPv4
$ip !~ /:/ and ip_is_ipv4($ip) and return '4';
# Is it IPv6 ?
ip_is_ipv6($ip) and return '6';
return;
}
--
Julien ÉLIE
« La vérité pure et simple est très rarement pure
et jamais simple. » (Oscar Wilde)
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: Urs Janßen
Date: Tue, 06 Jan 2009 15:46
Date: Tue, 06 Jan 2009 15:46
21 lines
2277 bytes
2277 bytes
In <gjus7a$hk3$1@news.trigofacile.com>, Julien ÉLIE wrote:
>> Instead of writing this from scratch, is there a perl library routine
>> on CPAN that has already been written to validate/match IPv6
>> addresses? I think it's worth looking for one.
> Net::IP gives:
> sub ip_is_ipv6 {
[...]
tin uses
#v+
(?:(?:(?:2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(?:2[0-4]\d|25[0-5]|[01]?\d\d?)|\[(?:(?:[0-9A-F]{0,4}:){1,7}[0-9A-F]{1,4}|(?:[0-9A-F]{0,4}:){1,3}(?:(?:2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(?:2[0-4]\d|25[0-5]|[01]?\d\d?))\])
#v-
to check for a valid ipv4 or ipv6 address - this doesn't filter out
private address-space and isn't tested very well.
urs
--
Jef Poskanzer:
"When people aren't stupid Usenet is even more useful. Too bad this happens
so rarely."
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: Steve
Date: Tue, 06 Jan 2009 17:09
Date: Tue, 06 Jan 2009 17:09
74 lines
4771 bytes
4771 bytes
On Mon, 5 Jan 2009 17:39:01 -0800, D. Stussy wrote in
Message-Id: <gjuf94$qn5$1@snarked.org>:
> I agree that should fix the "null/empty" condition. However, what is
> "$1" supposed to be set to? The expression found? (Sorry, I never
> properly learned perl.) If an empty regex expression "~//" matches
> everything, that would be a problem, and explains why $1 is also null.
$1 matches the first bracketed element within the Regular Expression.
For example:
/([ab]12)3/
Would match b123 and $1 would return b12.
The change I made following your report should ensure that null is never
matched as Bad_Body must be True.
> What I was thinking of is a group list/regex that contains groups
> where LIMITED URL posting is permitted. By limited, I imply 1 but
> certainly NOT more than 3. "news.admin.peering" is such a group. So
> would be some groups like "alt.review-my-website" or
> "alt.on-what-website-can-I-find-X". Certain software-support groups
> might want to be included if it is customary to include web page URLs
> to the manual, etc., in articles (and replies).
I'll do some tests on this idea. It might be a good concept to apply to
the Scoring filters so that multiple URL's alone isn't enough to reject
an article.
(You suggested the same thing later in your post).
> Skipping ONLY bad_body might not be the correct approach. Defining
> "aggressive" = 0 also bypasses a few other checks, and if I read the
> script correctly, some of those [bypassed] checks are checks in the
> body for URLs (in the scoring filter).
If aggressive is True, various headers (Subject, From, Message-ID and
Organization) are checked against the one and two point word regexs.
With no bad_body file, this is the only behaviour altered by setting
aggressive. I'm going to take out the aggressive check on bad_body as
it's wrong to tie these two filters together by the same switch.
Especially as bad_body is disabled simply by not having the file.
> Instead of writing this from scratch, is there a perl library routine
> on CPAN that has already been written to validate/match IPv6
> addresses? I think it's worth looking for one.
Yes, there is a routine that does this. I haven't played with it yet
but I'll take a look now.
> 1) spam_report_groups: includes "\.spamtrap\." - which would NOT
> catch group "alt.alt.spamtrap".
Changed to \.spamtrap
> 2) "alt.usenet.kooks" seems out-of-control with some of its recent
> (off-topic) cross-postings. One posting from 28 Dec 2008 had 9 groups
> (alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
> alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
> alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
> of interest only to AUK. I may not like censorship, but I am also
> against disruptive stupidity such as this (which seems to happen alot
> with alt.BSG). Any thoughts as to adding anything with "kook" and
> certain other miscreant words in the group name to the
> anti-cross-posting (or limited cross-posting) filters for everyone (as
> oposed to local settings)? Perhaps meow_groups or low_xpost_groups?
> (I may do this locally if there's no global consensus.)
This is a tricky one, just about everything in alt.usenet.kooks is
widely crossposted. Making it low-crosspost would filter a high
percentage of its content. It would help if people properly employed
Followup-To headers. Perhaps that's food for another scoring filter.
> (meow_groups are not currently config_appendable).
There's probably an historical reason why that is but unless somebody
can tell me what it is, I'll make it appendable.
--
pub 1024D/228761E7 2003-06-04 Steven Crook
Key fingerprint = 1CD9 95E1 E9CE 80D6 C885 B7EB B471 80D5 2287 61E7
uid Steven Crook <steve@mixmin.net>
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: Gary L. Burnore
Date: Tue, 06 Jan 2009 22:44
Date: Tue, 06 Jan 2009 22:44
144 lines
7677 bytes
7677 bytes
On Mon, 5 Jan 2009 17:39:01 -0800, "D. Stussy" <spam@bde-arc.ampr.org>
wrote:
>"Steve" <steve@mixmin.net> wrote in message
>news:slrngm3pic.5c4.steve@news.mixmin.net...
>> On Sun, 4 Jan 2009 21:56:53 -0800, D. Stussy wrote in
>> Message-Id: <gjs7fc$s4a$1@snarked.org>:
>>
>> >=> $1 doesn't seem to be set to anything. What I am seeing is "437
>> > Body ()". Bad_Body is set to NULL (or whatever value is chosen if
>the
>> > file doesn't exist in "read_hashes").
>>
>> That's interesting. So if bad_body (the file) doesn't exist,
>$Bad_Body
>> is set to NULL and then matches articles that (presumably) have no
>> payload or at least match an empty regex. I've applied a patch to
>svn
>> that should fix this behaviour.
>
>I wasn't certain what the exact behavior is, but in my case, I have no
>bad_body file, so the expression should be null or empty.
>
>> if ($config{aggressive}) {
>> - if (not $gr{reports} and not $hdr{References}) {
>> + if (not $gr{reports} and not $hdr{References}
>> + and $Bad_Body) {
>> return reject("Body ($1)", 'Bad Body')
>> if $body =~ /($Bad_Body)/;
>> };
>
>I agree that should fix the "null/empty" condition. However, what is
>"$1" supposed to be set to? The expression found? (Sorry, I never
>properly learned perl.) If an empty regex expression "~//" matches
>everything, that would be a problem, and explains why $1 is also null.
>
>> This can be downloaded from
>> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed (note there are
>some
>> other updates since the previous release).
>>
>> > What's triggering this: I think the inclusion of a URL (of a news
>> > server's web site) in a post attempted to news.admin.peering is
>where
>> > I have most recently seen this. URLs for the servers' statistics
>> > pages need to pass this filter.
>> >
>> > Should we have a list of groups where URLs are allowed in article
>> > bodies (NOT including "shorturls")?
>>
>> Reporting groups are currently excluded from that filter but
>> news.admin.peering is not defined in spam_report_groups. Therefore
>if a
>> post contains a URL that matches a regex defined in bad_body, it
>would
>> be rejected. Would you like a $bad_body_exclude regex so that
>additional
>> groups can be excluded from this filter? If so, should all groups
>in a
>> distribution have to match or just a single group?
>
>What I was thinking of is a group list/regex that contains groups
>where LIMITED URL posting is permitted. By limited, I imply 1 but
>certainly NOT more than 3. "news.admin.peering" is such a group. So
>would be some groups like "alt.review-my-website" or
>"alt.on-what-website-can-I-find-X". Certain software-support groups
>might want to be included if it is customary to include web page URLs
>to the manual, etc., in articles (and replies).
>
>Skipping ONLY bad_body might not be the correct approach. Defining
>"aggressive" = 0 also bypasses a few other checks, and if I read the
>script correctly, some of those [bypassed] checks are checks in the
>body for URLs (in the scoring filter).
>
>I believe that the URL-permitted groups should be subjected to other
>tests (besides containing a URL) that spam_report_groups skip.
>Therefore, adding these to "score_exclude" is not what I suggest. I
>suggest yet another list of groups: url_groups
>
> score .= "whatever" ... if (some url condition) and NOT
>url_groups;
>(adding AND NOT ....) - but not for "shorturl" URLs.
>
>> > Note also - the definition of "IP" assumes IPv4 only. What about
>IPv6?
>>
>> Yes, Cleanfeed's IP regex's currently only match IPv4. I'll try and
>> update this in the near future.
>
>OK. I do understand the mess with IPv6 BNF syntax.
>
>Forms without "::" seem easy: [0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}
>(or something like that).
>
>The problem is the forms with "::" (including itself).
>
>I don't know if these will occur, but they could: ::IPv4 and
>::[Ff]{4}:IPv4 (where "IPv4" is the existing expression for that AF).
>
>Other forms with "::" can be covered with 6 expressions (depending on
>how many quad-groups prefix "::": 0-5, with a corresponding maximum of
>5-0 trailing groups).
>
>Therefore, if I've counted this correctly, all IPv6 addresses can be
>covered with an expression that is a union (OR, "|") of 9 individual
>expressions. That's a mess.
>
>Instead of writing this from scratch, is there a perl library routine
>on CPAN that has already been written to validate/match IPv6
>addresses? I think it's worth looking for one.
>
>-------- Other notes:
>
>1) spam_report_groups: includes "\.spamtrap\." - which would NOT
>catch group "alt.alt.spamtrap".
>
>2) "alt.usenet.kooks" seems out-of-control with some of its recent
>(off-topic) cross-postings. One posting from 28 Dec 2008 had 9 groups
>(alt.nuke.the.usa, alt.fan.oj-simpson, alt.usenet.kooks,
>alt.obituaries, rec.arts.poems, soc.men, alt.fan.art-bell,
>alt.battlestar-galactica, alt.fluff-girl.pinku-sensei) but was clearly
>of interest only to AUK. I may not like censorship, but I am also
>against disruptive stupidity such as this (which seems to happen alot
>with alt.BSG). Any thoughts as to adding anything with "kook" and
>certain other miscreant words in the group name to the
>anti-cross-posting (or limited cross-posting) filters for everyone (as
>oposed to local settings)? Perhaps meow_groups or low_xpost_groups?
>(I may do this locally if there's no global consensus.)
>
>(meow_groups are not currently config_appendable).
>
Any reason why you need to write the same thing twice?
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
. | ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
===========================================================================
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: Bruce Esquibel
Date: Tue, 06 Jan 2009 23:34
Date: Tue, 06 Jan 2009 23:34
8 lines
1194 bytes
1194 bytes
Gary L. Burnore <gburnore@databasix.com> wrote: > Any reason why you need to write the same thing twice? Lucky you, there are seven copies on my server. -bruce bje@ripco.com
Re: Cleanfeed - "body ()" rejections (and IPv6)
Author: D. Stussy
Date: Wed, 07 Jan 2009 08:58
Date: Wed, 07 Jan 2009 08:58
12 lines
1720 bytes
1720 bytes
"Bruce Esquibel" <bje@e4500.ripco.com> wrote in message news:gk0ppm$qhv$1@remote5bge0.ripco.com... > Gary L. Burnore <gburnore@databasix.com> wrote: > > > Any reason why you need to write the same thing twice? > > Lucky you, there are seven copies on my server. Sorry - caused by an error between my server and client (where the client thought the server errorred). I've cancelled the duplicates.
Re: Cleanfeed - "body ()" rejections
Author: Julien ÉLIE
Date: Sun, 11 Jan 2009 12:02
Date: Sun, 11 Jan 2009 12:02
43 lines
2894 bytes
2894 bytes
Hi Steve,
>>=> $1 doesn't seem to be set to anything. What I am seeing is "437
>> Body ()". Bad_Body is set to NULL (or whatever value is chosen if the
>> file doesn't exist in "read_hashes").
>
> That's interesting. So if bad_body (the file) doesn't exist, $Bad_Body
> is set to NULL and then matches articles that (presumably) have no
> payload or at least match an empty regex. I've applied a patch to svn
> that should fix this behaviour.
I also suffer from a similar problem here:
} elsif ($hdr{Control} =~ /^\s*(\w+)(?:\s+(.*))?/) {
my $control_type = $1;
my $control_group = $2;
return reject("$control_type with Supersedes header")
if $hdr{Supersedes};
return reject("Unwanted $1 message", 'Bad control message')
if $config{drop_useless_controls}
and $control_type =~ /^(?:sendsys|senduuname|version)$/;
return reject("Unwanted $1 message", 'Bad control message')
if $config{drop_ihave_sendme}
and $control_type =~ /^(?:ihave|sendme)$/;;
}
I receive "Unwanted message" instead of "Unwanted sendsys message"
for instance.
Maybe $control_type should be used instead of $1.
$control_group is not used (and may not be initialized too).
I have just tried to inject a few of these control messages to Usenet.
But they did not go very far!
--
Julien ÉLIE
« Je ne suis ni pour ni contre, bien au contraire ! » (Coluche)
Re: Cleanfeed - "body ()" rejections
Author: Steve
Date: Sun, 11 Jan 2009 13:39
Date: Sun, 11 Jan 2009 13:39
24 lines
1867 bytes
1867 bytes
On Sun, 11 Jan 2009 13:02:25 +0100, =?Windows-1252?Q?Julien_=C9LIE?= wrote in
Message-Id: <gkcn4i$gpl$1@news.trigofacile.com>:
> I receive "Unwanted message" instead of "Unwanted sendsys message"
> for instance. Maybe $control_type should be used instead of $1.
> $control_group is not used (and may not be initialized too).
Hi Julien,
Thanks for the report, this behaviour was caused by the extended regex
syntax (?:foo|bar) instead of just (foo|bar). The result is that $1
isn't populated with the match within parenthesis.
I've corrected this in svn now and would appreciate it if you could
confirm it resolves your problem.
http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed
If that works, I'll do a formal update, there are a few changes since
the last that should go into mainstream.
Steve
--
pub 1024D/228761E7 2003-06-04 Steven Crook
Key fingerprint = 1CD9 95E1 E9CE 80D6 C885 B7EB B471 80D5 2287 61E7
uid Steven Crook <steve@mixmin.net>
Re: Cleanfeed - "body ()" rejections
Author: Julien ÉLIE
Date: Sun, 11 Jan 2009 14:12
Date: Sun, 11 Jan 2009 14:12
55 lines
3200 bytes
3200 bytes
Hi Steve,
> Thanks for the report, this behaviour was caused by the extended regex
> syntax (?:foo|bar) instead of just (foo|bar). The result is that $1
> isn't populated with the match within parenthesis.
Sure, but matching is useless because it is exactly $control_type
in the reject call.
And $control_group is also useless with its "my" scope here:
} elsif ($hdr{Control} =~ /^\s*(\w+)(?:\s+(.*))?/) {
my $control_type = $1;
my $control_group = $2;
return reject("$control_type with Supersedes header")
if $hdr{Supersedes};
return reject("Unwanted $1 message", 'Bad control message')
if $config{drop_useless_controls}
and $control_type =~ /^(sendsys|senduuname|version)$/;
return reject("Unwanted $1 message", 'Bad control message')
if $config{drop_ihave_sendme}
and $control_type =~ /^(ihave|sendme)$/;
}
> I've corrected this in svn now and would appreciate it if you could
> confirm it resolves your problem.
> http://www.mixmin.net/svn/cleanfeed/trunk/cleanfeed
Yep, it works fine:
% inews -h sendsys-test
inews: cannot send article to server: 441 437 Unwanted sendsys message
inews: article not posted
> If that works, I'll do a formal update, there are a few changes since
> the last that should go into mainstream.
I especially like the scoring feature with "!" and "*".
However, note that stars are missing here:
#$score -= 3;
$score .= "**Refs";
#$score -= 2 if $hdr{References} =~ /^<[^>]+>\s+</;
$score .= "*GoodRefs"
--
Julien ÉLIE
« Un seul être vous manque et tout est dépeuplé. » (Alphonse de Lamartine)
Re: Cleanfeed - "body ()" rejections
Author: Steve
Date: Sun, 11 Jan 2009 16:21
Date: Sun, 11 Jan 2009 16:21
61 lines
3714 bytes
3714 bytes
On Sun, 11 Jan 2009 15:12:41 +0100, =?Windows-1252?Q?Julien_=C9LIE?= wrote in
Message-Id: <gkcuor$q2o$1@news.trigofacile.com>:
> Sure, but matching is useless because it is exactly $control_type in
> the reject call. And $control_group is also useless with its "my"
> scope here:
I think I'm missing your point, lets try walking through the section.
> } elsif ($hdr{Control} =~ /^\s*(\w+)(?:\s+(.*))?/) {
> my $control_type = $1;
> my $control_group = $2;
So if the Control header matches that regex, control_type must exist and
gets set to $1 (matching the (\w+). control_group will be set to $2 but
that could be null as the entire bracketed section in the regex is
suffixed with a ?.
> return reject("$control_type with Supersedes header")
> if $hdr{Supersedes};
This only applies to Supersedes headers and matches regardless of the
Control type.
> return reject("Unwanted $1 message", 'Bad control message')
> if $config{drop_useless_controls}
> and $control_type =~ /^(sendsys|senduuname|version)$/;
In this section, the message gets rejected if control_type is sendsys,
senduuname or version. If there is a match, $1 is set to the exact
control header type. Slightly odd logic as $1 will be identical to
$control_type. Due to this, you could say "Unwanted $control_type
message" instead.
> return reject("Unwanted $1 message", 'Bad control message')
> if $config{drop_ihave_sendme}
> and $control_type =~ /^(ihave|sendme)$/;
As above, but this only applies if $config{drop_ihave_sendme} is true.
$control_group should be fine as it's not used anywhere outside of the
filter_art function.
> I especially like the scoring feature with "!" and "*".
I only planned to use that for some diagnosis on scoring and then
decided it was worth leaving in as it brings some clarity as to why
messages score.
> However, note that stars are missing here:
> #$score -= 3;
> $score .= "**Refs";
> #$score -= 2 if $hdr{References} =~ /^<[^>]+>\s+</;
> $score .= "*GoodRefs"
I deliberately reduced the positive scores for these checks. Many of
the spam messages I checked out had perfectly valid References headers
(in terms of format) but didn't reference real articles. The header was
only included in order to circumvent such a check. Since reducing this
I've been keeping a careful eye on what's being rejected to make sure
real messages aren't trapped.
--
pub 1024D/228761E7 2003-06-04 Steven Crook
Key fingerprint = 1CD9 95E1 E9CE 80D6 C885 B7EB B471 80D5 2287 61E7
uid Steven Crook <steve@mixmin.net>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads