mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-10-31 00:12:39 +00:00
fix: subscribe newly created mailboxes #951
This commit is contained in:
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user