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.
38 lines
1.3 KiB
Sieve
38 lines
1.3 KiB
Sieve
# Out of office with dates
|
|
#
|
|
# Replies only while the current date is inside the vacation window,
|
|
# never to mailing lists or automated senders, and at most once every
|
|
# three days per sender. Change the dates to see the reply disappear.
|
|
|
|
require ["vacation", "vacation-seconds", "date", "relational", "variables",
|
|
"envelope"];
|
|
|
|
set "subject" "";
|
|
if currentdate :value "ge" "date" "2026-01-01" {
|
|
if currentdate :value "le" "date" "2026-12-31" {
|
|
if not anyof (exists "List-Id",
|
|
header :contains "Precedence" ["bulk", "list", "junk"],
|
|
header :is "Auto-Submitted" ["auto-replied", "auto-generated"],
|
|
envelope :localpart :is "from" ["mailer-daemon", "noreply", "no-reply"]) {
|
|
if header :matches "Subject" "*" {
|
|
set "subject" "${1}";
|
|
}
|
|
vacation :days 3
|
|
:from "Jane Doe <[email protected]>"
|
|
:addresses ["[email protected]", "[email protected]"]
|
|
:subject "Out of office: ${subject}"
|
|
:handle "summer-vacation"
|
|
text:
|
|
Hello,
|
|
|
|
I am on vacation and will read your message about "${subject}" when
|
|
I am back. For urgent matters please contact [email protected].
|
|
|
|
Best regards,
|
|
Jane
|
|
.
|
|
;
|
|
}
|
|
}
|
|
}
|