Koozali.org: home of the SME Server

spamassissin rewrite_subject and qpsmtpd

Offline okepc

  • ****
  • 118
  • +0/-0
    • http://www.okepc.nl
spamassissin rewrite_subject and qpsmtpd
« on: October 31, 2006, 01:14:43 PM »
I figured out that the qpsmtpd spamassassin plugin overrules the rewrite_subject in /etc/mail/spamassassin/local.cf

Before i had added to the rewrite_subject _SCORE_ of _ REQD_ so i could see the threshold and the spamscore.

Does anybody know how to change the format in the spamassassin qpsmtpd plugin /usr/share/qpsmtpd/spamassassin towards the end of the script? to make this work?

I tried it in there but it writes the subject exactly how i type it there:
*****SPAM***** _SCORE_ of _ REQD_
output should be: *****SPAM***** 48.1 of 5.0

So something needs to be altered in some way.

Offline svangool

  • ****
  • 73
  • +0/-0
spamassissin rewrite_subject and qpsmtpd
« Reply #1 on: October 31, 2006, 01:39:02 PM »
_SCORE_ and _REQD_ do not work here

Substitute the "***spam***" in the plugin with:

Code: [Select]
"*****SPAM***** ".$score." of ".$self->{_args}->{munge_subject_threshold}.".0 $subject"

Success, Sjef.
......

djhyper

spamassissin rewrite_subject and qpsmtpd
« Reply #2 on: October 31, 2006, 10:58:11 PM »
Could you please paste the whole line of code?
I have paste it but it didn't seem to work.

Lol never mind noticed you edited the post.
I pasted it in and it works like a charm.

txs

Offline svangool

  • ****
  • 73
  • +0/-0
spamassissin rewrite_subject and qpsmtpd
« Reply #3 on: October 31, 2006, 11:06:10 PM »
Here you go:

Code: [Select]
 my $subject = $transaction->header->get('Subject') || '';
  $transaction->header->replace('Subject', "*****SPAM***** $score of ".$self->{_args}->{munge_subject_threshold}.".0 $subject]");
  return DECLINED;


Sjef
......

djhyper

spamassissin rewrite_subject and qpsmtpd
« Reply #4 on: October 31, 2006, 11:38:31 PM »
where should i place [ and ] ?
if the output should be *****spam***** [20 of 5]

Offline svangool

  • ****
  • 73
  • +0/-0
spamassissin rewrite_subject and qpsmtpd
« Reply #5 on: November 01, 2006, 08:13:04 AM »
Here you go:

Code: [Select]
my $subject = $transaction->header->get('Subject') || '';
  $transaction->header->replace('Subject', "*****SPAM***** [".$score." of ".$self->{_args}->{munge_subject_threshold}.".0] $subject");
  return DECLINED;


Sjef
......

Offline okepc

  • ****
  • 118
  • +0/-0
    • http://www.okepc.nl
spamassissin rewrite_subject and qpsmtpd
« Reply #6 on: November 01, 2006, 10:05:44 AM »
Awesome txs Sjef!