Skip to content

Commit

Permalink
Group required and optional parameters separately
Browse files Browse the repository at this point in the history
  • Loading branch information
moisseev committed Jul 12, 2024
1 parent f1e7780 commit 8d37f9e
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions doc/configuration/statistic.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,29 @@ The classifier in Rspamd learns headers that are specifically defined in the `cl

Supported parameters for the Redis backend are:

- `name`: unique name of the classifier, must be set when multiple classifiers are defined, otherwise optional
- `tokenizer`: currently only OSB is supported, must be set as shown in default configuration
- `new_schema`: must be set to `true`
- `backend`: must be set to `"redis"`
- `learn_condition`: Lua function that verifies that learning is needed. Default function **must** be set if you have not written your own, omitting `learn_condition` from `statistic.conf` will lead to losing protection from overlearning
- `servers`: IP or hostname with a port for the Redis server. Use an IP for the loopback interface, if you have defined localhost in /etc/hosts for IPv4 and IPv6, or your Redis server will not be found!
- `write_servers` (optional): for write-only Redis servers (usually masters)
- `read_servers` (optional): for read-only Redis servers (usually replicas)
- `password` (optional): password for the Redis server
- `db` (optional): database to use, **must be a non-negative integer** (though it is recommended to use dedicated Redis instances and not databases in Redis)
- `min_tokens`: minimum number of words required for statistics processing
- `min_learns` (optional): minimum learn to count for **both** spam and ham classes to perform classification
- `autolearn` (optional): for more details see Autolearning section
- `per_user` (optional): for more details see Per-user statistics section
- `statfile`: defines keys for spam and ham mails
- `cache_prefix` (optional): prefix used to create keys where to store hashes of already learned ids, defaults to `"learned_ids"`
- `cache_max_elt` (optional): amount of elements to store in one `learned_ids` key
- `cache_max_keys` (optional): amount of `learned_ids` keys to store
- `cache_elt_len` (optional): length of hash to store in one element of `learned_ids`
### Required parameters
- `name`: Unique name of the classifier. Must be set when multiple classifiers are defined; otherwise, optional.
- `tokenizer`: Currently, only OSB is supported. Must be set as shown in the default configuration.
- `new_schema`: Must be set to `true`.
- `backend`: Must be set to `"redis"`.
- `learn_condition`: Lua function that verifies that learning is needed. The default function **must** be set if you have not written your own. Omitting `learn_condition` from `statistic.conf` will lead to losing protection from overlearning.
- `servers`: IP or hostname with a port for the Redis server. Use an IP for the loopback interface if you have defined localhost in /etc/hosts for IPv4 and IPv6, or your Redis server will not be found!
- `min_tokens`: Minimum number of words required for statistics processing.
- `statfile`: Defines keys for spam and ham mails.

### Optional parameters
- `write_servers`: For write-only Redis servers (usually masters).
- `read_servers`: For read-only Redis servers (usually replicas).
- `password`: Password for the Redis server.
- `db`: Database to use, **must be a non-negative integer** (though it is recommended to use dedicated Redis instances and not databases in Redis).
- `min_learns`: Minimum learn to count for **both** spam and ham classes to perform classification.
- `autolearn`: For more details, see the Autolearning section.
- `per_user`: For more details, see the Per-user statistics section.
- `cache_prefix`: Prefix used to create keys where to store hashes of already learned IDs, defaults to `"learned_ids"`.
- `cache_max_elt`: Amount of elements to store in one `learned_ids` key.
- `cache_max_keys`: Amount of `learned_ids` keys to store.
- `cache_elt_len`: Length of hash to store in one element of `learned_ids`.


## Autolearning

Expand Down

0 comments on commit 8d37f9e

Please sign in to comment.