I'm runnig email server using Postfix, Dovecot, RoundCube and rspamd on Debian 11. Like everyone I have to deal with spam, but I got high demands for that.
Currently my rspamd is checking every incomming email and calculating spam score, if the score is higher than value (6 in my case) then it adds header X-Spam: Yes. After that it's Dovecot's Sieve filter turn. It checks header and if there is X-Spam: Yes then it moves email from INBOX to Junk folder.
Goal is to accept every email (no reject) and let user to choose what filter what he wants to use, global or individual.
Global filter should be used as default filter. I would like to with this filter move every email from blacklist domains go to Junk folder. Also I want to this filter be auto-learn, so if more users mark some similir emails as Junk, new rule will be added to this filter.
Individual filter should be blank at start so all emails go to INBOX. When user mark email as Junk, the sender's address will be add to blacklist so any furter email from same sender will automatically goes to Junk folder.
Is there any way how to do it? I can set up just one filter but I don't know how to create 2 filters, let users choose one of them and make Dovecot use it. I will be happy for any ideas.