Il 02/03/2012 12:13, Martin Gregorie ha scritto:
On Fri, 2012-03-02 at 00:52 +0100, Amedeo Rinaldo wrote:
..[cut]..
I cannot write tons of "meta __FLAG_X  (!THIS_RULE&&  !THIS_OTHER_RULE&&  ..)"
I need some sort of match like "if AllFiredRules in (RuleA, RuleB, RuleC, ...) ->  
raise __FLAG_Y".
And some like .. "if AllFiredRulesTotalNumber</>  CustomThreshould1 then raise 
__FLAG_Z"
Now I don't know how I can do that.. I've just started to ask for the "fired rules 
number" :-)
..[cut]..

IF the list of rules that have fired is accessible to a plugin AND
there's a hook that allows plugins to be called after the rules have all
been run you could do it that way, but I'm nor an SA developer so you'd
have to ask somebody that knows its internals.
Alternatively, you could always write something that runs after SA,
examines the rules list in the first[1] X-Spam-Status header and either
adds its own header, e.g. "X-Custom-Rinaldo fired=all|sufficient", or
modifies the X-Spam-Status header. The advantage of this is that you can
write it in any language you like: I'd probably use C or awk. This
approach is not different from my 'spamkiller' program, which sits after
spamc in my getmail MDA's pipeline and either passes the message to
sendmail for delivery to Postfix, quarantines it or sends it
to /dev/null


Nice ideas ..I'll start taking a look at how amavisd-new handle SA response; anyway I'd need to complete the 'flagging-routine' before SA exit every scan if I want to decrease score ..and ham-learn msg. A post-SA approch would need a messages handling system to work (e.g. reroute/duplicate to mailbox/sa-learn), and I don't want to complicate things too much inserting completely new stages (hard to maintain/debug). Your hints bring me to rethink my monster ;-)
..comparisons help, thanks


[1] There can be more than one set of SA headers in a message and they
are always arranged with the most recent set first.

good to know

Have a nice week-end Martin


--
 .''`. *Amedeo Rinaldo*
: :' : debian addicted ;-)
`. `'
  `-

Reply via email to