summaryrefslogtreecommitdiffstats
path: root/pigeonhole/tests/extensions/enotify/execute/draft-rfc-ex1.sieve
diff options
context:
space:
mode:
Diffstat (limited to 'pigeonhole/tests/extensions/enotify/execute/draft-rfc-ex1.sieve')
-rw-r--r--pigeonhole/tests/extensions/enotify/execute/draft-rfc-ex1.sieve26
1 files changed, 26 insertions, 0 deletions
diff --git a/pigeonhole/tests/extensions/enotify/execute/draft-rfc-ex1.sieve b/pigeonhole/tests/extensions/enotify/execute/draft-rfc-ex1.sieve
new file mode 100644
index 0000000..6747d7b
--- /dev/null
+++ b/pigeonhole/tests/extensions/enotify/execute/draft-rfc-ex1.sieve
@@ -0,0 +1,26 @@
+require ["enotify", "fileinto", "variables"];
+
+if header :contains "from" "boss@example.org" {
+ notify :importance "1"
+ :message "This is probably very important"
+ "mailto:alm@example.com";
+ # Don't send any further notifications
+ stop;
+}
+
+if header :contains "to" "sievemailinglist@example.org" {
+ # :matches is used to get the value of the Subject header
+ if header :matches "Subject" "*" {
+ set "subject" "${1}";
+ }
+
+ # :matches is used to get the value of the From header
+ if header :matches "From" "*" {
+ set "from" "${1}";
+ }
+
+ notify :importance "3"
+ :message "[SIEVE] ${from}: ${subject}"
+ "mailto:alm@example.com";
+ fileinto "INBOX.sieve";
+}