On Jan 30, 2:18am, Jason L Tibbitts III wrote:
> If you had the concept of the severity of a taboo/admin match, where each
> rule/regexp could have a "badness" associated with it, how would you deal
> with multiple taboo matches? Would the severities be cumulative, or would
> you just use the worst one?
>
> The idea is to make a distinction between "zubscribe" at the beginning of
> a line and embedded in the text somewhere, so that you could, say, let
> zubscribers commit transgressions which non-zubscribers would not be
> allowed. This is very close to working, but I can't decide on appropriate
> semantics.
Frankly I think that the best of all worlds would be to add something like
taboo_eval = <<EOF
$B =~ m{\bzsubscribe\b} and ! $MEMBER
$H =~ m{^From.*hotmail}m and $B =~ m{CASH}
length($B) > 5000 and ! $B =~ m{Ratings Summary}
EOF
to be handled as follows:
* Special variables would be initialized: B = body, H = header, MEMBER = boolean
whether poster also subscribes, etc, use your imagination
* The taboo_eval string would be converted to an array of evals:
@taboo_evals = grep(length, split(/\s*\n\s*/,$taboo_eval))
* The message would be tested against that array of evals:
foreach $te (@taboo_evals) {
eval "\$bounce = ($eval);"
break unless $bounce;
}
Unfortunately there are security issues here that would make taboo_eval useful only
for "friendly" sites. A simpler fallback that does what Jason wants would be to
extend the syntax of 'taboo' strings to allow one or more flags at the end:
taboo_body = <<EOF
/zubscribe/,N
EOF
where N means nonmember, and you could add other flags as you think of them.
I don't know whether cumulative "scores" of transgressions would help particularly.
--
Tom Neff :: tneff@panix.com :: <URL:http://www.panix.com/~tneff/>
Follow-Ups:
|
|