Fix: merge conflict
[myslice.git] / to-be-integrated / third-party / codemirror-3.15 / mode / sieve / index.html
1 <!doctype html>
2 <html>
3   <head>
4     <meta charset="utf-8">
5     <title>CodeMirror: Sieve (RFC5228) mode</title>
6     <link rel="stylesheet" href="../../doc/docs.css">
7     <link rel="stylesheet" href="../../lib/codemirror.css">
8     <script src="../../lib/codemirror.js"></script>
9     <script src="sieve.js"></script>
10     <style>.CodeMirror {background: #f8f8f8;}</style>
11   </head>
12   <body>
13     <h1>CodeMirror: Sieve (RFC5228) mode</h1>
14     <form><textarea id="code" name="code">
15 #
16 # Example Sieve Filter
17 # Declare any optional features or extension used by the script
18 #
19
20 require ["fileinto", "reject"];
21
22 #
23 # Reject any large messages (note that the four leading dots get
24 # "stuffed" to three)
25 #
26 if size :over 1M
27 {
28   reject text:
29 Please do not send me large attachments.
30 Put your file on a server and send me the URL.
31 Thank you.
32 .... Fred
33 .
34 ;
35   stop;
36 }
37
38 #
39 # Handle messages from known mailing lists
40 # Move messages from IETF filter discussion list to filter folder
41 #
42 if header :is "Sender" "owner-ietf-mta-filters@imc.org"
43 {
44   fileinto "filter";  # move to "filter" folder
45 }
46 #
47 # Keep all messages to or from people in my company
48 #
49 elsif address :domain :is ["From", "To"] "example.com"
50 {
51   keep;               # keep in "In" folder
52 }
53
54 #
55 # Try and catch unsolicited email.  If a message is not to me,
56 # or it contains a subject known to be spam, file it away.
57 #
58 elsif anyof (not address :all :contains
59                ["To", "Cc", "Bcc"] "me@example.com",
60              header :matches "subject"
61                ["*make*money*fast*", "*university*dipl*mas*"])
62 {
63   # If message header does not contain my address,
64   # it's from a list.
65   fileinto "spam";   # move to "spam" folder
66 }
67 else
68 {
69   # Move all other (non-company) mail to "personal"
70   # folder.
71   fileinto "personal";
72 }
73 </textarea></form>
74     <script>
75       var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
76     </script>
77
78     <p><strong>MIME types defined:</strong> <code>application/sieve</code>.</p>
79
80   </body>
81 </html>