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>
13 <h1>CodeMirror: Sieve (RFC5228) mode</h1>
14 <form><textarea id="code" name="code">
16 # Example Sieve Filter
17 # Declare any optional features or extension used by the script
20 require ["fileinto", "reject"];
23 # Reject any large messages (note that the four leading dots get
29 Please do not send me large attachments.
30 Put your file on a server and send me the URL.
39 # Handle messages from known mailing lists
40 # Move messages from IETF filter discussion list to filter folder
42 if header :is "Sender" "owner-ietf-mta-filters@imc.org"
44 fileinto "filter"; # move to "filter" folder
47 # Keep all messages to or from people in my company
49 elsif address :domain :is ["From", "To"] "example.com"
51 keep; # keep in "In" folder
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.
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*"])
63 # If message header does not contain my address,
65 fileinto "spam"; # move to "spam" folder
69 # Move all other (non-company) mail to "personal"
75 var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
78 <p><strong>MIME types defined:</strong> <code>application/sieve</code>.</p>