Mailing List Archive

I need to write a rule with a 'greater than or equal to' evaluati on.
I've been using Messagewall for a while now, and I decided to throw
SpamAssassin into the mix. Messagewall is great, but it's not dynamic
enough.

Problem is that I eventually want messagewall to tag messages only, then
pass them on to SA.
Messagewall always adds the header "X-MessageWall-Score: <score>
(<host.domain.tld>)". I want to write a rule for SpamAssassin that
basically says, "if <score> is greater than or equal to 15, then it's a
match." Note that <score> can be more than two digits.

This is how far I've gotten in local.cf:

header MW_SPAM X-MessageWall-Score: =~ /^[>=15].*/
score MW_SPAM 1.00

Something's wrong with the expression syntax, and I know nothing of perl so
I haven't been able to figure it out.
Anybody know how to do this sorta thing?

TIA,

Nate
Re: I need to write a rule with a 'greater than or equal to' evaluati on. [ In reply to ]
nate@riconcorp.com wrote:

>I've been using Messagewall for a while now, and I decided to throw
>SpamAssassin into the mix. Messagewall is great, but it's not dynamic
>enough.
>
>Problem is that I eventually want messagewall to tag messages only, then
>pass them on to SA.
>Messagewall always adds the header "X-MessageWall-Score: <score>
>(<host.domain.tld>)".
>
I'm doing something similar, using bogofilter to cross-check SA scoring.
Just make sure you add a "bayes_ignore_header X-MessageWall-Score" to
your SA config if you're using bayes, lest it learn to associate that
header (regardless of score) with spam.

>I want to write a rule for SpamAssassin that
>basically says, "if <score> is greater than or equal to 15, then it's a
>match." Note that <score> can be more than two digits.
>
>This is how far I've gotten in local.cf:
>
>header MW_SPAM X-MessageWall-Score: =~ /^[>=15].*/
>score MW_SPAM 1.00
>
>
Er, hmm. How downright clever of you! I pass incoming messages through
virus scanning and bayes scripts before spamassassin, but hadn't thought
about letting good ol' spamassassin do all that hard math stuff for me.
And it opens up possibilities with metas. Not to mention simplifying
procmailrc, and scoring recipes.

Good stuff.

- Bob
Re: I need to write a rule with a 'greater than or equal to' evaluati on. [ In reply to ]
On Mon, 1 Mar 2004 nate@riconcorp.com wrote:

> I've been using Messagewall for a while now, and I decided to throw
> SpamAssassin into the mix. Messagewall is great, but it's not dynamic
> enough.
>
> Problem is that I eventually want messagewall to tag messages only, then
> pass them on to SA.
> Messagewall always adds the header "X-MessageWall-Score: <score>
> (<host.domain.tld>)". I want to write a rule for SpamAssassin that
> basically says, "if <score> is greater than or equal to 15, then it's a
> match." Note that <score> can be more than two digits.
>
> This is how far I've gotten in local.cf:
>
> header MW_SPAM X-MessageWall-Score: =~ /^[>=15].*/
> score MW_SPAM 1.00

There's no direct way to do that. The regexp syntax is for text matching, not
numbers.

But you can cheat a little.

header MW_SPAM X-MessageWall-Score: =~ /^(?:1(?:[5-9]|\d\d)|[2-9]\d)/

should do it. (Untested).

>
> Something's wrong with the expression syntax, and I know nothing of perl so
> I haven't been able to figure it out.
> Anybody know how to do this sorta thing?
>
> TIA,
>
> Nate
>

--
Adam Lopresto
http://cec.wustl.edu/~adam/

If you can spend a perfectly useless afternoon in a perfectly useless
manner, you have learned how to live. -Lin Yutang