sa-compile1p
Compile spamassassin ruleset into native code
Usage
sa-compile [options]
Options:
Set user
preferences
file
--siteconfigpath=path
Path
for
site
configs
Overview
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.
This compiled set is then used by the "Mail::SpamAssassin::Plugin::Rule2XSBody" plugin to speed up SpamAssassin's operation, where possible, and when that plugin is loaded.
"re2c" can match strings much faster than perl code, by constructing a DFA to match many simple strings in parallel, and compiling that to native object code. Not all SpamAssassin rules are amenable to this conversion, however.
This requires "re2c" (see "https://re2c.org/"), and the C compiler used to build Perl XS modules, be installed.
Note that running this, and creating a compiled ruleset, will have no effect on SpamAssassin scanning speeds unless you also edit your "v320.pre" file and ensure this line is uncommented:
loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody
Additionally, "sa-compile" will not restart "spamd" or otherwise cause a scanner to reload the now-compiled ruleset automatically.
Options
-
--list -
Output the extracted base strings to STDOUT, instead of generating the C extension code.
-
--sudo -
Use
sudo(8)to run code as 'root' when writing files to the compiled-rules storage area (which is"/var/lib/spamassassin/compiled/5.044/4.000002"by default).
-
--quiet -
Produce less diagnostic output. Errors will still be displayed.
-
--keep-tmps -
Keep temporary files after the script completes, instead of deleting them.
-
-C path, --configpath=path, --config-file=path -
Use the specified path for locating the distributed configuration files. Ignore the default directories (usually
"/usr/share/spamassassin"or similar).
-
--siteconfigpath=path -
Use the specified path for locating site-specific configuration files. Ignore the default directories (usually
"/etc/mail/spamassassin"or similar).
-
--updatedir -
By default,
"sa-compile"will use the system-wide rules update directory:/var/lib/spamassassin/compiled/5.044/4.000002If the updates should be stored in another location, specify it here.
Note that use of this option is not recommended; if sa-compile is placing the compiled rules the wrong directory, you probably need to rebuild SpamAssassin with different
"Makefile.PL"arguments, instead of overriding sa-compile's runtime behaviour.
- --cf='config line'
-
Add additional lines of configuration directly from the command-line, parsed after the configuration files are read. Multiple
--cfarguments can be used, and each will be considered a separate line of configuration.
-
-p prefs, --prefspath=prefs, --prefs-file=prefs -
Read user score preferences from prefs (usually
"$HOME/.spamassassin/user_prefs") .
-
-D [area,...], --debug [area,...] -
Produce debugging output. If no areas are listed, all debugging information is printed. Diagnostic output can also be enabled for each area individually; area is the area of the code to instrument.
For more information about which areas (also known as channels) are available, please see the documentation at <https://wiki.apache.org/spamassassin/DebugChannels>.
-
-h, --help -
Print help message and exit.
-
-V, --version -
Print sa-compile version and exit.
Prerequisites
"Mail::SpamAssassin" "re2c" "Mail::SpamAssassin::Plugin::Rule2XSBody"
License and copyright
SpamAssassin is distributed under the Apache License, Version 2.0, as described in the file "LICENSE" included with the distribution.
Copyright (C) 2015 The Apache Software Foundation
Releases
10 releases since Debian 5.0 (Lenny); the text changed 9 times.
--quiet since Debian 6.0 (Squeeze).