2 Main test of script parser
6 include '../lib/rcube_sieve_script.php';
9 require ["fileinto","reject","envelope"];
11 if anyof (header :contains "X-DSPAM-Result" "Spam")
17 if anyof (header :comparator "i;ascii-casemap" :contains ["From","To"] "test@domain.tld")
23 if anyof (not header :comparator "i;octet" :contains ["Subject"] "[test]", header :contains "Subject" "[test2]")
29 if anyof (true) /* comment
30 * "comment" #comment */ {
36 reject "Message over 5MB size limit. Please contact me before sending this.";
39 if false # size :over 5000K
41 stop; /* rule disabled */
50 if address :all :is "From" "nagios@domain.tld"
52 fileinto "domain.tld";
55 # rule:[envelope test]
56 if envelope :domain :is "From" "domain.tld"
58 fileinto "domain.tld";
63 $s = new rcube_sieve_script($txt);
66 // -------------------------------------------------------------------------------
69 require ["fileinto","reject","envelope"];
71 if header :contains "X-DSPAM-Result" "Spam"
77 if header :contains ["From","To"] "test@domain.tld"
83 if anyof (not header :comparator "i;octet" :contains "Subject" "[test]", header :contains "Subject" "[test2]")
96 reject "Message over 5MB size limit. Please contact me before sending this.";
99 if false # size :over 5000K
109 # rule:[address test]
110 if address :all :is "From" "nagios@domain.tld"
112 fileinto "domain.tld";
115 # rule:[envelope test]
116 if envelope :domain :is "From" "domain.tld"
118 fileinto "domain.tld";