You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Peter Smith <pe...@linuxbox.co.uk> on 2017/06/17 12:48:32 UTC

sa-compile

Hello list,

I'm playing around with sa-compile in an attempt to improve performance,
but I have a couple of questions that I can't find answered in the online
docs.

1) After compiling, my compiled ruleset is stored in
/var/lib/spamassassin/compiled/5.014/3.004001. Do I now need to remove my
rules from /etc/mail/spamassassin/ so that they aren't loaded in twice?
Running spamassassin -D, I can see my un-compiled rules still being
loaded, but perhaps spamassassin does some tricks to skip over these rules
if it finds a pre-compiled version?

2) If I do need to remove my uncompiled rules form /etc/mail/spamassassin,
what/how much should I be removing? For example, clearly I can't remove
v320.pre as this contains the Rule2XSBody loadplugin command.

3) If it's correct to keep my uncompiled rules in /etc/mail/spamassassin,
what happens if these rules are modified? Does spamassassin spot the
change and invalidate the compiled rules, or will it carry on using the
compiled version (until I recompile) ?

Cheers,
Pete


Re: sa-compile

Posted by RW <rw...@googlemail.com>.
On Sat, 17 Jun 2017 16:00:10 +0100
Peter Smith wrote:

> >> 1) After compiling, my compiled ruleset is stored in
> >> /var/lib/spamassassin/compiled/5.014/3.004001. Do I now need to
> >> remove my rules from /etc/mail/spamassassin/  
> >
> > You don't need to remove anything.
> >
> > The stock rules aren't stored there anyway, it's just local rules.  
> 
> Ahh, I think perhaps I'm misunderstanding this (from the man page):
> 
> "sa-compile uses re2c to compile the site-wide parts of the
> SpamAssassin ruleset. No part of user_prefs or any files included
> from user_prefs can be built into the compiled set"
> 
> I understood site-wide rules to mean those stored in
> /etc/mail/spamassassin (as well as those in /usr/share/spamassassin),
> and user prefs to be the per-user rules (when used). Is this
> incorrect? 

No that's correct. My point was that if it were necessary to delete
rules after compilation it would be necessary to delete the stock
rules too.  

Re: sa-compile

Posted by Peter Smith <pe...@linuxbox.co.uk>.
>> 1) After compiling, my compiled ruleset is stored in
>> /var/lib/spamassassin/compiled/5.014/3.004001. Do I now need to
>> remove my rules from /etc/mail/spamassassin/
>
> You don't need to remove anything.
>
> The stock rules aren't stored there anyway, it's just local rules.

Ahh, I think perhaps I'm misunderstanding this (from the man page):

"sa-compile uses re2c to compile the site-wide parts of the SpamAssassin
ruleset. No part of user_prefs or any files included from user_prefs can
be built into the compiled set"

I understood site-wide rules to mean those stored in
/etc/mail/spamassassin (as well as those in /usr/share/spamassassin), and
user prefs to be the per-user rules (when used). Is this incorrect? Does
sa-compile only compile the stock spamassassin rules from
/usr/share/spamassassin?

> However, unless you are using very low-end hardware, you might as well
> rerun sa-compile.

Super, thanks.



Re: sa-compile

Posted by RW <rw...@googlemail.com>.
On Sat, 17 Jun 2017 13:48:32 +0100
Peter Smith wrote:

> Hello list,
> 
> I'm playing around with sa-compile in an attempt to improve
> performance, but I have a couple of questions that I can't find
> answered in the online docs.
> 
> 1) After compiling, my compiled ruleset is stored in
> /var/lib/spamassassin/compiled/5.014/3.004001. Do I now need to
> remove my rules from /etc/mail/spamassassin/ 

You don't need to remove anything. 

The stock rules aren't stored there anyway, it's just local rules.

> 3) If it's correct to keep my uncompiled rules
> in /etc/mail/spamassassin, what happens if these rules are modified?
> Does spamassassin spot the change and invalidate the compiled rules,
> or will it carry on using the compiled version (until I recompile) ?

IIRC, it loops through the body rules parsed-out of the various .cf
files, if there is a valid binary version of a rule, it's used,
otherwise the rule is evaluated in perl. So changes should get
picked-up and deleted rules shouldn't be run.

However, unless you are using very low-end hardware, you might as well
rerun sa-compile.