You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by adp <da...@i-55.com> on 2004/05/26 22:09:50 UTC

Adding my own rules and scores to SA

I want to create a custom test that we can use with SA. I know the score
from this test before I even call SA, but the SA object has already been
created. Is there a way to insert this score into SA so that the "total
score" and the spam_report reflects my test in addition to other tests? Do I
need to modify the SA source, or is there another (and cleaner) way for an
outside test to show up in SA's spam_level and spam_report?



Re: Adding my own rules and scores to SA

Posted by jdow <jd...@earthlink.net>.
From: "adp" <da...@i-55.com>
> From: "Matt Kettler" <mk...@evi-inc.com>
>
> > At 04:09 PM 5/26/2004, adp wrote:
> > >I want to create a custom test that we can use with SA.
> >
> > Ok
> >
> ...
> > >need to modify the SA source, or is there another (and cleaner) way for
> an
> > >outside test to show up in SA's spam_level and spam_report?
> >
> >
> > Wait, why are you trying to do this via dynamic insertion at the perl
code
> > level?
>
> We are calling the SA module from a larger Perl program. The flow goes
like
> this:
>
> we eval an email against our test
> we eval the email against SA
> we add the two scores together
>
> I'd like to just combine our score with SA at the SA-level, rather than
> having to play around with spam_level, etc. that we get from SA.
>
> > Why not just edit local.cf and add a rule?
> >
> > If you need your rule to be perl code, add to evaltests.pm and have the
> > local.cf rule call it.
>
> Because we are calling SA, not the other way around. Perhaps there is a
way
> to expose our test score into evaltests.pm.

I can think of a rude hackish way to do it. Place your test's score into
the headers as an easily parseable entry. Create a simple eval test to
evaluate (and optionally remove if this is possible and required) the
pasted in header element. It's rude. It's crude. I expect it would work.
In that case I would invoke the "Done is good" clause.

{^_^}


Re: Adding my own rules and scores to SA

Posted by adp <da...@i-55.com>.
----- Original Message -----
From: "Matt Kettler" <mk...@evi-inc.com>
To: "adp" <da...@i-55.com>; <sp...@incubator.apache.org>
Sent: Wednesday, May 26, 2004 3:43 PM
Subject: Re: Adding my own rules and scores to SA


> At 04:09 PM 5/26/2004, adp wrote:
> >I want to create a custom test that we can use with SA.
>
> Ok
>
...
> >need to modify the SA source, or is there another (and cleaner) way for
an
> >outside test to show up in SA's spam_level and spam_report?
>
>
> Wait, why are you trying to do this via dynamic insertion at the perl code
> level?

We are calling the SA module from a larger Perl program. The flow goes like
this:

we eval an email against our test
we eval the email against SA
we add the two scores together

I'd like to just combine our score with SA at the SA-level, rather than
having to play around with spam_level, etc. that we get from SA.

> Why not just edit local.cf and add a rule?
>
> If you need your rule to be perl code, add to evaltests.pm and have the
> local.cf rule call it.

Because we are calling SA, not the other way around. Perhaps there is a way
to expose our test score into evaltests.pm.



Re: Adding my own rules and scores to SA

Posted by Matt Kettler <mk...@evi-inc.com>.
At 04:09 PM 5/26/2004, adp wrote:
>I want to create a custom test that we can use with SA.

Ok

>  I know the score
>from this test before I even call SA, but the SA object has already been
>created. Is there a way to insert this score into SA so that the "total
>score" and the spam_report reflects my test in addition to other tests? Do I
>need to modify the SA source, or is there another (and cleaner) way for an
>outside test to show up in SA's spam_level and spam_report?


Wait, why are you trying to do this via dynamic insertion at the perl code 
level?

Why not just edit local.cf and add a rule?

If you need your rule to be perl code, add to evaltests.pm and have the 
local.cf rule call it. 


Re: Adding my own rules and scores to SA

Posted by jdow <jd...@earthlink.net>.
From: "adp" <da...@i-55.com>


> I want to create a custom test that we can use with SA. I know the score
> from this test before I even call SA, but the SA object has already been
> created. Is there a way to insert this score into SA so that the "total
> score" and the spam_report reflects my test in addition to other tests? Do
I
> need to modify the SA source, or is there another (and cleaner) way for an
> outside test to show up in SA's spam_level and spam_report?

That requires clarification.

If you mean a new filter rule then edit that into local.cf and be done
with it. If you mean a new custom test program such as a virus filter
the filters are not additive.

{^_^}