From 5d093901470bdf6cb2fd39e85e22fbbeb100475b Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Thu, 8 Sep 2022 17:32:50 +0200 Subject: [PATCH 1/3] enable rspamd's autolearn feature --- core/rspamd/conf/classifier-bayes.conf | 6 ++++++ towncrier/newsfragments/2446.bugfix | 1 + 2 files changed, 7 insertions(+) create mode 100644 core/rspamd/conf/classifier-bayes.conf create mode 100644 towncrier/newsfragments/2446.bugfix diff --git a/core/rspamd/conf/classifier-bayes.conf b/core/rspamd/conf/classifier-bayes.conf new file mode 100644 index 00000000..510b5814 --- /dev/null +++ b/core/rspamd/conf/classifier-bayes.conf @@ -0,0 +1,6 @@ +autolearn { + spam_threshold = 6.0; # When to learn spam (score >= threshold) + ham_threshold = -0.5; # When to learn ham (score <= threshold) + check_balance = true; # Check spam and ham balance + min_balance = 0.9; # Keep diff for spam/ham learns for at least this value +} diff --git a/towncrier/newsfragments/2446.bugfix b/towncrier/newsfragments/2446.bugfix new file mode 100644 index 00000000..331afba0 --- /dev/null +++ b/towncrier/newsfragments/2446.bugfix @@ -0,0 +1 @@ +Enable rspamd's autolearn feature to ensure that its bayes classifier has enough HAM to make it usable. Previously the bayes module would never work unless some HAM had been learnt manually. From 7272a99d18cff8daf35a1c8cf1057de5513d0d1d Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Thu, 8 Sep 2022 17:35:08 +0200 Subject: [PATCH 2/3] fuzzy matching and bayes are two different things document accordingly --- docs/antispam.rst | 2 ++ docs/faq.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/antispam.rst b/docs/antispam.rst index 41d9cc4c..7cadde1d 100644 --- a/docs/antispam.rst +++ b/docs/antispam.rst @@ -59,6 +59,7 @@ If you already have an existing mailbox and want Mailu to learn them all as ham .. code-block:: bash rspamc -h antispam:11334 -P mailu -f 13 fuzzy_add /mail/user\@example.com/.Ham_Learn/cur/ + rspamc -h antispam:11334 -P mailu learn_ham /mail/user\@example.com/.Ham_Learn/cur/ This should learn every file located in the ``Ham_Learn`` folder from user@example.com @@ -67,6 +68,7 @@ Likewise, to learn all messages within the folder ``Spam_Learn`` as spam message .. code-block:: bash rspamc -h antispam:11334 -P mailu -f 11 fuzzy_add /mail/user\@example.com/.Spam_Learn/cur/ + rspamc -h antispam:11334 -P mailu learn_spam /mail/user\@example.com/.Spam_Learn/cur/ *Issue reference:* `1438`_. diff --git a/docs/faq.rst b/docs/faq.rst index 923f9755..7b888867 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -736,6 +736,7 @@ If you already have an existing mailbox and want Mailu to learn them all as ham .. code-block:: bash rspamc -h antispam:11334 -P mailu -f 13 fuzzy_add /mail/user\@example.com/.Ham_Learn/cur/ + rspamc -h antispam:11334 -P mailu learn_ham /mail/user\@example.com/.Ham_Learn/cur/ This should learn every file located in the ``Ham_Learn`` folder from user@example.com @@ -744,6 +745,7 @@ Likewise, to lean all messages within the folder ``Spam_Learn`` as spam messages .. code-block:: bash rspamc -h antispam:11334 -P mailu -f 11 fuzzy_add /mail/user\@example.com/.Spam_Learn/cur/ + rspamc -h antispam:11334 -P mailu learn_spam /mail/user\@example.com/.Spam_Learn/cur/ *Issue reference:* `1438`_. From 256fa5c90c552df6487af3bdabfb19d3ca4f3622 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Thu, 8 Sep 2022 17:36:18 +0200 Subject: [PATCH 3/3] doh --- towncrier/newsfragments/{2446.bugfix => 2447.bugfix} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename towncrier/newsfragments/{2446.bugfix => 2447.bugfix} (100%) diff --git a/towncrier/newsfragments/2446.bugfix b/towncrier/newsfragments/2447.bugfix similarity index 100% rename from towncrier/newsfragments/2446.bugfix rename to towncrier/newsfragments/2447.bugfix