Mails still appear even though remote server sorted them as spam

Hi there!

I am running a Nextcloud Hub 6 (27.1.2) instance on Ubuntu 22.04 on a little NUC and I am trying the Mail app in version 3.4.2 .

When I open my inbox, the mail app shows messages that cannot be found (see below). It turns out that those are spam messages that have been sorted away by the server. The problem is, however, that Nextcloud mail still thinks that this mail should be there but does not get the idea to update the subscribed folder. I cannot do anything to these mails (can’t delete them) since they are not there.

What should I do? How can I make mail sync with the imap server more effectively?