Email/query: inMailbox filter ignored when combined with keyword filters
#2916
Unanswered
DasBen
asked this question in
Issue Triage
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Disclosure: Yes the Issue was written with the help of AI, but its so much more structured 😉
Environment
urn:ietf:params:jmap:mail)Description
When using
Email/querywith aFilterConditionthat combinesinMailboxwith keyword filters (notKeyword,hasKeyword), theinMailboxcondition appears to be silently ignored. The query returns emails from all mailboxes instead of only the specified one.Per RFC 8621 §4.4.1, all properties in a single
FilterConditionobject should be implicitly ANDed together.Reproduction
Setup: An account with emails in multiple mailboxes — Inbox has 4 emails (all read), Junk has 6 emails (2 unread).
1.
inMailboxonly — works correctlyResult: 4 email IDs returned — all belong to Inbox. ✅
2.
inMailbox+notKeyword—inMailboxignoredResult: 2 email IDs returned, but fetching them via
Email/getreveals they belong to Junk Mail, not Inbox. ❌3. No folder filter +
notKeyword— same result as test 2Result: Same 2 email IDs as test 2 — confirming that
inMailboxwas ignored in test 2.4.
FilterOperatorAND — returns 0 resultsResult: 0 email IDs returned, even though test 1 confirms there are emails in Inbox. ❌
Expected Behavior
$seenkeyword (i.e., unread emails in Inbox only).FilterOperatorAND is the explicit form of combining conditions.Actual Behavior
inMailboxis ignored — query matches across all mailboxes, returning unread emails from Junk instead of Inbox.FilterOperatorAND returns 0 results instead of the correct intersection.The same behavior occurs with
hasKeyword(e.g. filtering for$flaggedwithin a specific mailbox).Impact
Any JMAP client filtering emails by keyword within a specific mailbox (e.g. "show unread in Inbox", "show starred in Sent") gets incorrect results. This is a very common operation for email clients.
Workaround
Query with
inMailboxonly, then filter by keywords client-side using thekeywordsproperty on the returnedEmailobjects.Beta Was this translation helpful? Give feedback.
All reactions