{"record":{"id":"c32f4e6f1ba56597","repo":"Foundry376/Mailspring","slug":"could-not-find-inbox-label","errorCode":null,"errorMessage":"Could not find `inbox` label","messagePattern":"Could not find `inbox` label","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/mail-rules-processor.ts","lineNumber":125,"sourceCode":"    if (!value) {\n      throw new Error('A label is required.');\n    }\n    const label = CategoryStore.byId(thread.accountId, value);\n    if (!label || !(label instanceof Label)) {\n      throw new Error('The label could not be found.');\n    }\n    return new ChangeLabelsTask({\n      labelsToAdd: [label],\n      labelsToRemove: [],\n      threads: [thread],\n      source: 'Mail Rules',\n    });\n  },\n\n  archive: (message, thread) => {\n    const inbox = CategoryStore.getInboxCategory(thread.accountId);\n    if (!inbox) {\n      throw new Error('Could not find `inbox` label');\n    }\n    return new ChangeLabelsTask({\n      labelsToAdd: [],\n      labelsToRemove: [inbox],\n      threads: [thread],\n      source: 'Mail Rules',\n    });\n  },\n\n  moveToLabel: async (message, thread, roleOrId) => {\n    if (!roleOrId) {\n      throw new Error('A label is required.');\n    }\n\n    const label = CategoryStore.categories(thread.accountId).find(\n      (c) => c.id === roleOrId || c.role === roleOrId\n    );\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/src/mail-rules-processor.ts#L107-L143","documentation":"The archive action requires the account's inbox category to move threads out of it, but CategoryStore.getInboxCategory returned null. Fires when the account's folder/label list has not synced yet, or the account has no recognizable inbox (rare/unusual IMAP folder layouts).","triggerScenarios":"Thrown at app/src/mail-rules-processor.ts:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for account sync to complete and retry","Verify the account has an inbox folder/label visible in the folder list","Remove or repair the archive mail rule if the account genuinely lacks an inbox"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"648c685d602ece6bb00c22534b8734de6ac644b3","analyzedAt":"2026-09-03T02:00:24.311Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}