From 271e9a4b56c9c212865df66aeea038874726149a Mon Sep 17 00:00:00 2001 From: andryyy Date: Wed, 22 Mar 2017 15:07:50 +0100 Subject: [PATCH 1/2] Add hint for password vs enable_password in Rspamd --- docs/first_steps.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/first_steps.md b/docs/first_steps.md index 2202794c3..7f835bc49 100644 --- a/docs/first_steps.md +++ b/docs/first_steps.md @@ -64,6 +64,8 @@ docker-compose exec rspamd-mailcow rspamadm pw enable_password = "myhash"; ``` +You can use `password = "myhash";` instead of `enable_password` to disable write-access in the web UI. + 3\. Restart rspamd: ``` docker-compose restart rspamd-mailcow From 78f75deccb92ada72a26e4d9cad6b97069d66ff8 Mon Sep 17 00:00:00 2001 From: andryyy Date: Wed, 22 Mar 2017 15:08:21 +0100 Subject: [PATCH 2/2] Fix #143 --- docs/u_and_e.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/u_and_e.md b/docs/u_and_e.md index fcafb0d2a..0eb9ab03e 100644 --- a/docs/u_and_e.md +++ b/docs/u_and_e.md @@ -79,10 +79,10 @@ Open `data/conf/postfix/main.cf` and find `smtpd_sender_restrictions`. Prepend ` smtpd_sender_restrictions = check_sasl_access hash:/opt/postfix/conf/check_sender_access reject_authenticated_sender [...] ``` -Run postmap on check_sasl_access: +Run postmap on check_sender_access: ``` -docker-compose exec postfix-mailcow postmap /opt/postfix/conf/check_sasl_access +docker-compose exec postfix-mailcow postmap /opt/postfix/conf/check_sender_access ``` Restart the Postfix container. @@ -266,6 +266,22 @@ The bayes statistics are written to Redis as keys `BAYES_HAM` and `BAYES_SPAM`. You can also use Rspamd's web ui to learn ham and/or spam. +### Learn ham or spam from existing directory + +You can use a one-liner to learn mail in plain-text (uncompressed) format: +``` +# Ham +for file in /my/folder/cur/*; do docker exec -i $(docker-compose ps -q rspamd-mailcow) rspamc learn_ham < $file; done +# Spam +for file in /my/folder/.Junk/cur/*; do docker exec -i $(docker-compose ps -q rspamd-mailcow) rspamc learn_spam < $file; done +``` + +Consider attaching a local folder as new volume to `rspamd-mailcow` in `docker-compose.yml` and learn given files inside the container. This can be used as workaround to parse compressed data with zcat. Example: + +``` +for file in /data/old_mail/.Junk/cur/*; do rspamc learn_spam < zcat $file; done +``` + ### CLI tools ```