Backup your Redis data, then run:
redis-cli smembers BAYES_HAM_keys | while read -r PREFIX; do
if [ -n "$PREFIX" ]; then
redis-cli --scan --pattern "$PREFIX*" | xargs -r redis-cli unlink
fi
doneWhen learning multiple messages with rspamc learn_spam or rspamc learn_ham, Rspamd may learn more messages than it actually needs. For example:
rspamc learn_spam some_dir with a dir containing 1000 messagesInstead, if you learn some ham, then some spam, wait and repeat, then Rspamd won't need to learn all the messages, as some of them will already be classified as spam/ham with the already learned messages.