Skip to content

Commit

Permalink
mail/rspamd: add bayes autolearn (opnsense#1421)
Browse files Browse the repository at this point in the history
  • Loading branch information
mimugmail authored and fichtner committed Sep 11, 2019
1 parent 11af5ad commit ed9a594
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mail/rspamd/Makefile
Original file line number Diff line number Diff line change
@@ -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= [email protected]
Expand Down
4 changes: 4 additions & 0 deletions mail/rspamd/pkg-descr
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ lua.
Plugin Changelog
----------------

1.8

* Add Bayes autolearn option

1.7

* Fix permissions due to upstream changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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">
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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 %}

0 comments on commit ed9a594

Please sign in to comment.