@@ -193,20 +193,44 @@ To access the admin web UI of Rspamd point the browser to
193
193
194
194
## Rspamd bulk Bayesian filter training
195
195
196
- To quickly train the Rspamd Bayesian filter plugin, execute the ` rspamc `
197
- wrapper command, which incorporates the Rspamd authentication header
198
- logic. For example, get ` rspamc ` help output with:
196
+ To efficiently train the Rspamd Bayesian filter plugin in an NS8
197
+ environment, use the ` rspamc ` wrapper command, which incorporates Rspamd's
198
+ authentication header logic.
199
199
200
+ To display the help output for the ` rspamc-wrapper ` command, run:
201
+
202
+ # Display the help output for rspamc-wrapper
200
203
runagent -m mail1 podman exec -i dovecot rspamc-wrapper --help
201
204
202
- To read SPAM messages from stdin perform a shell redirection, like:
205
+ To train the filter with ham messages, specify the mailbox path relative
206
+ to Dovecot's working directory. For example, to train with messages from
207
+ ` first.user ` 's mailbox:
208
+
209
+ # Read ham messages from an existing Maildir in the container
210
+ runagent -m mail1 podman exec -i dovecot rspamc-wrapper learn_ham first.user/Maildir/cur
211
+
212
+ For a single spam file (e.g., in mbox format), use shell redirection to
213
+ pass the file through stdin. For example:
203
214
215
+ # Train filter with spam messages in a single mbox file
204
216
runagent -m mail1 podman exec -i dovecot rspamc-wrapper learn_spam < spamarchive.mbox
205
217
206
- To read HAM message from ` first.user ` 's mailbox, specify its path,
207
- relative to Dovecot 's working directory :
218
+ If you have multiple spam files in a directory on the host, copy them into
219
+ the container 's filesystem using :
208
220
209
- runagent -m mail1 podman exec -i dovecot rspamc-wrapper learn_ham first.user/Maildir/cur
221
+ # Copy directory and its contents into Dovecot's container, under /srv
222
+ tar -c ./some-spamdir | runagent -m mail1 podman cp - dovecot:/srv
223
+
224
+ Note that ` /srv/some-spamdir ` is not mounted to a persistent volume, so
225
+ its contents are volatile and will be lost on the next container restart.
226
+ To train with messages from the container directory, run:
227
+
228
+ # Train filter with spam messages in the volatile destination directory
229
+ runagent -m mail1 podman exec -i dovecot rspamc-wrapper learn_spam /srv/some-spamdir
230
+
231
+ For best results, verify successful training by reviewing the Rspamd logs
232
+ or using diagnostic commands. Consult the Rspamd documentation for further
233
+ details.
210
234
211
235
## Service discovery
212
236
0 commit comments