SA-COMPILE(1)
π
SA-COMPILE(1) β the sa-compile page, but make it make sense
okay so real talk bestie, this is one of those Perl-doc manual pages (you know, the "User Contributed Perl Documentation" kind), and it's about sa-compile. grab a snack, it's actually kind of a slay π
β¨ NAME β¨
sa-compile β compile the SpamAssassin ruleset into native code. yes, like, actually native. it's giving compiler-girl Summer π
πΈ SYNOPSIS πΈ
sa-compile [options]
Options:
--listβ Output base string list to STDOUT--sudoβ Use 'sudo' for privilege escalation--keep-tmpsβ Keep temporary files instead of deleting-C path,--configpath=path,--config-file=pathβ Path to standard configuration dir-p prefs,--prefspath=file,--prefs-file=fileβ Set user preferences file--siteconfigpath=pathβ Path for site configs (default:/usr/etc/mail/spamassassin)--updatedir=pathβ Directory to place updates (default:/var/lib/spamassassin/compiled/<perlversion>/4.000002)--cf='config line'β Additional line of configuration-D,--debug [area=n,...]β Print debugging messages-V,--versionβ Print version-h,--helpβ Print usage message
π DESCRIPTION π
so sa-compile uses re2c to compile the site-wide parts of the SpamAssassin ruleset. and no cap: no part of user_prefs or any files included from user_prefs can be built into the compiled set. that's just how it is, bestie π«Ά
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. iykyk.
the way re2c works is lowkey iconic β it 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. π₯ but β and this is the important part β not all SpamAssassin rules are amenable to this conversion, however. some rules just don't vibe with it, periodt.
this whole thing requires re2c (see https://re2c.org/), plus the C compiler used to build Perl XS modules, be installed. both of them. no skipping π
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. it's not gonna do it for you, girl, you gotta do it yourself π
π OPTIONS π
--listβ outputs the extracted base strings to STDOUT, instead of generating the C extension code. like a little preview, cute.--sudoβ uses sudo(8) to run code as 'root' when writing files to the compiled-rules storage area (which is/var/lib/spamassassin/compiled/5.042/4.000002by default). main character energy, honestly π--quietβ produces less diagnostic output. but bestie, errors will still be displayed. we're quiet, not blind π--keep-tmpsβ keeps temporary files after the script completes, instead of deleting them. hoarder behavior but make it unix π-C path,--configpath=path,--config-file=pathβ uses the specified path for locating the distributed configuration files. this makes it ignore the default directories (usually/usr/share/spamassassinor similar). bye default dirs π--siteconfigpath=pathβ uses the specified path for locating site-specific configuration files. this ignores the default directories (usually/etc/mail/spamassassinor similar).--updatedirβ by default,sa-compilewill use the system-wide rules update directory:
/var/lib/spamassassin/compiled/5.042/4.000002
if the updates should be stored in another location, specify it here.
note that use of this option is not recommended. fr fr, ifsa-compileis placing the compiled rules in the wrong directory, you probably need to rebuild SpamAssassin with differentMakefile.PLarguments instead of overridingsa-compile's runtime behaviour. don't fight the build system, bestie, just rebuild it π
--cf='config line'β adds 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. stacking them like friendship bracelets π¦-p prefs,--prefspath=prefs,--prefs-file=prefsβ reads user score preferences from prefs (usually$HOME/.spamassassin/user_prefs). it's the home-girl path π-D [area,...],--debug [area,...]β produces 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. the lore is all there π
-h,--helpβ prints the help message and exits. bless.-V,--versionβ prints thesa-compileversion and exits. π
π SEE ALSO π
Mail::SpamAssassin(3) spamassassin(1) spamd(1)
π§ PREREQUISITES π§
Mail::SpamAssassin re2c Mail::SpamAssassin::Plugin::Rule2XSBody
π BUGS π
see https://bz.apache.org/SpamAssassin/ β it's giving issue-tracker realness π₯
π AUTHORS π
The Apache SpamAssassin(tm) Project <https://spamassassin.apache.org/> β absolute icons, no notes.
β LICENSE AND COPYRIGHT β
SpamAssassin is distributed under the Apache License, Version 2.0, as described in the file LICENSE included with the distribution. read it, it's good for you π«Ά
Copyright (C) 2015 The Apache Software Foundation
so yeah, that's the whole vibe check π β this page lives in the User Contributed Perl Documentation section (perl v5.42.0, dated 2025-08-31), and honestly? iconic of it. mwah πβ¨
π¦ where this page comes from
- alpine 3.23: spamassassin-doc 4.0.2-r0 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms