diff --git a/mail/rspamd/Makefile b/mail/rspamd/Makefile index 54909acf7..a321e1c9b 100644 --- a/mail/rspamd/Makefile +++ b/mail/rspamd/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= rspamd -PLUGIN_VERSION= 1.4 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.5 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 4f1eef47b..ac70e172d 100644 --- a/mail/rspamd/pkg-descr +++ b/mail/rspamd/pkg-descr @@ -1,3 +1,10 @@ Rspamd is fast, modular and lightweight spam filter. It is designed to work with big amount of mail and can be easily extended with own filters written in lua. + +Plugin Changelog +---------------- + +1.5 + +* Add whitelisting to Graylist section 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 5fa76dee2..2f4600609 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 @@ -138,6 +138,14 @@ text Mask bits are used to limit the network range from which the message may be resent. This is used to avoid a rejection if another server sends the second mail. + + rspamd.graylist.whitelist_ip + + select_multiple + + true + Mails from IPs or networks in CIDR format entered here will be whitelisted from graylisting. + 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 b7bf37112..fc55ed794 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 @@ -173,6 +173,10 @@ 64 A valid IPv6 mask must be between 1 and 128 bits. 64 bits are recommended as this is the recommended subnet size in IPv6. + + N + /^([a-fA-F0-9\.:\[\]\/]*?,)*([a-fA-F0-9\.:\[\]\/]*)$/ + diff --git a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS index f12b747a4..d6263bbf7 100644 --- a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS +++ b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS @@ -10,6 +10,7 @@ spamtrap.conf:/usr/local/etc/rspamd/local.d/spamtrap.conf surbl-whitelist.inc.local:/var/db/rspamd/surbl-whitelist.inc.local 2tld.inc.local:/var/db/rspamd/2tld.inc.local greylist.conf:/usr/local/etc/rspamd/local.d/greylist.conf +greylist_ip.wl:/usr/local/etc/rspamd/local.d/greylist_ip.wl phishing.conf:/usr/local/etc/rspamd/local.d/phishing.conf milter_headers.conf:/usr/local/etc/rspamd/local.d/milter_headers.conf multimap.conf:/usr/local/etc/rspamd/local.d/multimap.conf diff --git a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/greylist.conf b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/greylist.conf index 2af6f1e15..42e19b416 100644 --- a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/greylist.conf +++ b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/greylist.conf @@ -11,4 +11,5 @@ action = "soft reject"; # default greylisted action ipv4_mask = {{ OPNsense.Rspamd.graylist.ipv4mask|default('19') }}; ipv6_mask = {{ OPNsense.Rspamd.graylist.ipv6mask|default('64') }}; + whitelist_ip = "/usr/local/etc/rspamd/local.d/greylist_ip.wl"; {% endif %} diff --git a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/greylist_ip.wl b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/greylist_ip.wl new file mode 100644 index 000000000..c0253c2e4 --- /dev/null +++ b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/greylist_ip.wl @@ -0,0 +1,5 @@ +{% if helpers.exists('OPNsense.Rspamd.general.enabled') and OPNsense.Rspamd.general.enabled == '1' and helpers.exists('OPNsense.Rspamd.graylist.whitelist_ip') and OPNsense.Rspamd.graylist.whitelist_ip != '' %} +{% for host in OPNsense.Rspamd.graylist.whitelist_ip.split(',') %} +{{ host }} +{% endfor %} +{% endif %}