Files
jcoffey-dev 136fc2540b
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 7m45s
Sieve playground: the server's interpreter in the browser
tools/sieve-playground builds the vendored sieve-rs 0.7.3 (vnd.inbuxa.*
names included) to WebAssembly, with a static page around it, for inbuxa
Admin's Debug button on a Sieve script: until now that button sent the
script to an outside site whose interpreter knows only upstream's
extension names, so any script that requires vnd.inbuxa.* failed to
compile there.

Ported from the playground in the upstream sieve-rs repository's web/
directory (commit 549a2d57f7), which targets sieve-rs 1.x:

- run.rs and handler.rs drive 0.7's event loop the way the server's
  delivery does, carrying on after a runtime error; llm_prompt compiles
  and answers false, as on a server without a model.
- The expression functions are the server's own modules, included by
  path; tests fail if the list, ApplyString or the few functions copied
  from misc.rs/unicode.rs stop matching crates/common.
- Built for wasm32-wasip1 rather than with wasm-bindgen: sieve-rs and
  mail-builder read the clock, which panics on wasm32-unknown-unknown.
  The page's worker answers the six WASI calls, giving the module the
  playground's current-time setting. shim/gethostname stands in for a
  crate with no WASI build. Nothing in vendor/ or crates/ changes.
- The page carries no upstream names or links; storage keys and the
  samples are renamed to match.

build.sh --admin <dir> stages the result into an inbuxa-admin checkout.
2026-10-09 01:13:53 -07:00

56 lines
2.0 KiB
JSON

[
{
"id": "welcome",
"title": "Welcome tour",
"description": "Duplicates, spam, lists, flags, MIME footers and vacation in one script.",
"scripts": [{ "name": "main", "file": "welcome.sieve" }],
"messages": [{ "name": "q3-report.eml", "file": "welcome.eml" }]
},
{
"id": "lists",
"title": "Mailing lists",
"description": "Regex captures, body tests and plus addressing.",
"scripts": [{ "name": "main", "file": "lists.sieve" }],
"messages": [{ "name": "announcement.eml", "file": "lists.eml" }]
},
{
"id": "spam",
"title": "Spam and viruses",
"description": "spamtest, virustest, reject and discard driven by the scores in Settings.",
"scripts": [{ "name": "main", "file": "spam.sieve" }],
"messages": [{ "name": "lottery.eml", "file": "spam.eml" }],
"settings": { "spamScore": 6 }
},
{
"id": "vacation",
"title": "Out of office",
"description": "Vacation replies with date windows and auto-reply safeguards.",
"scripts": [{ "name": "main", "file": "vacation.sieve" }],
"messages": [{ "name": "lunch.eml", "file": "vacation.eml" }]
},
{
"id": "forward",
"title": "Redirect and notify",
"description": "redirect :copy with DSN options, enotify and editheader.",
"scripts": [{ "name": "main", "file": "forward.sieve" }],
"messages": [{ "name": "invoice.eml", "file": "forward.eml" }]
},
{
"id": "include",
"title": "Includes",
"description": "Split a filter across scripts with include and global variables.",
"scripts": [
{ "name": "main", "file": "include-main.sieve" },
{ "name": "common", "file": "include-common.sieve" }
],
"messages": [{ "name": "outage.eml", "file": "include.eml" }]
},
{
"id": "expressions",
"title": "Expressions and loops",
"description": "The vnd.inbuxa.expressions and vnd.inbuxa.while extensions: let, eval, loops and built-in functions.",
"scripts": [{ "name": "main", "file": "expressions.sieve" }],
"messages": [{ "name": "meeting.eml", "file": "expressions.eml" }]
}
]