diff options
Diffstat (limited to 'plugins/managesieve/tests')
-rw-r--r-- | plugins/managesieve/tests/src/parser.out | 2 | ||||
-rw-r--r-- | plugins/managesieve/tests/src/parser_date | 21 | ||||
-rw-r--r-- | plugins/managesieve/tests/src/parser_enotify_b | 2 | ||||
-rw-r--r-- | plugins/managesieve/tests/src/parser_index | 24 | ||||
-rw-r--r-- | plugins/managesieve/tests/src/parser_notify_b | 2 | ||||
-rw-r--r-- | plugins/managesieve/tests/src/parser_relational | 2 | ||||
-rw-r--r-- | plugins/managesieve/tests/src/parser_subaddress | 2 |
7 files changed, 50 insertions, 5 deletions
diff --git a/plugins/managesieve/tests/src/parser.out b/plugins/managesieve/tests/src/parser.out index 385c8890d..366515b06 100644 --- a/plugins/managesieve/tests/src/parser.out +++ b/plugins/managesieve/tests/src/parser.out @@ -1,4 +1,4 @@ -require ["fileinto","reject","envelope"]; +require ["envelope","fileinto","reject"]; # rule:[spam] if header :contains "X-DSPAM-Result" "Spam" { diff --git a/plugins/managesieve/tests/src/parser_date b/plugins/managesieve/tests/src/parser_date new file mode 100644 index 000000000..06b00333f --- /dev/null +++ b/plugins/managesieve/tests/src/parser_date @@ -0,0 +1,21 @@ +require ["comparator-i;ascii-numeric","date","fileinto","relational"]; +# rule:[date] +if allof (date :originalzone :value "ge" :comparator "i;ascii-numeric" "date" "hour" "09") +{ + fileinto "urgent"; +} +# rule:[date-weekday] +if date :is "received" "weekday" "0" +{ + fileinto "weekend"; +} +# rule:[date-zone] +if date :zone "-0500" :value "gt" :comparator "i;ascii-numeric" "received" "iso8601" "2007-02-26T09:00:00-05:00" +{ + stop; +} +# rule:[currentdate] +if anyof (currentdate :is "weekday" "0", currentdate :value "lt" :comparator "i;ascii-numeric" "hour" "09", currentdate :value "ge" :comparator "i;ascii-numeric" "date" "2007-06-30") +{ + stop; +} diff --git a/plugins/managesieve/tests/src/parser_enotify_b b/plugins/managesieve/tests/src/parser_enotify_b index 8854658f4..9a17eaf0c 100644 --- a/plugins/managesieve/tests/src/parser_enotify_b +++ b/plugins/managesieve/tests/src/parser_enotify_b @@ -1,4 +1,4 @@ -require ["envelope","variables","enotify"]; +require ["enotify","envelope","variables"]; # rule:[from] if envelope :all :matches "from" "*" { diff --git a/plugins/managesieve/tests/src/parser_index b/plugins/managesieve/tests/src/parser_index new file mode 100644 index 000000000..78aba9a55 --- /dev/null +++ b/plugins/managesieve/tests/src/parser_index @@ -0,0 +1,24 @@ +require ["comparator-i;ascii-numeric","date","fileinto","index","relational"]; +# rule:[index-header1] +if header :index 1 :last :contains "X-DSPAM-Result" "Spam" +{ + fileinto "Spam"; + stop; +} +# rule:[index-header2] +if header :index 2 :contains ["From","To"] "test@domain.tld" +{ + discard; + stop; +} +# rule:[index-address] +if address :index 1 :all :is "From" "nagios@domain.tld" +{ + fileinto "domain.tld"; + stop; +} +# rule:[index-date] +if date :index 1 :last :zone "-0500" :value "gt" :comparator "i;ascii-numeric" "received" "iso8601" "2007-02-26T09:00:00-05:00" +{ + stop; +} diff --git a/plugins/managesieve/tests/src/parser_notify_b b/plugins/managesieve/tests/src/parser_notify_b index cf80a9701..9a3ca803c 100644 --- a/plugins/managesieve/tests/src/parser_notify_b +++ b/plugins/managesieve/tests/src/parser_notify_b @@ -1,4 +1,4 @@ -require ["envelope","variables","notify"]; +require ["envelope","notify","variables"]; # rule:[from] if envelope :all :matches "from" "*" { diff --git a/plugins/managesieve/tests/src/parser_relational b/plugins/managesieve/tests/src/parser_relational index 0a92fde54..92c5e1a8e 100644 --- a/plugins/managesieve/tests/src/parser_relational +++ b/plugins/managesieve/tests/src/parser_relational @@ -1,4 +1,4 @@ -require ["relational","comparator-i;ascii-numeric"]; +require ["comparator-i;ascii-numeric","relational"]; # rule:[redirect] if header :value "ge" :comparator "i;ascii-numeric" "X-Spam-score" "14" { diff --git a/plugins/managesieve/tests/src/parser_subaddress b/plugins/managesieve/tests/src/parser_subaddress index f106b796e..e44555096 100644 --- a/plugins/managesieve/tests/src/parser_subaddress +++ b/plugins/managesieve/tests/src/parser_subaddress @@ -1,4 +1,4 @@ -require ["envelope","subaddress","fileinto"]; +require ["envelope","fileinto","subaddress"]; if envelope :user "To" "postmaster" { fileinto "postmaster"; |