Commit bd8c3722 bd8c37225f29f412139d2487d8d2772defa6a351 by Sergey Poznyakoff

Fix indentation in Sieve scripts.

* sieve/examples/ex-1.10.2.sv: Use GNU indentation style
* sieve/examples/ex-2.3a.sv: Likewise.
* sieve/examples/ex-2.5.1.sv: Likewise.
* sieve/examples/ex-2.7.3.sv: Likewise.
* sieve/examples/ex-3.1a.sv: Likewise.
* sieve/examples/ex-3.1b.sv: Likewise.
* sieve/examples/ex-3.2.sv: Likewise.
* sieve/examples/ex-4.1.sv: Likewise.
* sieve/examples/ex-4.2.sv: Likewise.
* sieve/examples/ex-4.4a.sv: Likewise.
* sieve/examples/ex-4.4b.sv: Likewise.
* sieve/examples/ex-4.5.sv: Likewise.
* sieve/examples/ex-5.1.sv: Likewise.
* sieve/examples/ex-5.7.sv: Likewise.
* sieve/examples/ex-9.sv: Likewise.
* sieve/examples/ex-save-all.sv: Likewise.
* sieve/examples/example.sv: Likewise.
* sieve/examples/exn-5.4.sv: Likewise.
* sieve/examples/t-complex.sv: Likewise.
* sieve/examples/t-exists.sv: Likewise.
* sieve/examples/t-fileinto.sv: Likewise.
* sieve/examples/t-mailutils.sv: Likewise.
1 parent 5026f51b
1 if size :under 500K { 1 if size :under 500K
2 {
2 discard; 3 discard;
3 } 4 }
4 5
5 keep; 6 keep;
......
1 if size :over 550 { # this is a comment 1 if size :over 550 { # this is a comment
2 discard; 2 discard;
3 } 3 }
......
1 require "fileinto"; 1 require "fileinto";
2 2
3 if anyof ( 3 if anyof (
4 not exists ["From", "Date"], 4 not exists ["From", "Date"],
5 header :contains "from" "fool@example.edu" 5 header :contains "from" "fool@example.edu"
6 ) 6 )
7 { 7 {
8 discard; 8 discard;
9 } 9 }
10 if header :contains "from" "coyote" 10 if header :contains "from" "coyote"
11 { 11 {
12 fileinto "popbox"; # "pop://sam:passwed@fw"; 12 fileinto "popbox"; # "pop://sam:passwed@fw";
13 } 13 }
......
1 if header :contains :comparator "i;octet" "Subject" 1 if header :contains :comparator "i;octet" "Subject"
2 "MAKE MONEY FAST" { 2 "MAKE MONEY FAST"
3 {
3 discard; 4 discard;
4 } 5 }
5 6
......
1 require "fileinto"; 1 require "fileinto";
2 if header :contains "from" "coyote" { 2
3 if header :contains "from" "coyote"
4 {
3 discard; 5 discard;
4 } elsif header :contains ["subject"] ["$$$"] { 6 }
7 elsif header :contains ["subject"] ["$$$"]
8 {
5 discard; 9 discard;
6 } else { 10 }
11 else
12 {
7 fileinto "INBOX"; 13 fileinto "INBOX";
8 } 14 }
......
1 require [ "redirect" ]; 1 require [ "redirect" ];
2 2
3 if header :contains ["From"] ["coyote"] { 3 if header :contains ["From"] ["coyote"]
4 {
4 redirect "acm@example.edu"; 5 redirect "acm@example.edu";
5 } elsif header :contains "Subject" "$$$" { 6 }
7 elsif header :contains "Subject" "$$$"
8 {
6 redirect "postmaster@example.edu"; 9 redirect "postmaster@example.edu";
7 } else { 10 }
11 else
12 {
8 redirect "field@example.edu"; 13 redirect "field@example.edu";
9 } 14 }
......
1 require ["fileinto", "reject"]; 1 require ["fileinto", "reject"];
2 require "fileinto"; 2 require "fileinto";
3 # require "vacation"; 3 # require "vacation";
4 4
......
1 require "reject"; 1 require "reject";
2 2
3 if header :contains "from" "coyote@desert.example.org" { 3 if header :contains "from" "coyote@desert.example.org"
4 {
4 reject 5 reject
5 "I am not taking mail from you, and I don't want 6 "I am not taking mail from you, and I don't want
6 your birdseed, either!"; 7 your birdseed, either!";
7 } 8 }
8 9
......
1 require "fileinto"; 1 require "fileinto";
2 if header :contains ["from"] "coyote" { 2 if header :contains ["from"] "coyote"
3 {
3 fileinto "INBOX.harassment"; 4 fileinto "INBOX.harassment";
4 } 5 }
5 6
......
1 if size :under 1M { keep; } else { discard; } 1 if size :under 1M { keep; } else { discard; }
2 2
......
1 1 if not size :under 1M { discard; }
2 if not size :under 1M { discard; }
3 2
......
1 if header :contains ["from"] ["idiot@example.edu"] { 1 if header :contains ["from"] ["idiot@example.edu"]
2 {
2 discard; 3 discard;
3 } 4 }
......
1 if address :is :all "from" "tim@example.com" { 1 if address :is :all "from" "tim@example.com"
2 {
2 discard; 3 discard;
3 } 4 }
4 5
......
...@@ -3,11 +3,13 @@ ...@@ -3,11 +3,13 @@
3 3
4 # These should be true, then, and not affect the test mbox. 4 # These should be true, then, and not affect the test mbox.
5 5
6 if header :is ["X-Caffeine"] [""] { 6 if header :is ["X-Caffeine"] [""]
7 {
7 discard; 8 discard;
8 } 9 }
9 10
10 if not header :contains ["X-Caffeine"] [""] { 11 if not header :contains ["X-Caffeine"] [""]
12 {
11 discard; 13 discard;
12 } 14 }
13 15
......
...@@ -9,7 +9,7 @@ require ["fileinto", "reject"]; ...@@ -9,7 +9,7 @@ require ["fileinto", "reject"];
9 # "stuffed" to three) 9 # "stuffed" to three)
10 # 10 #
11 if size :over 1M 11 if size :over 1M
12 { 12 {
13 reject text: 13 reject text:
14 Please do not send me large attachments. 14 Please do not send me large attachments.
15 Put your file on a server and send me the URL. 15 Put your file on a server and send me the URL.
...@@ -18,22 +18,22 @@ Thank you. ...@@ -18,22 +18,22 @@ Thank you.
18 . 18 .
19 ; 19 ;
20 stop; 20 stop;
21 } 21 }
22 # 22 #
23 # Handle messages from known mailing lists 23 # Handle messages from known mailing lists
24 # Move messages from IETF filter discussion list to filter folder 24 # Move messages from IETF filter discussion list to filter folder
25 # 25 #
26 if header :is "Sender" "owner-ietf-mta-filters@imc.org" 26 if header :is "Sender" "owner-ietf-mta-filters@imc.org"
27 { 27 {
28 fileinto "filter"; # move to "filter" folder 28 fileinto "filter"; # move to "filter" folder
29 } 29 }
30 # 30 #
31 # Keep all messages to or from people in my company 31 # Keep all messages to or from people in my company
32 # 32 #
33 elsif address :domain :is ["From", "To"] "example.com" 33 elsif address :domain :is ["From", "To"] "example.com"
34 { 34 {
35 keep; # keep in "In" folder 35 keep; # keep in "In" folder
36 } 36 }
37 37
38 # 38 #
39 # Try and catch unsolicited email. If a message is not to me, 39 # Try and catch unsolicited email. If a message is not to me,
...@@ -45,15 +45,15 @@ elsif anyof ( ...@@ -45,15 +45,15 @@ elsif anyof (
45 header :matches 45 header :matches
46 "subject" ["*make*money*fast*", "*university*dipl*mas*"] 46 "subject" ["*make*money*fast*", "*university*dipl*mas*"]
47 ) 47 )
48 { 48 {
49 # If message header does not contain my address, 49 # If message header does not contain my address,
50 # it's from a list. 50 # it's from a list.
51 fileinto "spam"; # move to "spam" folder 51 fileinto "spam"; # move to "spam" folder
52 } 52 }
53 else 53 else
54 { 54 {
55 # Move all other (non-company) mail to "personal" 55 # Move all other (non-company) mail to "personal"
56 # folder. 56 # folder.
57 fileinto "personal"; 57 fileinto "personal";
58 } 58 }
59 59
......
1
2 require "fileinto"; 1 require "fileinto";
3 2
4 fileinto "./_save-all.mbox"; 3 fileinto "./_save-all.mbox";
......
1 # Example sieve script. 1 # Example sieve script.
2 2
3 require [ "fileinto", "redirect" ]; 3 require [ "fileinto", "redirect" ];
4 4
5 if size :over 20 { 5 if size :over 20
6 {
6 fileinto "/home/sam/p/gnu/mailutils/cmu-sieve/sv/inbox"; 7 fileinto "/home/sam/p/gnu/mailutils/cmu-sieve/sv/inbox";
7 } 8 }
8 9
9 if address :domain :is "to" "uwaterloo.ca" { 10 if address :domain :is "to" "uwaterloo.ca"
11 {
10 redirect "dom@is.uw"; 12 redirect "dom@is.uw";
11 } 13 }
12 14
13 if header :is "Status" "RO" { 15 if header :is "Status" "RO"
16 {
14 redirect "status@is.ro"; 17 redirect "status@is.ro";
15 } 18 }
16 19
17 keep; 20 keep;
18 21
......
1 require "envelope"; 1 require "envelope";
2 2
3 if envelope :all :is "from" "tim@example.com" { 3 if envelope :all :is "from" "tim@example.com"
4 {
4 discard; 5 discard;
5 } 6 }
......
...@@ -4,47 +4,47 @@ require [ "comparator-i;octet", "comparator-i;ascii-casemap" ]; ...@@ -4,47 +4,47 @@ require [ "comparator-i;octet", "comparator-i;ascii-casemap" ];
4 4
5 # Idiom to determine existence of a header. 5 # Idiom to determine existence of a header.
6 if header :contains [ "x-sweetheart", "x-unlikely" ] "" 6 if header :contains [ "x-sweetheart", "x-unlikely" ] ""
7 { 7 {
8 stop; 8 stop;
9 } 9 }
10 10
11 if header :is "return-PATH" "<>" 11 if header :is "return-PATH" "<>"
12 { 12 {
13 fileinto "mbox.complex.null-path"; 13 fileinto "mbox.complex.null-path";
14 } 14 }
15 15
16 if header :matches "newsgroups" "comp.os.*" 16 if header :matches "newsgroups" "comp.os.*"
17 { 17 {
18 fileinto "mbox.complex.news-comp-os"; 18 fileinto "mbox.complex.news-comp-os";
19 } 19 }
20 elsif exists "newsgroups" 20 elsif exists "newsgroups"
21 { 21 {
22 fileinto "mbox.complex.news"; 22 fileinto "mbox.complex.news";
23 } 23 }
24 24
25 if size :over 10000 25 if size :over 10000
26 { 26 {
27 fileinto "mbox.complex.large"; 27 fileinto "mbox.complex.large";
28 # redirect "root@microsoft.com"; 28 # redirect "root@microsoft.com";
29 } 29 }
30 elsif allof ( size :over 2000 , size :under 10000 ) 30 elsif allof ( size :over 2000 , size :under 10000 )
31 { 31 {
32 fileinto "mbox.complex.largeish"; 32 fileinto "mbox.complex.largeish";
33 } 33 }
34 elsif size :over 100 34 elsif size :over 100
35 { 35 {
36 fileinto "mbox.complex.smallish"; 36 fileinto "mbox.complex.smallish";
37 } 37 }
38 else 38 else
39 { 39 {
40 # Too small to bother reading. 40 # Too small to bother reading.
41 discard; 41 discard;
42 } 42 }
43 43
44 if exists "x-redirect" 44 if exists "x-redirect"
45 { 45 {
46 redirect "sroberts@uniserve.com"; 46 redirect "sroberts@uniserve.com";
47 } 47 }
48 48
49 # if header :contains ["to", "cc"] "bug-mailutils@gnu.org" 49 # if header :contains ["to", "cc"] "bug-mailutils@gnu.org"
50 # { 50 # {
......
1 if exists "X" 1 if exists "X"
2 { 2 {
3 keep; 3 keep;
4 } 4 }
5 5
......
...@@ -4,11 +4,11 @@ if allof( ...@@ -4,11 +4,11 @@ if allof(
4 size :over 10 , 4 size :over 10 ,
5 exists "x-caffeine" 5 exists "x-caffeine"
6 ) 6 )
7 { 7 {
8 fileinto "jetfuel"; 8 fileinto "jetfuel";
9 } 9 }
10 else 10 else
11 { 11 {
12 fileinto "decaf"; 12 fileinto "decaf";
13 } 13 }
14 14
......
1 require "fileinto"; 1 require "fileinto";
2 2
3 if header :contains ["to", "cc"] "bug-mailutils@gnu.org" 3 if header :contains ["to", "cc"] "bug-mailutils@gnu.org"
4 { 4 {
5 fileinto "=l.mailutils"; 5 fileinto "=l.mailutils";
6 } 6 }
7 7
......