Dashboard displays unread spam mails of junk folder as "unread"

I have just moved an unread message to the spam folder using the Nextcloud Mail app, but the dashboard still shows the message as unread.

How can I avoid this without first marking the message as read?

Dashboard 7.9.0 with Mail 3.6.1 on Nextcloud 29.

I dont think thatโ€™s configurable, and I donโ€™t think that messages that were moved to the spam folder are supposed to appear in any of the dashboard widgets, regardless of their read/unread status, so this is likely a bug. See also here: 3.4.0-rc.3 //27.1.0 RC2: Dashboard widgets show all mails ยท Issue #8849 ยท nextcloud/mail ยท GitHub

Yes, the mail dashboard should exclude the junk folder when checking for unread messages.