SA Bugzilla – Bug 39
Line of yelling rule matches all periods
Last modified: 2002-06-15 03:58:08 UTC
The line of yelling rule: body LINE_OF_YELLING /^[A-Z0-9\$\.,\'\!\?\s]{20,}[A-Z0-9\$\.,\'\!\?][A-Z0-9\$\.,\'\!\?\s]{20,}$/ describe LINE_OF_YELLING A WHOLE LINE OF YELLING DETECTED matches a line of periods used as a separator in a mailing list I'm on: ........................................................... Foo text foo
*** Bug 38 has been marked as a duplicate of this bug. ***
Maybe something like /^(?:(?:[A-Z]+[\d\$\.\'\!\?\s]*){20,}|(?:[\d\$\.\'\!\?\s]*[A-Z]+){20,})| (?:(?:[A-Z]+[\d\$\.\'\!\?\s]*){20,}|(?:[\d\$\.\'\!\?\s]*[A-Z]+){20,})$/x I realize the above wouldn't work, but I'm suggesting it as an avenue, i.e., the idea is to find <word> <punctuation> <word> <punctation> ... <word> <punctuation> sets. The problem with regexps like these is they tend to generate exponential backoff strategies/times, which makes them VERY slow. Someone in the list (can't recall who) suggested this should be an eval test as s/[\d\$\.\'\!\?\s]//g prior to the test, which would simplify the test substantially.
Here's a patch (vs v2.1) for an eval test: *** /usr/home/rlm/src/RPMS/BUILD/Mail-SpamAssassin-2.1/lib/Mail/SpamAssassin/EvalTests.pm.~1~ Fri Mar 1 05:29:36 2002 --- /usr/home/rlm/src/RPMS/BUILD/Mail-SpamAssassin-2.1/lib/Mail/SpamAssassin/EvalTests.pm Sun Mar 3 17:04:50 2002 *************** *** 882,887 **** --- 882,897 ---- return 0; } + sub check_for_yelling { + my ($self, $body) = @_; + local ($_); + foreach (@{$body}) { + s/[\d\$\.,\'\"\!\?\s]//g; + return 1 if (/^[A-Z]{20,}/ && /[A-Z]{20,}$/); + } + return; + } + ########################################################################### # FULL-MESSAGE TESTS: ###########################################################################
Sorry, that should be /usr/home/rlm/src/RPMS/BUILD/Mail-SpamAssassin-2.1/lib/Mail/SpamAssassin/EvalTests.pm.~1~ Fri Mar 1 05:29:36 2002 --- /usr/home/rlm/src/RPMS/BUILD/Mail-SpamAssassin-2.1/lib/Mail/SpamAssassin/EvalTests.pm Sun Mar 3 17:08:04 2002 *************** *** 882,887 **** --- 882,897 ---- return 0; } + sub check_for_yelling { + my ($self, $body) = @_; + local ($_); + foreach (@{$body}) { + s/[\d\$\.,\'\"\!\?\s]//g; + return 1 if (/^[A-Z]{20,}/ && /[A-Z]{20,}$/); + } + return 0; + } + ########################################################################### # FULL-MESSAGE TESTS: ###########################################################################
Jeez, try again -- can't modified $_ unless you like having $body modified: *** /usr/home/rlm/src/RPMS/BUILD/Mail-SpamAssassin-2.1/lib/Mail/SpamAssassin/EvalTests.pm.~1~ Fri Mar 1 05:29:36 2002 --- /usr/home/rlm/src/RPMS/BUILD/Mail-SpamAssassin-2.1/lib/Mail/SpamAssassin/EvalTests.pm Sun Mar 3 17:11:52 2002 *************** *** 882,887 **** --- 882,899 ---- return 0; } + sub check_for_yelling { + my ($self, $body) = @_; + local ($_); + my $l; + foreach $l (@{$body}) { + $_ = $l; + s/[\d\$\.,\'\"\!\?\s]//g; + return 1 if (/^[A-Z]{20,}/ && /[A-Z]{20,}$/); + } + return 0; + } + ########################################################################### # FULL-MESSAGE TESTS: ###########################################################################
You're missing a lot of files. Download the distro again and retry.
Not sure I understand (a) what you mean by "you're missing a lot of files" (spam?) (b) why this was tagged RESOLVED INVALID
The directory listing you showed is missing files that are in the distribution -- you either didn't download the full distribution, or there was some problem in untarring or something. Download again, and it should work. It was closed as "invalid" because the problem is not a bug in the distribution, but looks more like some network or user error.
Directory listing? What directory listing? Are we looking at the same bug?
We're looking at different bugs -- my bad apparently. I'll reopen then re-close as FIXED.