Spam not learned when moving to spam folder

I have MaiB for several years. Now everything is upgraded to the latest versions.

I noticed in the past months that learning was not ok. When I checked the
sudo sa-learn --dump magic
I could not find any change when I moved an email to the spam folder…

Any idea on what may be wrong? Or what and how should I check the filters?

I really like MIAB, but Spam Handling is an absolute Pain.
I´ve ended up creating my own filter with a Sieve file.

In the Folder /etc/dovecot I´ve created the file “sieve-spam.sieve” with this code - works like a charm.

require ["regex", "fileinto", "imap4flags", "reject", "body", "mailbox"];


if address :domain  :matches "from" ["*fisteraser.de", "*freenet-mobilfunk.de", "*.br", "*.tr", "*.xyz", "*.jp", "*.ro", "*.click", "*.pl", "*.cn", "*.tk", "*.buzz", "*.top", "*.ga", "*.cf", "*.gq", "*.icu", "*.wang", "*.host", "*.ir", "*.mg", "*.au", "*.ca", "*.ltd", "*.pro", "*.ru", "*.mx", "*.id"]
    {
        reject "REJECTED";
	    stop;

    }

if header :contains "from" ["huusk", "tfbank", "servicekarte", "doktor", "freenet", "fisteraser", "comdirect", "lidl", "wholesale", "emura"]
    {
        reject "REJECTED";
	    stop;

    }

if header :contains "subject" ["info ", "spende", "invest", "info,", "$user_name$", "keto", "wachstum", "geld", "bersetz", " KI ", "prosta", "reich", "schuppe", "schlank", "dividend", "messer der welt", "apotheke", "sex"]
    {
        reject "REJECTED";
	    stop;

    }

#if body :content "text" :contains ["finds you well", "%User_Name%", "keto", "Achtung, info!", "finanzielle Probleme", "manneskraft", "antibiotika", "prostat", "stehkraft", "liebesleben", "wie es frueher noch der fall war", "schuppen", "erektion", "arznei", "diskret in den briefkasten", "appetit", "apotheke", "fitnes", "sex", "schmerzen", "unbehagen"]
#   {
#	    #reject "REJECTED"
#	    fileinto :create "Body Test";
#	    stop;
#    }

I have been trying to create a simple reject filter but it doesn’t seem to work.

require "reject";
# rule Encuentra24
if address :domain :matches  "from" "encuentra24.com"
{
        reject "REJECTED";
        stop;
}

What am i doing wrong? I have been testing this by sending emails from my work email and putting my work domain into the filter, but its not working.

Do I need to restart a service on the server?

I’m not sure if you need to reload dovecot if you create files like this.
However, perhaps it is easier to use the sieve filter editor that is built-in into Roundcube, the webmail UI?