Rspamd User Config deleted on mail user changes
For some long time I noticed, that spam filter settings are sometimes not being applied properly and these days I took a look into it.
So what I found was, that ISPConfig was dropping existing /etc/rspamd/local.d/users/user_domain_tld.conf
files when something was changed in for the mail user.
Steps to reproduce
- Create a mail account and set a spam filter for it (the
normal
one will do it).- The config file in
/etc/rspamd/local.d/users/user_domain_tld.conf
should now exist.
- The config file in
- Now change something for the mail account
- The file should be deleted
- In order to get ISPConfig to write the config file again, just change something that triggers
spamfilter_user
inuser_settings_update()
function in the rspamd plugin.
I was able to fix this quick and dirty
for myself by adding && $type == 'spamfilter_user'
to the if in rspamd_plugin.inc.php#L284
My Setup:
- Ubuntu 22.04
- php 7.4.33
- rspamd 3.2-1~bionic