Skip to content

Document the Rspamd Bayes database reset procedure - #291

Merged
DavidePrincipi merged 1 commit into
mainfrom
docs-rspamd
Sep 8, 2026
Merged

DavidePrincipi merged 1 commit into
mainfrom
docs-rspamd

Conversation

@DavidePrincipi

@DavidePrincipi DavidePrincipi commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Add a README section describing how to reset the Rspamd Bayesian
classifier, so administrators can start the training over after a bad
corpus.

The procedure covers:

  • taking a snapshot of the persistent Redis DB with redis-cli --rdb
  • unlinking the Bayes keys (RS_*, BAYES_*, the bare RS counter
    key) plus the learned_* learn cache — without the latter,
    re-training with the original corpus is silently skipped as
    "already learned"
  • checking the learn counters via rspamc-wrapper stat
  • rolling back to the snapshot, and cleaning up stale snapshots, which
    would otherwise be carried in the module backup set through
    volumes/rspamd-redis

Documentation only, no code changes.

Refs NethServer/dev#8138

Resetting the Bayesian classifier required knowledge of the Redis keys
used by Rspamd and of the volume layout, which was not documented
anywhere. Administrators had no safe way to start the training over
after a corpus mistake.

Describe how to snapshot the persistent Redis DB, drop the Bayes keys
and the learn cache, verify the learn counters, and roll back to the
snapshot if needed. The learn cache must be dropped too, otherwise
re-training with the original corpus is silently skipped.

Assisted-by: Claude Code:claude-opus-5
@DavidePrincipi
DavidePrincipi merged commit adf1479 into main Sep 8, 2026
3 checks passed
@DavidePrincipi
DavidePrincipi deleted the docs-rspamd branch September 8, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants