You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by qu...@apache.org on 2005/05/08 05:25:48 UTC
svn commit: r169124 - in /spamassassin/trunk:
lib/Mail/SpamAssassin/EvalTests.pm rules/70_testing.cf
Author: quinlan
Date: Sat May 7 20:25:47 2005
New Revision: 169124
URL: http://svn.apache.org/viewcvs?rev=169124&view=rev
Log:
it took a long while to catch up, but the ReplaceTags are now working
better on the whole, so let's move that way since ReplaceTags is tunable
per-rule, run as standard rules (so --loghits and per-rule profiling
works), and don't require code changes to update replacements
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
spamassassin/trunk/rules/70_testing.cf
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm?rev=169124&r1=169123&r2=169124&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm Sat May 7 20:25:47 2005
@@ -3137,69 +3137,6 @@
###########################################################################
-{
- my %obfu_cache = ();
- my %repllist = (
- 'a' => '[a@]',
- 'e' => '[e3]',
- 'o' => '[o0]',
- 'i' => '[il1|!]',
- 'l' => '[l1|!]',
- 'u' => '[uv]',
- 'v' => '(?:v|\\\/)',
- 'x' => '(?:x|><)',
- );
-
- sub check_obfu_word {
- my($self, $body, $word) = @_;
-
- # force lowercase since we're case insensitive anyway
- $word = lc $word;
-
- my $new;
- unless ($obfu_cache{$word}) {
- $new = '';
- my @list = split(//, $word);
- while ($_ = shift @list) {
- if (exists $repllist{$_}) {
- $_ = $repllist{$_};
- }
-
- # turn "foo" into "f\W*o\W*o" to match interuptus
- if (@list) {
- $new .= $_.'{1,3}\W{0,3}';
- }
- else {
- # mad skillz yo
- if ($_ eq 's') {
- # we should figure out how to handle "pill's benefits"
- $_ = '[sz]';
- }
-
- $new .= $_;
- }
- }
-
- # cache both the word and the new RE
- $obfu_cache{$word} = qr/\b(?!$word)$new\b/i;
- }
-
- # this word will be cached now, use that version
- $new = $obfu_cache{$word};
-
- foreach (@{$body}) {
- if (/$new/) {
- #warn ">> $new\n$_\n\n";
- return 1;
- }
- }
-
- return 0;
- }
-}
-
-###########################################################################
-
sub check_ratware_name_id {
my ($self) = @_;
Modified: spamassassin/trunk/rules/70_testing.cf
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/rules/70_testing.cf?rev=169124&r1=169123&r2=169124&view=diff
==============================================================================
--- spamassassin/trunk/rules/70_testing.cf (original)
+++ spamassassin/trunk/rules/70_testing.cf Sat May 7 20:25:47 2005
@@ -76,48 +76,6 @@
########################################################################
-#### PHRASE OBFUSCATION RULES ####
-
-# these need to have "decently long" words. things like "sex" FP too easily
-# in normal use, ala: "jackson's ex-wife" vs "Best S E X you"
-body T_INT_AFFORDABLE eval:check_obfu_word('affordable')
-body T_INT_ANXIETY eval:check_obfu_word('anxiety')
-body T_INT_BILLION eval:check_obfu_word('billion')
-body T_INT_CELEBREX eval:check_obfu_word('celebrex')
-body T_INT_CPILL eval:check_obfu_word('cialis')
-body T_INT_CREDIT eval:check_obfu_word('credit')
-body T_INT_ERECT eval:check_obfu_word('erection')
-body T_INT_FREE eval:check_obfu_word('free')
-body T_INT_HUNDREDS eval:check_obfu_word('hundreds')
-body T_INT_LPILL eval:check_obfu_word('levitra')
-body T_INT_MILF eval:check_obfu_word('milf')
-body T_INT_MILLION eval:check_obfu_word('million')
-body T_INT_MONEY eval:check_obfu_word('money')
-body T_INT_MORTGAGE eval:check_obfu_word('mortgage')
-body T_INT_OBLIGATION eval:check_obfu_word('obligation')
-body T_INT_OFFERS eval:check_obfu_word('offers')
-body T_INT_PENIS eval:check_obfu_word('penis')
-body T_INT_PHARMACY eval:check_obfu_word('pharmacy')
-body T_INT_PHENT eval:check_obfu_word('phentermine')
-body T_INT_PRESCRIPT eval:check_obfu_word('prescription')
-body T_INT_PROFIT eval:check_obfu_word('profit')
-body T_INT_REFINANCE eval:check_obfu_word('refinance')
-body T_INT_ROLEX eval:check_obfu_word('rolex')
-body T_INT_SOFTWARE eval:check_obfu_word('software')
-body T_INT_THOUSANDS eval:check_obfu_word('thousands')
-body T_INT_VALIUM eval:check_obfu_word('valium')
-body T_INT_VPILL eval:check_obfu_word('viagra')
-body T_INT_VICODIN eval:check_obfu_word('vicodin')
-body T_INT_VIOXX eval:check_obfu_word('vioxx')
-body T_INT_XPILL eval:check_obfu_word('xanax')
-
-# TVD: my FPs for this are all things like "pill's benefits"
-body T_INT_PILLS eval:check_obfu_word('pills')
-
-# TVD: my FPs for this are from last names in sentences.
-# ala "... see Dave Price's results for ..."
-body T_INT_PRICES eval:check_obfu_word('prices')
-
# use ReplaceTags
ifplugin Mail::SpamAssassin::Plugin::ReplaceTags