Hello,
when my users delete mail instead of moving it to spam the spam filtering mark it as non spam. Is ther a way to modify the sample and make it spam instead? Furthermore if i move it to the spam folder of my user but the spam mail was deliverd to a group the spam sample isn’t created.
What could be done to adress those issues?
Deleting a message is different from marking it spam, and Stalwart’s classifier training is driven specifically by moving messages into/out of the Junk Mail folder or by setting/removing the $Junk IMAP flag, not by deletion. If your users just delete spam instead of moving it to Junk, no training sample (or the wrong kind) gets created, and that’s the root cause of the misclassification you’re seeing.
To fix mislabeled entries: training samples are stored as individual SpamTrainingSample objects, visible in the WebUI under Account › Spam Samples. Each sample has an isSpam boolean, but it’s marked read-only once created, so you can’t simply flip it. The supported fix is to destroy the incorrectly-labelled sample and, ideally, have the user re-file the message correctly (move it to Junk / tag $Junk) so a properly-labelled sample is generated automatically. This can also be done via the JMAP x:SpamTrainingSample/set method (destroy + the user re-tagging the message), documented at:
As for shared/group mailboxes, the docs describe training samples as tied to an accountId and generated from user interaction with their own mailbox, but they don’t document specific behavior for messages delivered to a group and then moved to Junk in an individual member’s folder. This isn’t covered in the current docs. A community member or staff member will follow up on that part.
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.