Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
I
ISPConfig 3
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 504
    • Issues 504
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 28
    • Merge Requests 28
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #5543

Closed (duplicated)
Open
Created Feb 26, 2020 by Sergio@Cambra

Changing tag method in policy is not applied to spamfilter users

short description

When I change rspamd_spam_tag_method in spamfilter policy, files in /etc/rspamd/local.d/users/ are regenerated. However old value for rspamd_spam_tag_method is used, so nothing changes. For example, policy has rewrite_subject value, and file in users directory has "rewrite subject" line, when I change to add_header, I still see "rewrite subject" line. If I change policy in spamfilter_user and change it back, then right rspamd_spam_tag_method is used.

correct behaviour

It should change to use new value for rspamd_spam_tag_method, i.e., if add_header is selected "add header" line should be in /etc/rspamd/local.d/users/ file

environment

Server OS: Debian Server OS version: buster ISPConfig version: 3.1.15p2

proposed fix

I think spamfilter_policy change should be saved to datalog before spamfilter_users. Spamfilter_users are saved in onAfterUpdate callback, and onUpdate saves spamfilter_policy to datalog after calling onAfterUpdate, so spamfilter_users are regenerated with old policy settings, then policy is updated.

I don't know if it's possible to move onAfterUpdate line after datalogSave line, in tform_actions class, so I have added a line to onAfterUpdate callback saving policy to datalog first.

                         if(is_array($spamfilter_users) && !empty($spamfilter_users)){
+                                $app->tform->datalogSave('UPDATE', $this->id, $this->oldDataRecord, $app->tform->getDataRecord($this->id));
                                 foreach($spamfilter_users as $spamfilter_user){

I don't create merge request becuase I'm not sure if it's the best way to fix this.

Assignee
Assign to
3.2.3
Milestone
3.2.3
Assign milestone
Time tracking
None
Due date
None