You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by beast <be...@ldap.or.id> on 2006/11/29 07:02:47 UTC

tagging based on score level

Is it possible to make different tag for a different score/classes, for 
example:

high: [SPAM!!!]  if score > 50
medium: [SPAM!!]  if score between 20 - 50
low: [SPAM]  if score between treshold - 20

The reason is client filter or other redirection program (for example to 
be redirected/ quarantined for further inspection) can not parse the 
score directly.

--beast



Re: tagging based on score level

Posted by Loren Wilton <lw...@earthlink.net>.
>>> high: [SPAM!!!]  if score > 50
>>> medium: [SPAM!!]  if score between 20 - 50
>>> low: [SPAM]  if score between treshold - 20
>>>
>> Look for the TEMPLATE TAGS section, in particular the _STARS(*)_ tag.
>>
> Almost, but not exactly what I want since it still has so many possibility 
> (up to 50 stars).
> I just want to use these 2 redirection (in postfix):
>
> /^X-Spam-Level: Medium/  REDIRECT quarantine-med@example.com
> /^X-Spam-Level: High/  REDIRECT quarantine-high@example.com

I'm not a postfix guru, but if it uses a regex that includes a specification 
of number of occurrances, couldn't you do something like

    stars /*{51,}/
: high

    stars /*{21,}/
: medium

: low

        Loren


Re: tagging based on score level

Posted by beast <be...@ldap.or.id>.
Craig Morrison wrote:
> beast wrote:
>> Is it possible to make different tag for a different score/classes, 
>> for example:
>>
>> high: [SPAM!!!]  if score > 50
>> medium: [SPAM!!]  if score between 20 - 50
>> low: [SPAM]  if score between treshold - 20
>>
>> The reason is client filter or other redirection program (for example 
>> to be redirected/ quarantined for further inspection) can not parse 
>> the score directly.
>
> perldoc Mail::SpamAssassin::Conf
>
> Look for the TEMPLATE TAGS section, in particular the _STARS(*)_ tag.
>
Almost, but not exactly what I want since it still has so many 
possibility (up to 50 stars).
I just want to use these 2 redirection (in postfix):

/^X-Spam-Level: Medium/  REDIRECT quarantine-med@example.com
/^X-Spam-Level: High/  REDIRECT quarantine-high@example.com



--beast


Re: tagging based on score level

Posted by Craig Morrison <cr...@2cah.com>.
beast wrote:
> Is it possible to make different tag for a different score/classes, for 
> example:
> 
> high: [SPAM!!!]  if score > 50
> medium: [SPAM!!]  if score between 20 - 50
> low: [SPAM]  if score between treshold - 20
> 
> The reason is client filter or other redirection program (for example to 
> be redirected/ quarantined for further inspection) can not parse the 
> score directly.

perldoc Mail::SpamAssassin::Conf

Look for the TEMPLATE TAGS section, in particular the _STARS(*)_ tag.

-- 
Craig

Re: tagging based on score level

Posted by Kelson <ke...@speed.net>.
beast wrote:
> Is it possible to make different tag for a different score/classes, for 
> example:
> 
> high: [SPAM!!!]  if score > 50
> medium: [SPAM!!]  if score between 20 - 50
> low: [SPAM]  if score between treshold - 20

Depends on how you're calling SpamAssassin and whether SA is doing the 
markup or the calling program is.

I don't think SA has this functionality itself, but if you're calling it 
with a program like MIMEDefang or Amavisd-new, you have a lot more 
flexibility.

With MIMEDefang, for instance, you would do something like this in 
filter_end after calling SpamAssassin.  ($hits is the message's score, 
$req is the spam threshold)

if ($hits >= 50) {
	action_change_header("Subject", "[SPAM!!!] $Subject");
}
elsif ($hits >= 20) {
	action_change_header("Subject", "[SPAM!!] $Subject");
}
elsif ($hits >= $req) {
	action_change_header("Subject", "[SPAM] $Subject");
}

-- 
Kelson Vibber
SpeedGate Communications <www.speed.net>