commit 48d1a5b9febc96d2d3c4110500759e36fb4eabb6 Author: Jonathan Martens Date: Wed Nov 4 11:10:38 2009 +0100 Custom spam tag subject munging in spamassasin plugin Hi all! I have written a patch to allow the spamassasin plugin to have a custom spam tag read in from a configuration file as opposed to the default *** SPAM *** that is hard coded. When the configuration file (spamsubjectprefix) is not defined or empty the default value still applies, if it is provided the value from the configuration file is used. Any change this can be considered for implementation as we would really like to have it for SME Server. Kind regards, Jonathan Signed-off-by: Robert diff --git a/plugins/spamassassin b/plugins/spamassassin index 1a1b4b1..be3a67b 100644 --- a/plugins/spamassassin +++ b/plugins/spamassassin @@ -41,7 +41,8 @@ The default is to never reject mail based on the SpamAssassin score. =item munge_subject_threshold [threshold] Set the threshold where the plugin will prefix the subject with -'***SPAM***'. A modified subject is easier to filter on than the +'***SPAM***' or the value defined in the spamsubjectprefix +configuration file. A modified subject is easier to filter on than the other headers for many people with not so clever mail clients. You might want to make another plugin that does this on a per user basis. @@ -236,8 +237,9 @@ sub check_spam_munge_subject { return DECLINED unless $score >= $self->{_args}->{munge_subject_threshold}; + my $subject_prefix = $self->qp->config('spamsubjectprefix') || '*** SPAM ***'; my $subject = $transaction->header->get('Subject') || ''; - $transaction->header->replace('Subject', "***SPAM*** $subject"); + $transaction->header->replace('Subject', "$subject_prefix $subject"); return DECLINED; }