Rspamd is a widely used email and spam filtering solution. It consists of a set of rule-based filters, blacklists, greylisting, and also a self-learning Bayes filter. Sometimes, it might happen that the Bayes filter starts to behave oddly and flag the wrong emails. In such a case, you can either try to start passing the filter ham emails that ended up in spam to re-learn them. or you just reset the whole Bayes filter to start it learning from scratch again.
In this guide, I will show you how to reset the Bayes filter in Rspamd.
The Rspamd Bayes filter stores its tokens typically in a Redis database. To reset the Bayes filter, we will delete the tokes from the Redis database using these two commands:
redis-cli KEYS *BAYES* | xargs redis-cli DEL redis-cli KEYS RS* | xargs redis-cli DEL
This will remove all Rspamd Bayes filter data from Redis.