# SIEVE script validation/testing/debugging options?

**URL:** https://support.stalw.art/t/sieve-script-validation-testing-debugging-options/1057
**Category:** Questions
**Created:** [July 14, 2026, 12:57pm UTC](https://support.stalw.art/t/sieve-script-validation-testing-debugging-options/1057 "2026-07-14T12:57:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hvjunk](https://support.stalw.art/user_avatar/support.stalw.art/hvjunk/32/259_2.png) [@hvjunk](https://support.stalw.art/u/hvjunk)
#### Post date: [July 14, 2026, 12:57pm UTC](https://support.stalw.art/t/sieve-script-validation-testing-debugging-options/1057/1 "2026-07-14T12:57:48Z")

</div>

### Your question

I’m looking for some method to check, and test and debug SIEVE scripts as my scripts are getting a tad more complex.  
Is there a way in Stalwart to test the execution of sieve scripts with sample input?  
What other SIEVE editor and debuggers are other using?

### I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

---

<div class="post-metadata">

### Author: ![helpbot](https://support.stalw.art/user_avatar/support.stalw.art/helpbot/32/13_2.png) [@helpbot](https://support.stalw.art/u/helpbot)
#### Post date: [July 14, 2026, 12:58pm UTC](https://support.stalw.art/t/sieve-script-validation-testing-debugging-options/1057/2 "2026-07-14T12:58:43Z")

</div>

This doesn’t mention any sandbox/test-run feature. Let me check if the CLI has a sieve test command or the WebUI has a testing tool, and check event logging for tracing.

I have enough grounded info now to answer.

Stalwart doesn’t ship a full sample-input sieve simulator, but it does provide syntax/validation checking and detailed runtime tracing you can use for debugging:

**Syntax validation without running against real mail**

- Over ManageSieve: use the `CHECKSCRIPT` command to validate a script’s syntax before saving it (returns `OK` or `NO` with an error).
- Over JMAP for Sieve (RFC 9661): the `SieveScript/validate` method checks a script without storing it.
- The WebUI’s Sieve script editor (under Settings › Sieve, both for user scripts and trusted/system scripts) calls this validation as you save, so syntax errors show up immediately.

**Debugging actual execution**  
There’s no “dry run with a sample email” feature, but Sieve execution emits detailed `sieve.*` trace events (e.g. `sieve.action-accept`, `sieve.action-reject`, `sieve.action-discard`, `sieve.send-message`, etc.) at `debug`/`info` level. If you set a [tracer](https://stalw.art/docs/telemetry/tracing/) level to `debug` or `trace`, you can watch exactly which Sieve actions fire as real messages flow through the trusted (SMTP) or untrusted (user) interpreter, which is the closest thing to a live debugger. See the full list of Sieve-related events at /docs/ref/events#sieve.

There is no third-party or bundled visual Sieve test/editor tool documented for Stalwart beyond the built-in WebUI editor and ManageSieve/JMAP validation; for building/testing scripts offline before upload, people generally rely on standard Sieve syntax checkers plus these validate endpoints.

Relevant docs: /docs/sieve/managesieve, /docs/sieve/jmap, /docs/ref/events (Sieve section), /docs/telemetry/tracing/

_This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong._

---

<div class="post-metadata">

### Author: ![stalwart](https://support.stalw.art/user_avatar/support.stalw.art/stalwart/32/12_2.png) [@stalwart](https://support.stalw.art/u/stalwart)
#### Post date: [July 19, 2026, 7:20am UTC](https://support.stalw.art/t/sieve-script-validation-testing-debugging-options/1057/3 "2026-07-19T07:20:02Z")

</div>

For syntax and compile validation there are a few options: a ManageSieve client’s CHECKSCRIPT against the server, or just saving via the WebUI or PUTSCRIPT, both of which reject a script that doesn’t compile. If you’re not already running a ManageSieve listener, enable one on port 4190 ([ManageSieve | Stalwart](https://stalw.art/docs/sieve/managesieve)).

There isn’t a built-in “run this script against a sample message” tester today, though. The practical approach is a throwaway test account: send crafted messages and watch what happens with tracing turned up, which shows you which rules and actions fired. Standard user scripts are ordinary RFC 5228 plus common extensions, so a generic Sieve editor will validate the syntax, but anything using Stalwart’s own expression extensions won’t validate in external tools.
