rspamd/doc/markdown/configuration/index.md
2014-08-14 13:48:06 +01:00

2.9 KiB

Rspamd configuration

Rspamd uses UCL for its configuration. UCL format is described in details in this document. Rspamd defines several variables and macros to extend UCL functionality.

Table of Contents

Rspamd variables

  • CONFDIR: configuration directory for rspamd, it is $PREFIX/etc/rspamd/
  • RUNDIR: runtime directory to store pidfiles or unix sockets
  • DBDIR: persistent databases directory (used for statistics or symbols cache).
  • LOGDIR: a directory to store log files
  • PLUGINSDIR: plugins directory where lua plugins live
  • PREFIX: basic installation prefix
  • VERSION: rspamd version string (e.g. "0.6.6")

Rspamd specific macros

  • .include_map: defines a map that is dynamically reloaded and updated if its content has been changed. This macros is intended to define dynamic configuration parts.

Rspamd basic configuration

The basic rspamd configuration is stored in $CONFDIR/rspamd.conf. By default, this file looks like this one:

lua = "$CONFDIR/lua/rspamd.lua"

.include "$CONFDIR/options.conf"
.include "$CONFDIR/logging.conf"
.include "$CONFDIR/metrics.conf"
.include "$CONFDIR/workers.conf"
.include "$CONFDIR/composites.conf"

.include "$CONFDIR/statistic.conf"

.include "$CONFDIR/modules.conf"

modules {
	path = "$PLUGINSDIR/lua/"
}

In this file, we open lua script placed in $CONFDIR/lua/rspamd.lua and load lua rules from it. Then we include global options section followed by logging logging configuration. Metrics section defines metric settings, including rules weights and rspamd actions. Workers section specifies rspamd workers settings. Composites is an utility section that describes composite symbols. Statistical filters are defined in statistic section. Rspamd stores modules configuration (for both lua and internal modules) in modules section while modules itself are loaded from the following portion of configuration:

modules {
	path = "$PLUGINSDIR/lua/"
}

This section defines one or single path to either directories or specific files. If directory is used then all files with suffix .lua are loaded as lua plugins (it is *.lua shell pattern therefore).

This configuration is not intended to be changed by user, but you can include your own configuration in further. To redefine symbols weight and actions rspamd encourages to use dynamic configuration. Nevertheless, rspamd installation script will never rewrite user's configuration if it exists already. So please read ChangeLog carefully if you upgrade rspamd to a new version for all incompatible configuration changes.