The current test checks that an email is not in a mailbox, but this doesn't cover all the cases of the spec:
https://jmap.io/spec-mail.html#emailquery
inMailboxOtherThan: Id[] A list of Mailbox ids. An Email must be in at least one Mailbox not in this list to match the condition. This is to allow messages solely in trash/spam to be easily excluded from a search.
See my test case here: stalwartlabs/stalwart#2831