You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2006/11/15 23:40:41 UTC
svn commit: r475474 - in
/spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin: PerMsgStatus.pm
Plugin/Check.pm
Author: jm
Date: Wed Nov 15 14:40:41 2006
New Revision: 475474
URL: http://svn.apache.org/viewvc?view=rev&rev=475474
Log:
merge up to match current trunk at r475473
Modified:
spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin/PerMsgStatus.pm
spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin/Plugin/Check.pm
Modified: spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin/PerMsgStatus.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin/PerMsgStatus.pm?view=diff&rev=475474&r1=475473&r2=475474
==============================================================================
--- spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin/PerMsgStatus.pm (original)
+++ spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin/PerMsgStatus.pm Wed Nov 15 14:40:41 2006
@@ -1931,17 +1931,17 @@
sub register_plugin_eval_glue {
my ($self, $function) = @_;
+ if (!$function) {
+ warn "rules: empty function name";
+ return;
+ }
+
# return if it's not an eval_plugin function
return if (!exists $self->{conf}->{eval_plugins}->{$function});
# return if it's been registered already
return if ($self->can ($function) &&
defined &{'Mail::SpamAssassin::PerMsgStatus::'.$function});
-
- if (!$function) {
- warn "rules: empty function name";
- return;
- }
my $evalstr = <<"ENDOFEVAL";
{
Modified: spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin/Plugin/Check.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin/Plugin/Check.pm?view=diff&rev=475474&r1=475473&r2=475474
==============================================================================
--- spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin/Plugin/Check.pm (original)
+++ spamassassin/branches/jm_re2c_hacks/lib/Mail/SpamAssassin/Plugin/Check.pm Wed Nov 15 14:40:41 2006
@@ -474,7 +474,7 @@
$self->got_hit(q#'.$rulename.'#, "", ruletype => "header");
'.$self->hit_rule_plugin_code($pms, $rulename, "header", $hitdone).'
}
- '.$self->ran_rule_plugin_code($pms, $rulename, "header").'
+ '.$self->ran_rule_plugin_code($rulename, "header").'
}
';
}
@@ -568,16 +568,13 @@
';
- while (my($rulename, $pat) = each %{$conf->{body_tests}->{$priority}}) {
+ while (my($rulename, $pat) = each %{$pms->{conf}{body_tests}->{$priority}}) {
my $sub;
my $sub_one_line;
- my $need_one_line;
- if ($conf->{generate_body_one_line_sub}->{$rulename}) {
- $need_one_line = 1;
- }
+ my $need_one_line = ($conf->{generate_body_one_line_sub}->{$rulename});
- if (($conf->{tflags}->{$rulename}||'') =~ /\bmultiple\b/)
+ if (($pms->{conf}->{tflags}->{$rulename}||'') =~ /\bmultiple\b/)
{
# support multiple matches
$loopid++;
@@ -596,11 +593,12 @@
if ($need_one_line) {
$sub_one_line = '
pos $_[1] = 0;
- '.$self->hash_line_for_rule($rulename).'
+ '.$self->hash_line_for_rule($pms, $rulename).'
while ($_[1] =~ '.$pat.'g) {
my $self = $_[0];
$self->got_hit(q{'.$rulename.'}, "BODY: ", ruletype => "body");
- '. $self->hit_rule_plugin_code($rulename, "body", "return 1") . '
+ '. $self->hit_rule_plugin_code($pms, $rulename, "body",
+ "return 1") . '
}
';
}
@@ -621,11 +619,11 @@
if ($need_one_line) {
$sub_one_line = '
- '.$self->hash_line_for_rule($rulename).'
+ '.$self->hash_line_for_rule($pms, $rulename).'
if ($_[1] =~ '.$pat.') {
my $self = $_[0];
$self->got_hit(q{'.$rulename.'}, "BODY: ", ruletype => "body");
- '. $self->hit_rule_plugin_code($rulename, "body", "return 1") . '
+ '. $self->hit_rule_plugin_code($pms, $rulename, "body", "return 1") . '
}
';
}