At first glance it seems that filtering works better with 4.10.1 but I found that mails which should not be move to the spam folder are moved to the spam folder. I selected the mails and tried to move the mails manually back in the inbox but it does not work. After droping them on the inbox the mails are deselected and reaper in the original folder in less than a second.
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present? If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.