summaryrefslogtreecommitdiffstats
path: root/pigeonhole/examples/relational.rfc5231.sieve
diff options
context:
space:
mode:
Diffstat (limited to 'pigeonhole/examples/relational.rfc5231.sieve')
-rw-r--r--pigeonhole/examples/relational.rfc5231.sieve33
1 files changed, 33 insertions, 0 deletions
diff --git a/pigeonhole/examples/relational.rfc5231.sieve b/pigeonhole/examples/relational.rfc5231.sieve
new file mode 100644
index 0000000..81c66d3
--- /dev/null
+++ b/pigeonhole/examples/relational.rfc5231.sieve
@@ -0,0 +1,33 @@
+require ["relational", "comparator-i;ascii-numeric", "fileinto"];
+
+if header :value "lt" :comparator "i;ascii-numeric"
+ ["x-priority"] ["3"]
+{
+ fileinto "Priority";
+}
+
+elsif address :count "gt" :comparator "i;ascii-numeric"
+ ["to"] ["5"]
+{
+ # everything with more than 5 recipients in the "to" field
+ # is considered SPAM
+ fileinto "SPAM";
+}
+
+elsif address :value "gt" :all :comparator "i;ascii-casemap"
+ ["from"] ["M"]
+{
+ fileinto "From N-Z";
+} else {
+ fileinto "From A-M";
+}
+
+if allof (
+ address :count "eq" :comparator "i;ascii-numeric"
+ ["to", "cc"] ["1"] ,
+ address :all :comparator "i;ascii-casemap"
+ ["to", "cc"] ["me@foo.example.com"] )
+{
+ fileinto "Only me";
+}
+