Rspamd ships with a set of modules. Some modules are written in C to speed up complex procedures, while others are written in Lua to reduce code size. We encourage you to write new modules in Lua and add the essential support to the Lua API itself. Lua modules are very close to C modules in terms of performance. Lua modules, however, can be written and loaded dynamically.
C modules provide the core functionality of Rspamd and are statically linked to the
main Rspamd code. C modules are defined in options.inc with the filters
attribute.
The default configuration enables all C modules explicitly:
filters = "chartable,dkim,regexp,fuzzy_check";
If no filters
attribute is defined, all C modules are disabled. To understand how to
override defaults, see the FAQ here
and here.
Available C modules:
In prior releases other C modules were enabled by default:
Lua modules are dynamically loaded on Rspamd startup and are reloaded on Rspamd
reconfiguration. Should you want to write a Lua module, consult the
Lua API documentation. To define a path to Lua modules there is a section
named modules
in common.conf:
modules {
path = "${PLUGINSDIR}";
fallback_path = "${SHAREDIR}/lua"; # Legacy path
try_path = "${LOCAL_CONFDIR}/plugins.d/"; # User plugins
}
If a path is a directory then Rspamd scans it for *.lua
pattern and load all
files matched.
The following Lua modules are enabled in the default configuration (but may require additional configuration to work, see notes below):
Received
headers and performs some additional checks for such messages.The following modules are explicitly disabled in the default configuration, set enabled = true
in local.d/${MODULE_NAME}.conf
to enable them:
The following modules are explicitly disabled and are experimental, so you need to set enabled = true
in local.d/${MODULE_NAME}.conf
AND to set the global option enable_experimental = true
in local.d/options.inc
:
Experimental modules are not recommended for production usage!
To disable an entire module you can set enabled = false;
in /etc/rspamd/local.d/${MODULE_NAME}.conf