fix: subscribe newly created mailboxes #951

This commit is contained in:
Linus Rath
2026-09-07 22:34:47 +02:00
parent af234f64a4
commit 2b186910d5
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -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<string, unknown>))
.toEqual([{ name: 'Child', parentId: 'parent-id' }]);
.toEqual([{ name: 'Child', parentId: 'parent-id', isSubscribed: true }]);
expect(mailbox).toMatchObject({
id: 'created-mailbox',
accountId: 'shared-account',
+4 -1
View File
@@ -2691,7 +2691,10 @@ export class JMAPClient implements IJMAPClient {
async createMailbox(name: string, parentId?: string, accountId?: string): Promise<Mailbox> {
const targetAccountId = accountId || this.accountId;
const createId = `new-${Date.now()}`;
const createData: Record<string, unknown> = { 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<string, unknown> = { name, isSubscribed: true };
if (parentId) {
createData.parentId = parentId;
}