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.
29 lines
840 B
Sieve
29 lines
840 B
Sieve
# Quarantine spam and viruses
|
|
#
|
|
# The spam and virus scores come from Settings (Spam and virus). Try
|
|
# changing them and running the script again.
|
|
|
|
require ["spamtest", "spamtestplus", "virustest", "relational",
|
|
"comparator-i;ascii-numeric", "fileinto", "mailbox", "special-use",
|
|
"imap4flags", "reject", "editheader", "variables"];
|
|
|
|
if virustest :value "eq" :comparator "i;ascii-numeric" "5" {
|
|
reject "Message rejected: a virus was detected.";
|
|
stop;
|
|
}
|
|
|
|
if spamtest :value "ge" :comparator "i;ascii-numeric" "8" {
|
|
discard;
|
|
stop;
|
|
}
|
|
|
|
set "score" "";
|
|
if spamtest :percent :value "ge" :comparator "i;ascii-numeric" "50" {
|
|
if spamtest :percent :matches "*" {
|
|
set "score" "${1}";
|
|
}
|
|
addheader "X-Spam-Score" "${score}%";
|
|
addflag "$Junk";
|
|
fileinto :specialuse "\\Junk" :create "Junk";
|
|
}
|