Mailing List Archive

svn commit: rev 6746 - in incubator/spamassassin/trunk: . ldap lib/Mail/SpamAssassin masses rules spamc spamd sql t
Author: duncf
Date: Wed Feb 18 17:24:48 2004
New Revision: 6746

Modified:
incubator/spamassassin/trunk/USAGE
incubator/spamassassin/trunk/ldap/README
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin.pm
incubator/spamassassin/trunk/masses/mass-check
incubator/spamassassin/trunk/rules/10_misc.cf
incubator/spamassassin/trunk/rules/user_prefs.template
incubator/spamassassin/trunk/spamassassin.raw
incubator/spamassassin/trunk/spamc/spamc.pod
incubator/spamassassin/trunk/spamd/spamd.raw
incubator/spamassassin/trunk/sql/README
incubator/spamassassin/trunk/t/reportheader.t
incubator/spamassassin/trunk/t/spam.t
incubator/spamassassin/trunk/t/spamd.t
incubator/spamassassin/trunk/t/spamd_ldap.t
incubator/spamassassin/trunk/t/spamd_maxchildren.t
incubator/spamassassin/trunk/t/spamd_parallel.t
incubator/spamassassin/trunk/t/spamd_port.t
incubator/spamassassin/trunk/t/spamd_unix.t
incubator/spamassassin/trunk/t/spamd_utf8.t
incubator/spamassassin/trunk/t/utf8.t
Log:
Bug 1332: replace hits with points (or score) internally and externally... Some variable names have changed, notably $self->{hits} is now $self->{score}. Backwards compatibility is maintained where possible

Modified: incubator/spamassassin/trunk/USAGE
==============================================================================
--- incubator/spamassassin/trunk/USAGE (original)
+++ incubator/spamassassin/trunk/USAGE Wed Feb 18 17:24:48 2004
@@ -27,10 +27,11 @@
with a report from SpamAssassin, and there should be no errors when you
run the commands.

- Even though sample-nonspam.txt is not spam, nonspam.out will contain a
- SpamAssassin report anyway. This is a side-effect of the "-t" (test)
- switch. However, there should be less than 5 hits accumulated; when
- the "-t" switch is not in use, the report text would not be added.
+ Even though sample-nonspam.txt is not spam, nonspam.out will
+ contain a SpamAssassin report anyway. This is a side-effect of
+ the "-t" (test) switch. However, there should be less than 5
+ points accumulated; when the "-t" switch is not in use, the report
+ text would not be added.

If the commands do not work, DO NOT PROCEED TO THE NEXT STEP, as you
will lose mail!

Modified: incubator/spamassassin/trunk/ldap/README
==============================================================================
--- incubator/spamassassin/trunk/ldap/README (original)
+++ incubator/spamassassin/trunk/ldap/README Wed Feb 18 17:24:48 2004
@@ -38,7 +38,7 @@

If the user_scores_dsn option does not exist, SpamAssassin will not attempt
to use an LDAP server for retrieving users' preferences. Note that this will
-NOT look for test rules, only local scores, whitelist_from(s), required_hits,
+NOT look for test rules, only local scores, whitelist_from(s), required_score,
and auto_report_threshold.

Requirements

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm Wed Feb 18 17:24:48 2004
@@ -64,7 +64,7 @@

_YESNOCAPS_ "YES"/"NO" for is/isn't spam
_YESNO_ "Yes"/"No" for is/isn't spam
- _HITS_ message score
+ _SCORE_ message score
_REQD_ message threshold
_VERSION_ version (eg. 2.61 or 2.70-r6142-foo1)
_SUBVERSION_ sub-version/code revision date (eg. 2004-01-10)
@@ -85,7 +85,7 @@
_RBL_ full results for positive RBL queries in DNS URI format
_LANGUAGES_ possible languages of mail
_PREVIEW_ content preview
- _REPORT_ terse report of tests hits (for header reports)
+ _REPORT_ terse report of tests hit (for header reports)
_SUMMARY_ summary of tests hit for standard report (for body reports)
_CONTACTADDRESS_ contents of the 'report_contact' setting

@@ -166,7 +166,7 @@
# testing stuff
$self->{regression_tests} = { };

- $self->{required_hits} = 5.0;
+ $self->{required_score} = 5.0;
$self->{report_charset} = '';
$self->{report_template} = '';
$self->{unsafe_report_template} = '';
@@ -704,21 +704,23 @@

=over 4

-=item required_hits n.nn (default: 5)
+=item required_score n.nn (default: 5)

-Set the number of hits required before a mail is considered spam. C<n.nn> can
-be an integer or a real number. 5.0 is the default setting, and is quite
-aggressive; it would be suitable for a single-user setup, but if you're an ISP
-installing SpamAssassin, you should probably set the default to be more
-conservative, like 8.0 or 10.0. It is not recommended to automatically delete
-or discard messages marked as spam, as your users B<will> complain, but if you
-choose to do so, only delete messages with an exceptionally high score such as
-15.0 or higher.
+Set the score required before a mail is considered spam. C<n.nn> can
+be an integer or a real number. 5.0 is the default setting, and is
+quite aggressive; it would be suitable for a single-user setup, but if
+you're an ISP installing SpamAssassin, you should probably set the
+default to be more conservative, like 8.0 or 10.0. It is not
+recommended to automatically delete or discard messages marked as
+spam, as your users B<will> complain, but if you choose to do so, only
+delete messages with an exceptionally high score such as 15.0 or
+higher. This option was previously known as C<required_hits> and that
+name is still accepted, but is deprecated.

=cut

- if ( $key eq 'required_hits' ) {
- $self->{required_hits} = $value+0.0; next;
+ if ( ($key eq 'required_hits') || ($key eq 'required_score') ) {
+ $self->{required_score} = $value+0.0; next;
}

=item score SYMBOLIC_TEST_NAME n.nn [ n.nn n.nn n.nn ]
@@ -781,7 +783,7 @@
spam. For the From or To headers, this will take the form of an RFC
2822 comment following the address in parantheses. For the Subject
header, this will be prepended to the original subject. Note that you
-should only use the _REQD_ and _HITS_ tags when rewriting the Subject
+should only use the _REQD_ and _SCORE_ tags when rewriting the Subject
header unless C<report_safe> is 0. Otherwise, you will not be able to
remove the SpamAssassin markup. Parentheses are not permitted in
STRING. (They will be converted to square brackets.)
@@ -836,10 +838,10 @@

See also C<clear_headers> for removing headers.

-Here are some examples (these are the defaults in 2.60):
+Here are some examples (these are the defaults):

add_header spam Flag _YESNOCAPS_
- add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_
+ add_header all Status _YESNO_, score=_SCORE__ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_
add_header all Level _STARS(*)_
add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on _HOSTNAME_


Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm Wed Feb 18 17:24:48 2004
@@ -962,7 +962,7 @@
}
}

- my $awlhits = $self->get_nonlearn_nonuserconf_hits();
+ my $awlpoints = $self->get_nonlearn_nonuserconf_points();

# Create the AWL object, catching 'die's
my $whitelist;
@@ -973,11 +973,11 @@
my $meanscore = $whitelist->check_address($_, $origip);
my $delta = 0;

- dbg("AWL active, pre-score: $self->{hits}, autolearn score: $awlhits, ".
+ dbg("AWL active, pre-score: $self->{score}, autolearn score: $awlpoints, ".
"mean: ". ($meanscore || 'undef') .", IP: ". ($origip || 'undef'));

if (defined ($meanscore)) {
- $delta = ($meanscore - $awlhits) * $self->{main}->{conf}->{auto_whitelist_factor};
+ $delta = ($meanscore - $awlpoints) * $self->{main}->{conf}->{auto_whitelist_factor};
$self->{tag_data}->{AWL} = sprintf("%2.1f",$delta);
# Save this for _AWL_ tag
}
@@ -986,7 +986,7 @@
# early high-scoring messages are reinforced compared to
# later ones. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=159704
if (!$self->{disable_auto_learning}) {
- $whitelist->add_score($awlhits);
+ $whitelist->add_score($awlpoints);
}

# current AWL score changes with each hit
@@ -1009,7 +1009,7 @@
eval { $whitelist->finish(); };
}

- dbg("Post AWL score: ".$self->{hits});
+ dbg("Post AWL score: ".$self->{score});

# test hit is above
return 0;

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm Wed Feb 18 17:24:48 2004
@@ -77,7 +77,7 @@
my $self = {
'main' => $main,
'msg' => $msg,
- 'hits' => 0,
+ 'score' => 0,
'test_logs' => '',
'test_names_hit' => [ ],
'subtest_names_hit' => [ ],
@@ -112,10 +112,10 @@
my ($self) = @_;
local ($_);

- $self->{learned_hits} = 0;
- $self->{body_only_hits} = 0;
- $self->{head_only_hits} = 0;
- $self->{hits} = 0;
+ $self->{learned_points} = 0;
+ $self->{body_only_points} = 0;
+ $self->{head_only_points} = 0;
+ $self->{score} = 0;

$self->{main}->call_plugins ("check_start", { permsgstatus => $self });

@@ -206,25 +206,19 @@
$self->learn();

# add points from learning systems (Bayes and AWL)
- $self->{hits} += $self->{learned_hits};
+ $self->{score} += $self->{learned_points};
}

$self->delete_fulltext_tmpfile();

- # Round the hits down to the nearest 0.1. Technically, using int
- # instead of a true floor function rounds up to the nearest 0.1 for
- # negative numbers, but who really cares.
- # Fixes bug http://bugzilla.spamassassin.org/show_bug.cgi?id=2607
- $self->{hits} = int($self->{hits} * 10) / 10;

-
- # Round the hits to 3 decimal places to avoid rounding issues
- # We assume required_hits to be properly rounded already.
+ # Round the score to 3 decimal places to avoid rounding issues
+ # We assume required_score to be properly rounded already.
# add 0 to force it back to numeric representation instead of string.
- $self->{hits} = (sprintf "%0.3f", $self->{hits}) + 0;
+ $self->{score} = (sprintf "%0.3f", $self->{score}) + 0;

- dbg ("is spam? score=".$self->{hits}.
- " required=".$self->{conf}->{required_hits}.
+ dbg ("is spam? score=".$self->{score}.
+ " required=".$self->{conf}->{required_score}.
" tests=".$self->get_names_of_tests_hit());
$self->{is_spam} = $self->is_spam();

@@ -269,31 +263,31 @@
my $max = $self->{conf}->{bayes_auto_learn_threshold_spam};

dbg ("auto-learn? ham=$min, spam=$max, ".
- "body-hits=".$self->{body_only_hits}.", ".
- "head-hits=".$self->{head_only_hits});
+ "body-points=".$self->{body_only_points}.", ".
+ "head-points=".$self->{head_only_points});

my $isspam;

- # This section should use sum($score[scoreset % 2]) not just {hits}. otherwise we shift what we
+ # This section should use sum($score[scoreset % 2]) not just {score}. otherwise we shift what we
# autolearn on and it gets really wierd. - tvd
- my $hits = 0;
+ my $score = 0;
my $orig_scoreset = $self->{conf}->get_score_set();
if ( ($orig_scoreset & 2) == 0 ) { # we don't need to recompute
dbg ("auto-learn: currently using scoreset $orig_scoreset. no need to recompute.");
- $hits = $self->{hits};
+ $score = $self->{score};
}
else {
my $new_scoreset = $orig_scoreset & ~2;
dbg ("auto-learn: currently using scoreset $orig_scoreset. recomputing score based on scoreset $new_scoreset.");
$self->{conf}->set_score_set($new_scoreset); # reduce to autolearning scores
- my $hits = $self->get_nonlearn_nonuserconf_hits();
- dbg ("auto-learn: original score: ".$self->{hits}.", recomputed score: $hits");
+ $score = $self->get_nonlearn_nonuserconf_points();
+ dbg ("auto-learn: original score: ".$self->{score}.", recomputed score: $score");
$self->{conf}->set_score_set($orig_scoreset); # return to appropriate scoreset
}

- if ($hits < $min) {
+ if ($score < $min) {
$isspam = 0;
- } elsif ($hits >= $max) {
+ } elsif ($score >= $max) {
$isspam = 1;
} else {
dbg ("auto-learn? no: inside auto-learn thresholds");
@@ -301,42 +295,42 @@
return;
}

- my $learner_said_ham_hits = -1.0;
- my $learner_said_spam_hits = 1.0;
+ my $learner_said_ham_points = -1.0;
+ my $learner_said_spam_points = 1.0;

if ($isspam) {
- my $required_body_hits = 3;
- my $required_head_hits = 3;
+ my $required_body_points = 3;
+ my $required_head_points = 3;

- if ($self->{body_only_hits} < $required_body_hits) {
+ if ($self->{body_only_points} < $required_body_points) {
$self->{auto_learn_status} = "no";
- dbg ("auto-learn? no: too few body hits (".
- $self->{body_only_hits}." < ".$required_body_hits.")");
+ dbg ("auto-learn? no: too few body points (".
+ $self->{body_only_points}." < ".$required_body_points.")");
return;
}
- if ($self->{head_only_hits} < $required_head_hits) {
+ if ($self->{head_only_points} < $required_head_points) {
$self->{auto_learn_status} = "no";
- dbg ("auto-learn? no: too few head hits (".
- $self->{head_only_hits}." < ".$required_head_hits.")");
+ dbg ("auto-learn? no: too few head points (".
+ $self->{head_only_points}." < ".$required_head_points.")");
return;
}
- if ($self->{learned_hits} < $learner_said_ham_hits) {
+ if ($self->{learned_points} < $learner_said_ham_points) {
$self->{auto_learn_status} = "no";
dbg ("auto-learn? no: learner indicated ham (".
- $self->{learned_hits}." < ".$learner_said_ham_hits.")");
+ $self->{learned_points}." < ".$learner_said_ham_points.")");
return;
}

} else {
- if ($self->{learned_hits} > $learner_said_spam_hits) {
+ if ($self->{learned_points} > $learner_said_spam_points) {
$self->{auto_learn_status} = "no";
dbg ("auto-learn? no: learner indicated spam (".
- $self->{learned_hits}." > ".$learner_said_spam_hits.")");
+ $self->{learned_points}." > ".$learner_said_spam_points.")");
return;
}
}

- dbg ("auto-learn? yes, ".($isspam?"spam ($hits > $max)":"ham ($hits < $min)"));
+ dbg ("auto-learn? yes, ".($isspam?"spam ($score > $max)":"ham ($score < $min)"));

$self->{main}->call_plugins ("autolearn", {
permsgstatus => $self,
@@ -362,12 +356,12 @@
}
}

-sub get_nonlearn_nonuserconf_hits {
+sub get_nonlearn_nonuserconf_points {
my ($self) = @_;

my $scores = $self->{conf}->{scores};
my $tflags = $self->{conf}->{tflags};
- my $hits = 0;
+ my $points = 0;

foreach my $test ( @{$self->{test_names_hit}} )
{
@@ -376,10 +370,10 @@
next if ($scores->{$test} == 0);
next if (exists $tflags->{$test} && $tflags->{$test} =~ /\bnoautolearn\b/);

- $hits += $scores->{$test};
+ $points += $scores->{$test};
}

- return (sprintf "%0.3f", $hits) + 0;
+ return (sprintf "%0.3f", $points) + 0;
}

###########################################################################
@@ -395,7 +389,7 @@
sub is_spam {
my ($self) = @_;
# changed to test this so sub-tests can ask "is_spam" during a run
- return ($self->{hits} >= $self->{conf}->{required_hits});
+ return ($self->{score} >= $self->{conf}->{required_score});
}

###########################################################################
@@ -434,30 +428,40 @@

###########################################################################

-=item $num = $status->get_hits ()
+=item $num = $status->get_score ()

After a mail message has been checked, this method can be called. It will
-return the number of hits this message incurred.
+return the message's score.

=cut

+sub get_score {
+ my ($self) = @_;
+ return $self->{score};
+}
+
sub get_hits {
my ($self) = @_;
- return $self->{hits};
+ return $self->{score};
}

###########################################################################

-=item $num = $status->get_required_hits ()
+=item $num = $status->get_required_score ()

After a mail message has been checked, this method can be called. It will
-return the number of hits required for a mail to be considered spam.
+return the score required for a mail to be considered spam.

=cut

+sub get_required_score {
+ my ($self) = @_;
+ return $self->{conf}->{required_score};
+}
+
sub get_required_hits {
my ($self) = @_;
- return $self->{conf}->{required_hits};
+ return $self->{conf}->{required_score};
}

###########################################################################
@@ -868,9 +872,11 @@

YESNO => sub { $self->{is_spam} ? "Yes" : "No"; },

- HITS => sub { sprintf ("%2.1f", $self->{hits}); },
+ HITS => sub { sprintf ("%2.1f", int ($self->{score} * 10) / 10); },
+
+ SCORE => sub { sprintf ("%2.1f", int ($self->{score} * 10) / 10); },

- REQD => sub { sprintf ("%2.1f", $self->{conf}->{required_hits}); },
+ REQD => sub { sprintf ("%2.1f", $self->{conf}->{required_score}); },

VERSION => sub { return Mail::SpamAssassin::Version()},

@@ -891,7 +897,7 @@

STARS => sub {
my $arg = (shift || "*");
- my $length = int($self->{hits});
+ my $length = int($self->{score});
$length = 50 if $length > 50;
return $arg x $length;
},
@@ -959,7 +965,7 @@
delete $self->{msg};
delete $self->{conf};
delete $self->{res};
- delete $self->{hits};
+ delete $self->{score};
delete $self->{test_names_hit};
delete $self->{subtest_names_hit};
delete $self->{test_logs};
@@ -1243,7 +1249,7 @@
# eval tests need to use stuff in here.
$self->{test_log_msgs} = (); # clear test state

- dbg ("running header regexp tests; score so far=".$self->{hits});
+ dbg ("running header regexp tests; score so far=".$self->{score});

my $doing_user_rules =
$self->{conf}->{user_rules_to_compile}->{Mail::SpamAssassin::Conf::TYPE_HEAD_TESTS};
@@ -1330,7 +1336,7 @@
my ($self, $textary) = @_;
local ($_);

- dbg ("running body-text per-line regexp tests; score so far=".$self->{hits});
+ dbg ("running body-text per-line regexp tests; score so far=".$self->{score});

my $doing_user_rules =
$self->{conf}->{user_rules_to_compile}->{Mail::SpamAssassin::Conf::TYPE_BODY_TESTS};
@@ -1561,7 +1567,7 @@
my ($self, $textary) = @_;
local ($_);

- dbg ("running uri tests; score so far=".$self->{hits});
+ dbg ("running uri tests; score so far=".$self->{score});
my @uris = $self->get_uri_list();

my $doing_user_rules =
@@ -1638,7 +1644,7 @@
my ($self, $textary) = @_;
local ($_);

- dbg ("running raw-body-text per-line regexp tests; score so far=".$self->{hits});
+ dbg ("running raw-body-text per-line regexp tests; score so far=".$self->{score});

my $doing_user_rules =
$self->{conf}->{user_rules_to_compile}->{Mail::SpamAssassin::Conf::TYPE_RAWBODY_TESTS};
@@ -1714,7 +1720,7 @@
my ($self, $fullmsgref) = @_;
local ($_);

- dbg ("running full-text regexp tests; score so far=".$self->{hits});
+ dbg ("running full-text regexp tests; score so far=".$self->{score});

my $doing_user_rules =
$self->{conf}->{user_rules_to_compile}->{Mail::SpamAssassin::Conf::TYPE_FULL_TESTS};
@@ -1796,7 +1802,7 @@
my ($self) = @_;
local ($_);

- dbg( "running meta tests; score so far=" . $self->{hits} );
+ dbg( "running meta tests; score so far=" . $self->{score} );

my $doing_user_rules =
$self->{conf}->{user_rules_to_compile}->{Mail::SpamAssassin::Conf::TYPE_META_TESTS};
@@ -2087,15 +2093,15 @@

# ignore 'noautolearn' rules when considering score for Bayes auto-learning
if ($tflags =~ /\bnoautolearn\b/i) {
- $self->{learned_hits} += $score;
+ $self->{learned_points} += $score;
}
else {
- $self->{hits} += $score;
+ $self->{score} += $score;
if (!$self->{conf}->maybe_header_only ($rule)) {
- $self->{body_only_hits} += $score;
+ $self->{body_only_points} += $score;
}
if (!$self->{conf}->maybe_body_only ($rule)) {
- $self->{head_only_hits} += $score;
+ $self->{head_only_points} += $score;
}
}


Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin.pm Wed Feb 18 17:24:48 2004
@@ -247,7 +247,7 @@
=item permsgstatus

The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan.
-The current hits, names of rules that hit, etc. can be retrieved
+The current score, names of rules that hit, etc. can be retrieved
using the APIs on this object.

=back

Modified: incubator/spamassassin/trunk/masses/mass-check
==============================================================================
--- incubator/spamassassin/trunk/masses/mass-check (original)
+++ incubator/spamassassin/trunk/masses/mass-check Wed Feb 18 17:24:48 2004
@@ -246,7 +246,7 @@

# remove SpamAssassin markup, if present and the mail was spam
$_ = $ma->get_header ("X-Spam-Status");
- if (defined($_) && /^Yes, hits=/) {
+ if (defined($_) && /^Yes,/) {
$ma = $spamtest->parse ($spamtest->remove_spamassassin_markup($ma));
}

@@ -276,7 +276,7 @@
}

my $yorn = $status->is_spam() ? 'Y' : '.';
- my $hits = $status->get_hits();
+ my $score = $status->get_score();
my $tests = join(",", sort(grep(length,$status->get_names_of_tests_hit(),$status->get_names_of_subtests_hit())));
my $extra = join(",", @extra);

@@ -288,7 +288,7 @@

$id =~ s/\s/_/g;

- $out .= sprintf("%s %2d %s %s %s\n", $yorn, $hits, $id, $tests, $extra);
+ $out .= sprintf("%s %2d %s %s %s\n", $yorn, $score, $id, $tests, $extra);

if ($tests =~ /MICROSOFT_EXECUTABLE|MIME_SUSPECT_NAME/) {
$out .= logkilled($ma, $id, "possible virus");

Modified: incubator/spamassassin/trunk/rules/10_misc.cf
==============================================================================
--- incubator/spamassassin/trunk/rules/10_misc.cf (original)
+++ incubator/spamassassin/trunk/rules/10_misc.cf Wed Feb 18 17:24:48 2004
@@ -33,7 +33,7 @@
report
report Content preview: _PREVIEW_
report
-report Content analysis details: (_HITS_ points, _REQD_ required)
+report Content analysis details: (_SCORE_ points, _REQD_ required)
report
report " pts rule name description"
report ---- ---------------------- --------------------------------------------------
@@ -103,20 +103,20 @@
#X-Spam-Level: *************
add_header all Level _STARS(*)_

-#X-Spam-Status: Yes, hits=14.0 required=5.0 tests=BAYES_99,CALL_FREE
+#X-Spam-Status: Yes, score=14.0 required=5.0 tests=BAYES_99,CALL_FREE
# DATE_IN_PAST_12_24,DCC_CHECK,DRASTIC_REDUCED,FROM_HAS_MIXED_NUMS
# FROM_HAS_MIXED_NUMS3,HOME_EMPLOYMENT,INVALID_DATE,INVALID_MSGID
# LINES_OF_YELLING,MSGID_HAS_NO_AT,NO_REAL_NAME,ONCE_IN_LIFETIME
# REMOVE_SUBJ,SMTPD_IN_RCVD,T_INVALID_DATE_2,T_INVALID_DATE_HMS
# UNDISC_RECIPS autolearn=spam version=2.60-cvs
-add_header all Status "_YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_"
+add_header all Status "_YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_"

###########################################################################
# Default prefs values: users can override these in their
# ~/.spamassassin/user_prefs files.

-# How many hits before a mail is considered spam.
-required_hits 5
+# How many points before a mail is considered spam.
+required_score 5

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.

Modified: incubator/spamassassin/trunk/rules/user_prefs.template
==============================================================================
--- incubator/spamassassin/trunk/rules/user_prefs.template (original)
+++ incubator/spamassassin/trunk/rules/user_prefs.template Wed Feb 18 17:24:48 2004
@@ -8,8 +8,8 @@
#* create a file in /etc/spamassassin or /etc/mail/spamassassin instead.
###########################################################################

-# How many hits before a mail is considered spam.
-# required_hits 5
+# How many points before a mail is considered spam.
+# required_score 5

# Whitelist and blacklist addresses are now file-glob-style patterns, so
# "friend@somewhere.com", "*@isp.com", or "*.domain.net" will all work.

Modified: incubator/spamassassin/trunk/spamassassin.raw
==============================================================================
--- incubator/spamassassin/trunk/spamassassin.raw (original)
+++ incubator/spamassassin/trunk/spamassassin.raw Wed Feb 18 17:24:48 2004
@@ -572,7 +572,7 @@

=item X-Spam-Status: header

-A string, C<Yes, hits=nn required=nn tests=xxx,xxx
+A string, C<Yes, score=nn required=nn tests=xxx,xxx
autolearn=(ham|spam|no|unavailable|failed)> is set in this header to
reflect the filter status.

@@ -603,7 +603,7 @@

=item X-Spam-Status: header

-A string, C<No, hits=nn required=nn tests=xxx,xxx
+A string, C<No, score=nn required=nn tests=xxx,xxx
autolearn=(ham|spam|no|unavailable|failed)> is set in this header to
reflect the filter status.


Modified: incubator/spamassassin/trunk/spamc/spamc.pod
==============================================================================
--- incubator/spamassassin/trunk/spamc/spamc.pod (original)
+++ incubator/spamassassin/trunk/spamc/spamc.pod Wed Feb 18 17:24:48 2004
@@ -77,12 +77,12 @@

=item B<-r>

-Just output the SpamAssassin report text to stdout, if the message
-is spam. If the message is ham (non-spam), nothing will be printed.
-The first line of the output is the number of hits and the threshold,
-in this format:
+Just output the SpamAssassin report text to stdout, if the message is
+spam. If the message is ham (non-spam), nothing will be printed. The
+first line of the output is the message score and the threshold, in
+this format:

- hits/threshold
+ score/threshold

=item B<-R>


Modified: incubator/spamassassin/trunk/spamd/spamd.raw
==============================================================================
--- incubator/spamassassin/trunk/spamd/spamd.raw (original)
+++ incubator/spamassassin/trunk/spamd/spamd.raw Wed Feb 18 17:24:48 2004
@@ -838,8 +838,8 @@
# Now use copy-on-writed (hopefully) SA object
my $status = $spamtest->check($mail);

- my $msg_score = sprintf("%.1f",$status->get_hits);
- my $msg_threshold = sprintf("%.1f",$status->get_required_hits);
+ my $msg_score = sprintf("%.1f",$status->get_score);
+ my $msg_threshold = sprintf("%.1f",$status->get_required_score);

my $response_spam_status = "";
my $was_it_spam;

Modified: incubator/spamassassin/trunk/sql/README
==============================================================================
--- incubator/spamassassin/trunk/sql/README (original)
+++ incubator/spamassassin/trunk/sql/README Wed Feb 18 17:24:48 2004
@@ -37,7 +37,7 @@

If the user_scores_dsn option does not exist, SpamAssassin will not attempt
to use an SQL for retrieving users' preferences. Note that this will NOT look
-for test rules, only local scores, whitelist_from(s), required_hits, and
+for test rules, only local scores, whitelist_from(s), required_score, and
auto_report_threshold.

Requirements
@@ -66,7 +66,7 @@
setting: "userpref") with at least three fields:

username varchar(100) # this is the username whose e-mail is being filtered
- preference varchar(30) # the preference (whitelist_from, required_hits, etc.)
+ preference varchar(30) # the preference (whitelist_from, required_score, etc.)
value varchar(100) # the value of the named preference

You can add as many other fields you wish as long as the above three fields are

Modified: incubator/spamassassin/trunk/t/reportheader.t
==============================================================================
--- incubator/spamassassin/trunk/t/reportheader.t (original)
+++ incubator/spamassassin/trunk/t/reportheader.t Wed Feb 18 17:24:48 2004
@@ -12,7 +12,7 @@

q{ Spam detection software, running on the system "}, 'spam-report-body',
q{ Subject: There yours for FREE!}, 'subj',
-q{ X-Spam-Status: Yes, hits=}, 'status',
+q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',
q{ From: ends in numbers}, 'endsinnums',
q{ From: does not include a real name}, 'noreal',

Modified: incubator/spamassassin/trunk/t/spam.t
==============================================================================
--- incubator/spamassassin/trunk/t/spam.t (original)
+++ incubator/spamassassin/trunk/t/spam.t Wed Feb 18 17:24:48 2004
@@ -9,7 +9,7 @@
%patterns = (

q{ Subject: There yours for FREE!}, 'subj',
-q{ X-Spam-Status: Yes, hits=}, 'status',
+q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',
q{ X-Spam-Level: **********}, 'stars',
q{ FROM_ENDS_IN_NUMS }, 'endsinnums',

Modified: incubator/spamassassin/trunk/t/spamd.t
==============================================================================
--- incubator/spamassassin/trunk/t/spamd.t (original)
+++ incubator/spamassassin/trunk/t/spamd.t Wed Feb 18 17:24:48 2004
@@ -11,7 +11,7 @@
%patterns = (

q{ Subject: There yours for FREE!}, 'subj',
-q{ X-Spam-Status: Yes, hits=}, 'status',
+q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',
q{ X-Spam-Level: **********}, 'stars',
q{ FROM_ENDS_IN_NUMS}, 'endsinnums',

Modified: incubator/spamassassin/trunk/t/spamd_ldap.t
==============================================================================
--- incubator/spamassassin/trunk/t/spamd_ldap.t (original)
+++ incubator/spamassassin/trunk/t/spamd_ldap.t Wed Feb 18 17:24:48 2004
@@ -16,7 +16,7 @@
%patterns = (

q{ Subject: There yours for FREE!}, 'subj',
-q{ X-Spam-Status: Yes, hits=}, 'status',
+q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',
q{ X-Spam-Level: **********}, 'stars',
q{ X-Spam-Foo: LDAP read}, 'ldap_config_read',

Modified: incubator/spamassassin/trunk/t/spamd_maxchildren.t
==============================================================================
--- incubator/spamassassin/trunk/t/spamd_maxchildren.t (original)
+++ incubator/spamassassin/trunk/t/spamd_maxchildren.t Wed Feb 18 17:24:48 2004
@@ -10,7 +10,7 @@

%patterns = (

-q{ X-Spam-Status: Yes, hits=}, 'status',
+q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',
q{ X-Spam-Level: **********}, 'stars',
q{ FROM_ENDS_IN_NUMS}, 'endsinnums',

Modified: incubator/spamassassin/trunk/t/spamd_parallel.t
==============================================================================
--- incubator/spamassassin/trunk/t/spamd_parallel.t (original)
+++ incubator/spamassassin/trunk/t/spamd_parallel.t Wed Feb 18 17:24:48 2004
@@ -10,7 +10,7 @@

%patterns = (

-q{ X-Spam-Status: Yes, hits=}, 'status',
+q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',
q{ X-Spam-Level: **********}, 'stars',
q{ FROM_ENDS_IN_NUMS}, 'endsinnums',

Modified: incubator/spamassassin/trunk/t/spamd_port.t
==============================================================================
--- incubator/spamassassin/trunk/t/spamd_port.t (original)
+++ incubator/spamassassin/trunk/t/spamd_port.t Wed Feb 18 17:24:48 2004
@@ -11,7 +11,7 @@
%patterns = (

q{ Subject: There yours for FREE!}, 'subj',
-q{ X-Spam-Status: Yes, hits=}, 'status',
+q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',



Modified: incubator/spamassassin/trunk/t/spamd_unix.t
==============================================================================
--- incubator/spamassassin/trunk/t/spamd_unix.t (original)
+++ incubator/spamassassin/trunk/t/spamd_unix.t Wed Feb 18 17:24:48 2004
@@ -12,7 +12,7 @@
%patterns = (

q{ Subject: There yours for FREE!}, 'subj',
-q{ X-Spam-Status: Yes, hits=}, 'status',
+q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',



Modified: incubator/spamassassin/trunk/t/spamd_utf8.t
==============================================================================
--- incubator/spamassassin/trunk/t/spamd_utf8.t (original)
+++ incubator/spamassassin/trunk/t/spamd_utf8.t Wed Feb 18 17:24:48 2004
@@ -12,7 +12,7 @@

%patterns = (

-q{ X-Spam-Status: Yes, hits=}, 'status',
+q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',



Modified: incubator/spamassassin/trunk/t/utf8.t
==============================================================================
--- incubator/spamassassin/trunk/t/utf8.t (original)
+++ incubator/spamassassin/trunk/t/utf8.t Wed Feb 18 17:24:48 2004
@@ -8,7 +8,7 @@

%patterns = (

-q{ X-Spam-Status: Yes, hits=}, 'status',
+q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',
q{ X-Spam-Level: ****}, 'stars',