summaryrefslogtreecommitdiff
path: root/tests/examplefiles
diff options
context:
space:
mode:
authorsblondon <sblondon@users.noreply.github.com>2020-01-04 17:08:42 +0100
committerMatthäus G. Chajdas <Anteru@users.noreply.github.com>2020-01-04 17:08:42 +0100
commit3b4a523858b94359da0e843ce8ccd5536228ac83 (patch)
treee57876122a008fc04ac7f46101d0e883d038e4b8 /tests/examplefiles
parent1547648c7d3381008137a5aea8558d3625acf87f (diff)
downloadpygments-git-3b4a523858b94359da0e843ce8ccd5536228ac83.tar.gz
Add Sieve lexer (#1257)
Add Sieve lexer
Diffstat (limited to 'tests/examplefiles')
-rw-r--r--tests/examplefiles/example.sieve56
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/examplefiles/example.sieve b/tests/examplefiles/example.sieve
new file mode 100644
index 00000000..8abed421
--- /dev/null
+++ b/tests/examplefiles/example.sieve
@@ -0,0 +1,56 @@
+# Based on examples included the RFC files.
+# It doesn't show cases for every token parsed by the lexer.
+
+require ["fileinto", "envelope"];
+
+if address :is "to" "demo@example.org" {
+ fileinto "demo-list";
+} elsif envelope :is "from" "owner@example.org" {
+ fileinto "lists.cipe";
+} elsif (exists "X-Cron-Env",
+ header :regex ["subject"] [".* A",
+ ".* B"]) {
+ addflag "Cron";
+ stop;
+} else {
+ keep;
+}
+
+if body :text :contains "project schedule" {
+ fileinto "project/schedule";
+}
+
+require "vacation";
+if header :contains "subject" "lunch" {
+ vacation :handle "ran-away" "I'm out and can't meet for lunch";
+} else {
+ vacation :handle "ran-away" "I'm out";
+}
+
+
+if virustest :value "eq" :comparator "i;ascii-numeric" "0" {
+ fileinto "Unscanned";
+ /* Infected with high probability (value range in 1-5) */
+}
+
+if envelope :detail "to" "spam"{
+ fileinto "Spam";
+}
+
+if size :over 100k {
+ discard;
+}
+elsif address :DOMAIN :is ["From", "To"] "example.com"
+{
+ keep;
+}
+
+require ["reject"];
+
+if size :over 1M {
+ reject text:
+Your message is too big. If you want to send me a big attachment,
+put it on a public web site and send me a URL.
+.
+;
+}