mail/rspamd: add bayes autolearn (#1421)

This commit is contained in:
Michael
2019-09-11 13:15:25 +02:00
committed by Franco Fichtner
parent 11af5ad200
commit ed9a594209
6 changed files with 29 additions and 1 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
PLUGIN_NAME= rspamd
PLUGIN_VERSION= 1.7
PLUGIN_VERSION= 1.8
PLUGIN_COMMENT= Protect your network from spam
PLUGIN_DEPENDS= rspamd
PLUGIN_MAINTAINER= franz.fabian.94@gmail.com
+4
View File
@@ -5,6 +5,10 @@ lua.
Plugin Changelog
----------------
1.8
* Add Bayes autolearn option
1.7
* Fix permissions due to upstream changes
@@ -13,6 +13,13 @@
<type>checkbox</type>
<help>If you check this box, the local Redis server will be available to the modules (some do not work without it).</help>
</field>
<field>
<id>rspamd.general.enable_bayes_autolearn</id>
<label>Enable Bayes Autolearn</label>
<type>checkbox</type>
<advanced>true</advanced>
<help>If you check this box, autolearning will be enabled. Autolearning is performing as spam if a message has reject action and as ham if a message has negative score.</help>
</field>
<field>
<id>rspamd.general.rejectscore</id>
<label>Reject Score</label>
@@ -1,6 +1,7 @@
<model>
<mount>//OPNsense/Rspamd</mount>
<description>rspamd anti spam filter</description>
<version>1.0.0</version>
<items>
<general>
<enabled type="BooleanField">
@@ -11,6 +12,10 @@
<default>0</default>
<Required>Y</Required>
</enable_redis_plugin>
<enable_bayes_autolearn type="BooleanField">
<default>0</default>
<Required>Y</Required>
</enable_bayes_autolearn>
<rejectscore type="IntegerField">
<Required>N</Required>
<MinimumValue>1</MinimumValue>
@@ -19,3 +19,4 @@ mx_check.conf:/usr/local/etc/rspamd/local.d/mx_check.conf
ratelimit.conf:/usr/local/etc/rspamd/local.d/ratelimit.conf
redis.conf:/usr/local/etc/rspamd/local.d/redis.conf
spamtrap-map:/usr/local/etc/rspamd/maps.d/spamtrap.map
classifier-bayes.conf:/usr/local/etc/rspamd/local.d/classifier-bayes.conf
@@ -0,0 +1,11 @@
# Please don't modify this file as your changes might be overwritten with
# the next update.
#
{% if helpers.exists('OPNsense.Rspamd.general.enabled') and OPNsense.Rspamd.general.enabled == '1' and helpers.exists('OPNsense.Rspamd.general.enable_bayes_autolearn') %}
{% if helpers.exists('OPNsense.Rspamd.general.enable_bayes_autolearn') and OPNsense.Rspamd.general.enable_bayes_autolearn == '1' %}
autolearn = true;
{% endif %}
{% endif %}