From 86166df79e567dc6f272086dd768493b547d5024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Wed, 22 Apr 2026 15:19:40 +0200 Subject: [PATCH] sieve: Do not skip 'stop' when last action is 'discard' See: https://thsmi.github.io/sieve-reference/en/action/core/discard.html Fixes: https://github.com/root-fr/jmap-webmail/issues/67 --- lib/sieve/generator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sieve/generator.ts b/lib/sieve/generator.ts index 3ee02a1..9c142c1 100644 --- a/lib/sieve/generator.ts +++ b/lib/sieve/generator.ts @@ -152,7 +152,7 @@ export function generateScript(rules: FilterRule[]): string { if (rule.stopProcessing) { const lastAction = rule.actions[rule.actions.length - 1]; - if (!lastAction || !['stop', 'discard', 'reject'].includes(lastAction.type)) { + if (!lastAction || !['stop', 'reject'].includes(lastAction.type)) { actionLines.push('stop;'); } }