The manual doesn’t state this explicitly, but the behavior mirrors NS7: moving a message into the IMAP Junk folder trains rspamc
to recognize it as spam.
Conversely, moving a message to any other folder (except Trash) trains it as ham.
This is the standard training method. For bulk training, you can move multiple messages to the Junk folder using an IMAP client.
You can access the Rspamd UI to check how many messages are learnt so far.
See also Mail — NS8 documentation.
If you prefer a command-line approach, the rspamc
program is available in the Dovecot container. It can be executed conveniently with a wrapper script that handles the authentication header. For example, you can use the following command to see available options:
runagent -m mail1 podman exec -i dovecot /usr/local/lib/dovecot/sieve-pipe/rspamc-wrapper --help