Foundry376/Mailspring · error
${action.templateKey} is not a supported action.
Error message
${action.templateKey} is not a supported action. What it means
Guard in _applyRuleToMessage: a rule action's templateKey is not present in the supported action template map (Actions loaded from the ActionTemplates registry). Occurs when a rule was created by an older/newer Mailspring version or a plugin that defined actions that no longer exist, or the stored rule data is corrupt.
Source
Thrown at app/src/mail-rules-processor.ts:239
const templateMap = this._getConditionTemplateMap();
return fn.call(rule.conditions, (condition) => {
const template = templateMap.get(condition.templateKey);
if (!template) {
console.warn(`Unknown mail rule condition template: ${condition.templateKey}`);
return false;
}
const value = template.valueForMessage(message);
return template.evaluate(condition, value);
});
}
async _applyRuleToMessage(rule: MailRule, message: Message, thread: Thread) {
try {
const actionPromises = rule.actions.map((action) => {
const actionFn = MailRulesActions[action.templateKey];
if (!actionFn) {
throw new Error(`${action.templateKey} is not a supported action.`);
}
return actionFn(message, thread, action.value);
});
const actionResults = await Promise.all<Task | undefined>(actionPromises);
const actionTasks = actionResults.filter((r) => r instanceof Task);
// mark that none of these tasks are undoable
actionTasks.forEach((t) => {
(t as any).canBeUndone = false;
});
const performLocalPromises = actionTasks.map((t) => TaskQueue.waitForPerformLocal(t));
Actions.queueTasks(actionTasks);
await performLocalPromises;
} catch (err) {
// Errors can occur if a mail rule specifies an invalid label or folder, etc.
// Disable the rule. Disable the mail rule so the failure is reflected in theView on GitHub (pinned to 648c685d60)
Solutions
- Open the rule in Preferences > Mail Rules and re-pick the action
- Update Mailspring to a version that supports the action
- Delete the obsolete rule; the error aborts processing of this message by the rule
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at app/src/mail-rules-processor.ts:239 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/0f5344417e943d08.
Report an issue: GitHub.