The spamfilter of all users (that used it) is rewritten although only the policy name has been changed
Summary
The spamfilter is rewritten although only the policy name has been changed.
Is not a big problem at all but if there are a lot of users than the system rewrites a lot of config files.
Steps to reproduce
- change only the name of a spamfilter policy than all spamfilter users of this filter get new config
Correct behaviour
don't rewrite the spamfilter config of every user of this spamfilter policy if only policy_name got changed.
I don't think the policy_name is used anywhere on the server side - only in the interface.
Environment
Server OS + version: (Ubu 22.04)
ISPConfig version: (3.2.11p2)
Proposed fix
diff --git a/interface/web/mail/spamfilter_policy_edit.php b/interface/web/mail/spamfilter_policy_edit.php
--- a/interface/web/mail/spamfilter_policy_edit.php
+++ b/interface/web/mail/spamfilter_policy_edit.php (date 1709230118549)
@@ -93,7 +93,9 @@
function onAfterUpdate() {
$this->record_has_changed = false;
foreach($this->dataRecord as $key => $val) {
+ if ($key == 'policy_name') { continue; } // Don't trigger update of all spamfilter users if only policy_name is changed
if(isset($this->oldDataRecord[$key]) && @$this->oldDataRecord[$key] != $val) {
// Record has changed
$this->record_has_changed = true;
}
i ll send a MR