Article View: news.software.nntp
Article #31434Re: News RBL
From: Robert Bonomi
Date: Wed, 16 Sep 1998 00:00
Date: Wed, 16 Sep 1998 00:00
93 lines
5057 bytes
5057 bytes
In article <6toqlr$oa2$1@news1.exit109.com>,
Jeremy <jeremy@exit109.com> wrote:
>bill davidsen <davidsen@tmr.com> wrote:
>
[.. snip ..]
>>
>> This allows for extension, as long as the original spec warns that you
>> must be prepared for extra parameters. Then the sites which want to
>> just drop everything from any problem site can just use field one,
>> those which want to be more judicious can use more.
>
>I'd like to be able to go further than just by site. Sites could be
>added, but I'd also like, for example, to be able to specify critera
>for catching whatever spam happens to be getting past at the moment,
>or whatever. Or, specify a bad site that we only drop cancels and/or
>supersedes from. Etc.
>
>Thus, something flexible enough to create an entirely new filter that
>isn't already in cleanfeed -- but without allowing arbitrary Perl code.
>
>So I've been pondering how to do this in a way that isn't terribly
>complex to parse. Unfortunately, I need "and" and "or", and things
>like nested parenthesis aren't especially easy to parse...
Idea:
With only a handful of 'special case' tests (e.g., 'upper/lower bound
on article size', 'is binary', and 'contains HTML'),
I believe all the other 'fundamental' checks can be _expressed_ with
regexps,
If we consider a regexp as effectively a boolean -- returning TRUE or
FALSE, based on a successful/un-successful match.
One can then derive a fairly straightforward 'grammar' for expressing
an arbitrarily complex filter.
Postulate a 'term', consists of:
a constant,
-or-
a regexp, possibly with some modifier flags (e.g., to restrict
to headers only, only 'standardized' headers, body only, etc.),
and two numeric values.
-or-
an identifier for a 'special case' test, and two numeric values.
The 'special case' evaluates similarly to a regexp, and will be
treated as equivalent hereafter.
A non-constant 'term' evaluates to the first number if the regexp match
is TRUE, the second number if FALSE.
Usual 4-function arithmetic operators for combining results of terms.
all operators are equal priority, relying on postfix notation for
priority of evaluation.
Now one can express any filter as:
{{Threshold value}}
{{regexp [,flags]}} matchval nomatchval {{operator(s)}}
[ {{regexp [,flags]}} matchval nomatchval {{operator(s)}} ]
Evaluation of the series of terms -- simple 'four-function calculator'
using postfix notation.
The last operator will use the 'threshold' value as one of its operands,
so, one just looks at the 'final' value in the "calculator", and makes
the dump/no-dump decision basis the sign of the value.
"Publication" of a filter would consist of:
1) the author identity
2) an 'expiration date'
3) a 'unique identifier' assigned by the author (need be unique
-only- with respect to filters by that author)
4) the filter itself
5) an 'authenticator' to establish that all the above _did_ come
from the declared author.
The 'unique identifier' allows an author to retract/replace/update
a filter, by publishing a new definition for the same identifier.
"Accepting" a filter involves:
1) verify the authenticator. ignore if authentication fails
2) a table look-up against 'trusted' authors. ignore if not trusted
3) look-up against 'known' identifiers from that author
4) add/update as appropriate.
"Distribution" could be via mailing-list, ftp, website, or even
newsgroup (another message form for 'news.lists.filters' ??)
The proposed methodology for evaluating a filter, has one drawback that
I can see. Because it is arithmetic (a la 'scorefiles') rather than
simple boolean (a la 'killfiles'), it does _not_ allow for 'short-circuit
evaluation' -- I don't have a good feel for how much of a performance
difference this will make. If it is an issue, one could expand list of
allowed operators to include booleans, and add boolean logic to the
'calculator'. and, on 'execution' of a boolean operator, one _could_
determine if, and how many, items can be discarded from the operator/data
stacks.
Technical Details
Message-ID:
<6tpbe5$3at@enews3.newsguy.com>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!not-for-mailReferences:
<MPG.10683519d064f10b9896cf@enews.newsguy.com> <6tmpe9$aer$1@news1.exit109.com> <6tontg$7sia$1@newssvr04-int.news.prodigy.com> <6toqlr$oa2$1@news1.exit109.com>Show Full Headers
Complete Article Headers
Message-ID: <6tpbe5$3at@enews3.newsguy.com> Subject: Re: News RBL Date: Wed, 16 Sep 1998 00:00:00 +0000 From: robert@news.bonomi.com (Robert Bonomi) References: <MPG.10683519d064f10b9896cf@enews.newsguy.com> <6tmpe9$aer$1@news1.exit109.com> <6tontg$7sia$1@newssvr04-int.news.prodigy.com> <6toqlr$oa2$1@news1.exit109.com> 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!not-for-mail X-Deja-AN: 391859801 Organization: Robert Bonomi Consulting Newsgroups: news.admin.net-abuse.usenet,news.software.nntp