From 2b186910d5f6d0437403add932effc233b1b0dfd Mon Sep 17 00:00:00 2001 From: Linus Rath Date: Mon, 7 Sep 2026 22:34:47 +0200 Subject: [PATCH] fix: subscribe newly created mailboxes #951 --- lib/__tests__/jmap-mailbox-account.test.ts | 2 +- lib/jmap/client.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/__tests__/jmap-mailbox-account.test.ts b/lib/__tests__/jmap-mailbox-account.test.ts index ca667edf4..39fc3a130 100644 --- a/lib/__tests__/jmap-mailbox-account.test.ts +++ b/lib/__tests__/jmap-mailbox-account.test.ts @@ -56,7 +56,7 @@ describe('JMAP mailbox mutations use the requested account', () => { expect(captured[0][0]).toBe('Mailbox/set'); expect(captured[0][1].accountId).toBe('shared-account'); expect(Object.values(captured[0][1].create as Record)) - .toEqual([{ name: 'Child', parentId: 'parent-id' }]); + .toEqual([{ name: 'Child', parentId: 'parent-id', isSubscribed: true }]); expect(mailbox).toMatchObject({ id: 'created-mailbox', accountId: 'shared-account', diff --git a/lib/jmap/client.ts b/lib/jmap/client.ts index 6458e0163..ccb8d4b35 100644 --- a/lib/jmap/client.ts +++ b/lib/jmap/client.ts @@ -2691,7 +2691,10 @@ export class JMAPClient implements IJMAPClient { async createMailbox(name: string, parentId?: string, accountId?: string): Promise { const targetAccountId = accountId || this.accountId; const createId = `new-${Date.now()}`; - const createData: Record = { name }; + // Subscribe explicitly: IMAP clients that list folders via LSUB + // (Thunderbird) hide unsubscribed mailboxes, and the server default is + // not guaranteed to be true. (#951) + const createData: Record = { name, isSubscribed: true }; if (parentId) { createData.parentId = parentId; }