2 Main test of script parser
6 include '../lib/rcube_sieve_script.php';
9 require ["fileinto","vacation","reject","relational","comparator-i;ascii-numeric","imapflags"];
11 if anyof (header :contains "X-DSPAM-Result" "Spam")
17 if anyof (header :contains ["From","To"] "test@domain.tld")
23 if anyof (not header :contains ["Subject"] "[test]", header :contains "Subject" "[test2]")
28 # rule:[test-vacation]
29 if anyof (header :contains "Subject" "vacation")
31 vacation :days 1 text:
40 if anyof (true) /* comment
41 * "comment" #comment */ {
47 reject "Message over 5MB size limit. Please contact me before sending this.";
50 if header :value "ge" :comparator "i;ascii-numeric"
51 ["X-Spam-score"] ["14"] {redirect "test@test.tld";}
53 if header :matches "Subject" "^Test$" {
55 addflag ["\\\\Answered","\\\\Deleted"];
59 $s = new rcube_sieve_script($txt);
64 require ["fileinto","vacation","reject","relational","comparator-i;ascii-numeric","imapflags"];
66 if header :contains "X-DSPAM-Result" "Spam"
72 if header :contains ["From","To"] "test@domain.tld"
78 if anyof (not header :contains "Subject" "[test]", header :contains "Subject" "[test2]")
83 # rule:[test-vacation]
84 if header :contains "Subject" "vacation"
86 vacation :days 1 text:
102 reject "Message over 5MB size limit. Please contact me before sending this.";
105 if header :value "ge" :comparator "i;ascii-numeric" "X-Spam-score" "14"
107 redirect "test@test.tld";
110 if header :matches "Subject" "^Test$"
113 addflag ["\\Answered","\\Deleted"];