You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2011/05/05 03:05:00 UTC
svn commit: r1099646 - in /spamassassin/trunk/lib/Mail/SpamAssassin: Conf.pm
PerMsgStatus.pm
Author: mmartinec
Date: Thu May 5 01:05:00 2011
New Revision: 1099646
URL: http://svn.apache.org/viewvc?rev=1099646&view=rev
Log:
Bug 6566: X-Ham-Report default wording ("has identified this incoming email as possible spam") is confusing and inaccurate - allow _YESNO_ tag to take arguments, replacing the default "Yes" and "No" with user-supplied strings
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm?rev=1099646&r1=1099645&r2=1099646&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm Thu May 5 01:05:00 2011
@@ -3662,8 +3662,11 @@ They will be replaced by the correspondi
Some tags can take an argument (in parentheses). The argument is
optional, and the default is shown below.
- _YESNOCAPS_ "YES"/"NO" for is/isn't spam
- _YESNO_ "Yes"/"No" for is/isn't spam
+ _YESNO_ "Yes" for spam, "No" for nonspam (=ham)
+ _YESNO(spam_str,ham_str)_ returns the first argument ("Yes" if missing)
+ for spam, and the second argument ("No" if missing) for ham
+ _YESNOCAPS_ "YES" for spam, "NO" for nonspam (=ham)
+ _YESNOCAPS(spam_str,ham_str)_ same as _YESNO(...)_, but uppercased
_SCORE(PAD)_ message score, if PAD is included and is either spaces or
zeroes, then pad scores with that many spaces or zeroes
(default, none) ie: _SCORE(0)_ makes 2.4 become 02.4,
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm?rev=1099646&r1=1099645&r2=1099646&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm Thu May 5 01:05:00 2011
@@ -1249,9 +1249,11 @@ sub get_spamd_result_log_items {
###########################################################################
sub _get_tag_value_for_yesno {
- my $self = shift;
-
- return $self->{is_spam} ? "Yes" : "No";
+ my($self, $arg) = @_;
+ my($arg_spam, $arg_ham);
+ ($arg_spam, $arg_ham) = split(/,/, $arg, 2) if defined $arg;
+ return $self->{is_spam} ? (defined $arg_spam ? $arg_spam : 'Yes')
+ : (defined $arg_ham ? $arg_ham : 'No');
}
sub _get_tag_value_for_score {
@@ -1280,9 +1282,9 @@ sub _get_tag {
$tag = "" unless defined $tag; # can be "0", so use a defined test
- %tags = ( YESNO => sub { $self->_get_tag_value_for_yesno() },
+ %tags = ( YESNO => sub { $self->_get_tag_value_for_yesno(@_) },
- YESNOCAPS => sub { uc $self->_get_tag_value_for_yesno() },
+ YESNOCAPS => sub { uc $self->_get_tag_value_for_yesno(@_) },
SCORE => sub { $self->_get_tag_value_for_score(shift) },
HITS => sub { $self->_get_tag_value_for_score(shift) },