Issue Description
A JMAP Email/set update that contains a full-object mailboxIds value identical to the message’s current mailboxes, together with any keyword change commits the message with IMAP uid: 0 in every mailbox it belongs to. Some JMAP clients emit exactly this shape during routine sync, so mail silently vanishes from IMAP clients while JMAP clients still show it.
Expected Behavior
A message whose mailbox set is unchanged keeps its existing IMAP UIDs; a keyword-only update never alters UID assignment. STATUS MESSAGES and SELECT EXISTS agree, and no message ever has UID 0.
Actual Behavior
The update reports success, but the message’s UID becomes 0 in all its mailboxes. Affected messages disappear from IMAP (SELECT/SEARCH/FETCH); multiple affected messages in one mailbox collapse into a single UID-0 entry, so SELECT EXISTS drops below STATUS MESSAGES. JMAP access is unaffected throughout.
Reproduction Steps
- APPEND two messages to an empty mailbox via IMAP.
- For each, send via JMAP (mailboxIds identical to current, plus a keyword change):
[“Email/set”, {“accountId”: “a”, “update”: {“Mxxx”: {
“mailboxIds”: {“”: true},
“keywords”: {“$seen”: true}
}}}] - Check the mailbox via IMAP: STATUS still reports 2 messages, SELECT reports EXISTS 1, UID SEARCH ALL returns only 0.
Relevant Log Output
Server logs show nothing, both updates are accepted and logged as normal successful changes. Client-side evidence:
before: STATUS (MESSAGES 2 UIDNEXT 18) | SELECT EXISTS: 2 | UID SEARCH ALL: 16 17
after: STATUS (MESSAGES 2 UIDNEXT 18) | SELECT EXISTS: 1 | UID SEARCH ALL: 0
Stalwart Version
v0.16.x
Installation Method
Binary (Linux)
Database Backend
PostgreSQL
Blob Storage
S3-compatible
Search Engine
PostgreSQL
Directory Backend
Internal
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on