The Debug button on a Sieve script sent a copy to an outside site, whose interpreter knows only upstream's extension names: a script that requires vnd.inbuxa.expressions or vnd.inbuxa.while failed to compile there, and the button took admins to another project's site. The playground now ships inside the console and runs the server's own interpreter. sieve-playground/ is built by inbuxa-server's tools/sieve-playground (SOURCE.md names the commit); sieve-playground.ts copies it, with Monaco 0.52.2 from node_modules, into sieve-playground/<content hash>/ (the server caches every file but the console's index.html for good) and gives the console its path. The script stays on the console's origin, so the warning dialog before opening it is gone. Strings (en.json): sievepad.failed reworded, sievepad.debugHint added, the three warning-dialog strings removed. webui.zip grows from 1.3 MB to 3.4 MB: 0.9 MB of compressed WebAssembly, the rest Monaco's editor core.
35 lines
990 B
Sieve
35 lines
990 B
Sieve
# Sort mailing lists into folders
|
|
#
|
|
# Uses "regex" to pull the list name out of the List-Id header and
|
|
# "variables" to build the folder name. Messages that mention a keyword
|
|
# in the body are flagged, and replies to your own posts are marked read.
|
|
|
|
require ["fileinto", "mailbox", "imap4flags", "variables", "regex", "body",
|
|
"subaddress", "envelope"];
|
|
|
|
if header :regex "List-Id" "<([a-z0-9-]+)\\.([a-z0-9.-]+)>" {
|
|
set :lower "list" "${1}";
|
|
set :lower "host" "${2}";
|
|
|
|
if body :text :contains ["release", "security advisory"] {
|
|
addflag "\\Flagged";
|
|
}
|
|
|
|
if header :contains "In-Reply-To" "@example.org>" {
|
|
addflag "\\Seen";
|
|
}
|
|
|
|
fileinto :create "Lists/${host}/${list}";
|
|
stop;
|
|
}
|
|
|
|
# Plus addressing: mail sent to [email protected] goes to "shopping".
|
|
if envelope :detail :matches "to" "*" {
|
|
if string :is "${1}" "" {
|
|
keep;
|
|
} else {
|
|
set :lower "folder" "${1}";
|
|
fileinto :create "${folder}";
|
|
}
|
|
}
|