Foundry376/Mailspring · error
Could not find `inbox` label
Error message
Could not find `inbox` label
What it means
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).
Source
Thrown at app/src/mail-rules-processor.ts:125
if (!value) {
throw new Error('A label is required.');
}
const label = CategoryStore.byId(thread.accountId, value);
if (!label || !(label instanceof Label)) {
throw new Error('The label could not be found.');
}
return new ChangeLabelsTask({
labelsToAdd: [label],
labelsToRemove: [],
threads: [thread],
source: 'Mail Rules',
});
},
archive: (message, thread) => {
const inbox = CategoryStore.getInboxCategory(thread.accountId);
if (!inbox) {
throw new Error('Could not find `inbox` label');
}
return new ChangeLabelsTask({
labelsToAdd: [],
labelsToRemove: [inbox],
threads: [thread],
source: 'Mail Rules',
});
},
moveToLabel: async (message, thread, roleOrId) => {
if (!roleOrId) {
throw new Error('A label is required.');
}
const label = CategoryStore.categories(thread.accountId).find(
(c) => c.id === roleOrId || c.role === roleOrId
);
View on GitHub (pinned to 648c685d60)
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
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at app/src/mail-rules-processor.ts:125 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Foundry376/Mailspring@648c685d60 (2026-09-03).
Data as JSON: /api/errors/c32f4e6f1ba56597.
Report an issue: GitHub.