Foundry376/Mailspring · error

The folder could not be found.

Error message

The folder could not be found.

What it means

Mail-rule action guard (changeFolder): a folder value was provided, but CategoryStore.byId returned nothing or a non-Folder category (e.g. a Gmail Label) for the thread's account. The id stored in the rule no longer resolves — the folder was deleted or belongs to a different account.

Source

Thrown at app/src/mail-rules-processor.ts:97

    });
  },

  forward: (message, thread, value) => {
    Actions.composeAndSendForward({
      thread: thread,
      message: message,
      to: [new Contact({ email: value })],
    });
    return undefined;
  },

  changeFolder: async (message, thread, value) => {
    if (!value) {
      throw new Error('A folder is required.');
    }
    const folder = CategoryStore.byId(thread.accountId, value);
    if (!folder || !(folder instanceof Folder)) {
      throw new Error('The folder could not be found.');
    }
    return new ChangeFolderTask({
      folder: folder,
      threads: [thread],
      source: 'Mail Rules',
    });
  },

  applyLabel: async (message, thread, value) => {
    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],

View on GitHub (pinned to 648c685d60)

Solutions

  1. Re-select a valid folder in the mail rule editor
  2. Delete the stale rule if the folder was intentionally removed
  3. Validate stored folder ids against the account when rules load and flag broken ones
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at app/src/mail-rules-processor.ts:97 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/f81f88b9f8bdb2f8. Report an issue: GitHub.