diff --git a/mail/rspamd/Makefile b/mail/rspamd/Makefile
index 37a8a217e..f627723ab 100644
--- a/mail/rspamd/Makefile
+++ b/mail/rspamd/Makefile
@@ -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
diff --git a/mail/rspamd/pkg-descr b/mail/rspamd/pkg-descr
index 424ca39d0..b64b6b698 100644
--- a/mail/rspamd/pkg-descr
+++ b/mail/rspamd/pkg-descr
@@ -5,6 +5,10 @@ lua.
Plugin Changelog
----------------
+1.8
+
+* Add Bayes autolearn option
+
1.7
* Fix permissions due to upstream changes
diff --git a/mail/rspamd/src/opnsense/mvc/app/controllers/OPNsense/Rspamd/forms/settings.xml b/mail/rspamd/src/opnsense/mvc/app/controllers/OPNsense/Rspamd/forms/settings.xml
index ede741126..57b906f9f 100644
--- a/mail/rspamd/src/opnsense/mvc/app/controllers/OPNsense/Rspamd/forms/settings.xml
+++ b/mail/rspamd/src/opnsense/mvc/app/controllers/OPNsense/Rspamd/forms/settings.xml
@@ -13,6 +13,13 @@
checkboxIf you check this box, the local Redis server will be available to the modules (some do not work without it).
+
+ rspamd.general.enable_bayes_autolearn
+
+ checkbox
+ true
+ 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.
+ rspamd.general.rejectscore
diff --git a/mail/rspamd/src/opnsense/mvc/app/models/OPNsense/Rspamd/RSpamd.xml b/mail/rspamd/src/opnsense/mvc/app/models/OPNsense/Rspamd/RSpamd.xml
index 85b654f1c..c986c74a5 100644
--- a/mail/rspamd/src/opnsense/mvc/app/models/OPNsense/Rspamd/RSpamd.xml
+++ b/mail/rspamd/src/opnsense/mvc/app/models/OPNsense/Rspamd/RSpamd.xml
@@ -1,6 +1,7 @@
//OPNsense/Rspamdrspamd anti spam filter
+ 1.0.0
@@ -11,6 +12,10 @@
0Y
+
+ 0
+ Y
+ N1
diff --git a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS
index bf3870cbb..3569838ba 100644
--- a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS
+++ b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS
@@ -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
diff --git a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/classifier-bayes.conf b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/classifier-bayes.conf
new file mode 100644
index 000000000..03de2f0d2
--- /dev/null
+++ b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/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 %}