Skip to content

Commit e4f0e13

Browse files
Code review
1 parent 20f4448 commit e4f0e13

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

README.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,20 +193,44 @@ To access the admin web UI of Rspamd point the browser to
193193

194194
## Rspamd bulk Bayesian filter training
195195

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.
199199

200+
To display the help output for the `rspamc-wrapper` command, run:
201+
202+
# Display the help output for rspamc-wrapper
200203
runagent -m mail1 podman exec -i dovecot rspamc-wrapper --help
201204

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:
203214

215+
# Train filter with spam messages in a single mbox file
204216
runagent -m mail1 podman exec -i dovecot rspamc-wrapper learn_spam < spamarchive.mbox
205217

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:
208220

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.
210234

211235
## Service discovery
212236

0 commit comments

Comments
 (0)