From 1eb51aa6feb069c3ff969b95d1e452abae916f78 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 18 Jul 2019 11:00:53 +0200 Subject: [PATCH] - fixed white/blacklisting for rspamd --- install/lib/update.lib.php | 2 +- server/conf/rspamd_users.inc.conf.master | 16 ++++++++-------- server/conf/rspamd_wblist.inc.conf.master | 14 +++++++++++--- server/plugins-available/rspamd_plugin.inc.php | 3 ++- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/install/lib/update.lib.php b/install/lib/update.lib.php index 3406b760b0..fd1a34b2ca 100644 --- a/install/lib/update.lib.php +++ b/install/lib/update.lib.php @@ -103,7 +103,7 @@ function checkDbHealth() { $notok = array(); echo "Checking ISPConfig database .. "; - exec("mysqlcheck -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." -p".escapeshellarg($conf['mysql']['admin_password'])." -P ".escapeshellarg($conf['mysql']['port'])." -r ".escapeshellarg($conf["mysql"]["database"]), $result); + exec("mysqlcheck -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." -p".escapeshellarg($conf['mysql']['admin_password'])." -P ".escapeshellarg($conf['mysql']['port'])." --auto-repair ".escapeshellarg($conf["mysql"]["database"]), $result); for( $i=0; $i { want_spam = yes; - apply "default" { + apply { CLAM_VIRUS = 1999.0; JUST_EICAR = 1999.0; actions { - reject = 999.0; + reject = null; } } - apply "default" { + apply { CLAM_VIRUS = -999.0; JUST_EICAR = -999.0; actions { greylist = ; - - = ; + "rewrite subject" = ; + "add header" = ; reject = ; } } - apply "default" { + apply { CLAM_VIRUS = ; JUST_EICAR = ; actions { greylist = ; - - = ; + "rewrite subject" = ; + "add header" = ; reject = ; } } diff --git a/server/conf/rspamd_wblist.inc.conf.master b/server/conf/rspamd_wblist.inc.conf.master index fc06127eae..aaa7d06f67 100644 --- a/server/conf/rspamd_wblist.inc.conf.master +++ b/server/conf/rspamd_wblist.inc.conf.master @@ -4,14 +4,22 @@ spamfilter_wblist- { rcpt = ""; want_spam = yes; + apply { + actions { + reject = null; + "add header" = null; + greylist = null; + "rewrite subject" = null; + } + } - apply "default" { + apply { R_DUMMY = 999.0; actions { reject = 0.2; - add_header = 0.1; + "add header" = 0.1; greylist = 0.1; - rewrite_subject = 0.1; + "rewrite subject" = 0.1; } } diff --git a/server/plugins-available/rspamd_plugin.inc.php b/server/plugins-available/rspamd_plugin.inc.php index 65f4522ba7..b6eddc401f 100644 --- a/server/plugins-available/rspamd_plugin.inc.php +++ b/server/plugins-available/rspamd_plugin.inc.php @@ -189,7 +189,8 @@ class rspamd_plugin { $tpl = new tpl(); $tpl->newTemplate('rspamd_wblist.inc.conf.master'); $tpl->setVar('record_id', intval($data['new']['wblist_id'])); - $tpl->setVar('priority', intval($data['new']['priority'])); + // we need to add 10 to priority to avoid mailbox/domain spamfilter settings overriding white/blacklists + $tpl->setVar('priority', intval($data['new']['priority']) + 10); $tpl->setVar('from', $app->functions->idn_encode($data['new']['email'])); $tpl->setVar('recipient', $app->functions->idn_encode($recipient['email'])); //$tpl->setVar('action', ($data['new']['wb'] == 'W'? 'want_spam = yes;' : 'action = "reject";')); -- GitLab