Andrew Talbot wrote: > This is what I was wondering. We don't want to have to run a > computationally-expensive body rule unless we need to. No choice > though, I guess. Thanks for your help! > > >> -----Original Message----- >> From: John Hardin [mailto:jhar...@impsec.org] >> Sent: Monday, June 24, 2013 1:20 PM >> To: users@spamassassin.apache.org >> Subject: Re: "Chain" rules? >> >> On Mon, 24 Jun 2013, Andrew Talbot wrote: >> >>> Is there a way to "chain" rules together such that one rule will >>> only fire if another is hit? >>> >>> Specifically, we have a client that is getting hit with a bunch of >>> messages that are just links, but the links contain sex words. We >>> want to do a body scan for a list of sex words if and only if the >>> "body contains only a link" rule we have is triggered. >>> >>> I tried to get this to work with meta rules but it seems like it >>> won't do it. Is there currently a way to do this sort of >>> conditional check? >> >> Unfortunately you can't control whether or not a rule is *executed*, >> you can only control whether or not it contributes to the message's >> overall score. >>
Don't forget you can do this with a custom module. I have one that does some network things and before I actually do the processing I check the current score and if it's above a certain score I skip the tests and I also check for two other tests to see if one or both hit (I changed the priority of those tests to run early and before the module) and if neither hit I also skip processing in the module, so perhaps you should look at the documentation and examples for custom modules they really are not too difficult to program. Also look at shorcircuit and priority