diff --git a/plugins/spamassassin b/plugins/spamassassin index 36e0612..f05f4ff 100644 --- a/plugins/spamassassin +++ b/plugins/spamassassin @@ -444,12 +444,14 @@ sub munge_subject { my $sa = $self->get_spam_results($transaction) or return; my $qp_num = $self->{_args}{munge_subject_threshold}; + my $required = $sa->{required}; - my $required = $sa->{required} || $qp_num or do { + if (!$qp_num) { $self->log(LOGDEBUG, "skipping munge, no user or qpsmtpd pref set"); return; }; return unless $sa->{score} > $required; + return unless $sa->{score} > $qp_num; my $subject_prefix = $self->qp->config('subject_prefix') || '*** SPAM ***'; my $subject = $transaction->header->get('Subject') || ''; diff --git a/t/plugin_tests/spamassassin b/t/plugin_tests/spamassassin index dfe6409..ca3ba3b 100644 --- a/t/plugin_tests/spamassassin +++ b/t/plugin_tests/spamassassin @@ -127,7 +127,7 @@ sub test_munge_subject { $transaction->header->add('Subject', $subject); $self->munge_subject($transaction); $r = $transaction->header->get('Subject'); chomp $r; - cmp_ok($r, 'eq', "*** SPAM *** $subject", "+"); + cmp_ok($r, 'eq', "$subject", "+"); }; sub test_get_spam_results {