summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/managesieve/Changelog1
-rw-r--r--plugins/managesieve/lib/rcube_sieve_script.php4
-rw-r--r--plugins/managesieve/tests/parser.phpt24
3 files changed, 25 insertions, 4 deletions
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index 185510410..a1fcd2268 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -1,4 +1,5 @@
- Fixed sorting of scripts, scripts including aware of the sort order
+- Fixed import of rules with unsupported tests
* version 5.0-beta [2011-10-17]
-----------------------------------------------------------
diff --git a/plugins/managesieve/lib/rcube_sieve_script.php b/plugins/managesieve/lib/rcube_sieve_script.php
index 3c6993dcc..155b40298 100644
--- a/plugins/managesieve/lib/rcube_sieve_script.php
+++ b/plugins/managesieve/lib/rcube_sieve_script.php
@@ -597,9 +597,7 @@ class rcube_sieve_script
}
// ...and actions block
- if ($tests) {
- $actions = $this->_parse_actions($content);
- }
+ $actions = $this->_parse_actions($content);
if ($tests && $actions) {
$result = array(
diff --git a/plugins/managesieve/tests/parser.phpt b/plugins/managesieve/tests/parser.phpt
index 308617296..32866335a 100644
--- a/plugins/managesieve/tests/parser.phpt
+++ b/plugins/managesieve/tests/parser.phpt
@@ -33,8 +33,19 @@ if anyof (true) /* comment
}
# rule:[reject]
if size :over 5000K {
- reject "Message over 5MB size limit. Please contact me before sending this.";
+ reject "Message over 5MB size limit. Please contact me before sending this.";
+}
+# rule:[false]
+if false # size :over 5000K
+{
+ stop; /* rule disabled */
+}
+# rule:[true]
+if true
+{
+ stop;
}
+fileinto "Test";
';
$s = new rcube_sieve_script($txt);
@@ -71,3 +82,14 @@ if size :over 5000K
{
reject "Message over 5MB size limit. Please contact me before sending this.";
}
+# rule:[false]
+if false # size :over 5000K
+{
+ stop;
+}
+# rule:[true]
+if true
+{
+ stop;
+}
+fileinto "Test";