?? rfc3028.txt
字號:
Syntax: not <test> The "not" test takes some other test as an argument, and yields the opposite result. "not false" evaluates to "true" and "not true" evaluates to "false".5.9. Test size Syntax: size <":over" / ":under"> <limit: number> The "size" test deals with the size of a message. It takes either a tagged argument of ":over" or ":under", followed by a number representing the size of the message. If the argument is ":over", and the size of the message is greater than the number provided, the test is true; otherwise, it is false. If the argument is ":under", and the size of the message is less than the number provided, the test is true; otherwise, it is false. Exactly one of ":over" or ":under" must be specified, and anything else is an error. The size of a message is defined to be the number of octets from the initial header until the last character in the message body. Note that for a message that is exactly 4,000 octets, the message is neither ":over" 4000 octets or ":under" 4000 octets.5.10. Test true Syntax: true The "true" test always evaluates to true.6. Extensibility New control structures, actions, and tests can be added to the language. Sites must make these features known to their users; this document does not define a way to discover the list of extensions supported by the server.Showalter Standards Track [Page 26]RFC 3028 Sieve: A Mail Filtering Language January 2001 Any extensions to this language MUST define a capability string that uniquely identifies that extension. If a new version of an extension changes the functionality of a previously defined extension, it MUST use a different name. In a situation where there is a submission protocol and an extension advertisement mechanism aware of the details of this language, scripts submitted can be checked against the mail server to prevent use of an extension that the server does not support. Extensions MUST state how they interact with constraints defined in section 2.10, e.g., whether they cancel the implicit keep, and which actions they are compatible and incompatible with.6.1. Capability String Capability strings are typically short strings describing what capabilities are supported by the server. Capability strings beginning with "vnd." represent vendor-defined extensions. Such extensions are not defined by Internet standards or RFCs, but are still registered with IANA in order to prevent conflicts. Extensions starting with "vnd." SHOULD be followed by the name of the vendor and product, such as "vnd.acme.rocket-sled". The following capability strings are defined by this document: envelope The string "envelope" indicates that the implementation supports the "envelope" command. fileinto The string "fileinto" indicates that the implementation supports the "fileinto" command. reject The string "reject" indicates that the implementation supports the "reject" command. comparator- The string "comparator-elbonia" is provided if the implementation supports the "elbonia" comparator. Therefore, all implementations have at least the "comparator-i;octet" and "comparator-i;ascii-casemap" capabilities. However, these comparators may be used without being declared with require.Showalter Standards Track [Page 27]RFC 3028 Sieve: A Mail Filtering Language January 20016.2. IANA Considerations In order to provide a standard set of extensions, a registry is provided by IANA. Capability names may be registered on a first- come, first-served basis. Extensions designed for interoperable use SHOULD be defined as standards track or IESG approved experimental RFCs.6.2.1. Template for Capability Registrations The following template is to be used for registering new Sieve extensions with IANA. To: iana@iana.org Subject: Registration of new Sieve extension Capability name: Capability keyword: Capability arguments: Standards Track/IESG-approved experimental RFC number: Person and email address to contact for further information:6.2.2. Initial Capability Registrations The following are to be added to the IANA registry for Sieve extensions as the initial contents of the capability registry. Capability name: fileinto Capability keyword: fileinto Capability arguments: fileinto <folder: string> Standards Track/IESG-approved experimental RFC number: RFC 3028 (Sieve base spec) Person and email address to contact for further information: Tim Showalter tjs@mirapoint.com Capability name: reject Capability keyword: reject Capability arguments: reject <reason: string> Standards Track/IESG-approved experimental RFC number: RFC 3028 (Sieve base spec) Person and email address to contact for further information: Tim Showalter tjs@mirapoint.comShowalter Standards Track [Page 28]RFC 3028 Sieve: A Mail Filtering Language January 2001 Capability name: envelope Capability keyword: envelope Capability arguments: envelope [COMPARATOR] [ADDRESS-PART] [MATCH-TYPE] <envelope-part: string-list> <key-list: string-list> Standards Track/IESG-approved experimental RFC number: RFC 3028 (Sieve base spec) Person and email address to contact for further information: Tim Showalter tjs@mirapoint.com Capability name: comparator-* Capability keyword: comparator-* (anything starting with "comparator-") Capability arguments: (none) Standards Track/IESG-approved experimental RFC number: RFC 3028, Sieve, by reference of RFC 2244, Application Configuration Access Protocol Person and email address to contact for further information: Tim Showalter tjs@mirapoint.com6.3. Capability Transport As the range of mail systems that this document is intended to apply to is quite varied, a method of advertising which capabilities an implementation supports is difficult due to the wide range of possible implementations. Such a mechanism, however, should have property that the implementation can advertise the complete set of extensions that it supports.7. Transmission The MIME type for a Sieve script is "application/sieve". The registration of this type for RFC 2048 requirements is as follows: Subject: Registration of MIME media type application/sieve MIME media type name: application MIME subtype name: sieve Required parameters: none Optional parameters: none Encoding considerations: Most sieve scripts will be textual, written in UTF-8. When non-7bit characters are used, quoted-printable is appropriate for transport systems that require 7bit encoding.Showalter Standards Track [Page 29]RFC 3028 Sieve: A Mail Filtering Language January 2001 Security considerations: Discussed in section 10 of RFC 3028. Interoperability considerations: Discussed in section 2.10.5 of RFC 3028. Published specification: RFC 3028. Applications which use this media type: sieve-enabled mail servers Additional information: Magic number(s): File extension(s): .siv Macintosh File Type Code(s): Person & email address to contact for further information: See the discussion list at ietf-mta-filters@imc.org. Intended usage: COMMON Author/Change controller: See Author information in RFC 3028.8. Parsing The Sieve grammar is separated into tokens and a separate grammar as most programming languages are.8.1. Lexical Tokens Sieve scripts are encoded in UTF-8. The following assumes a valid UTF-8 encoding; special characters in Sieve scripts are all ASCII. The following are tokens in Sieve: - identifiers - tags - numbers - quoted strings - multi-line strings - other separators Blanks, horizontal tabs, CRLFs, and comments ("white space") are ignored except as they separate tokens. Some white space is required to separate otherwise adjacent tokens and in specific places in the multi-line strings. The other separators are single individual characters, and are mentioned explicitly in the grammar. The lexical structure of sieve is defined in the following BNF (as described in [ABNF]):Showalter Standards Track [Page 30]RFC 3028 Sieve: A Mail Filtering Language January 2001 bracket-comment = "/*" *(CHAR-NOT-STAR / ("*" CHAR-NOT-SLASH)) "*/" ;; No */ allowed inside a comment. ;; (No * is allowed unless it is the last character, ;; or unless it is followed by a character that isn't a ;; slash.) CHAR-NOT-DOT = (%x01-09 / %x0b-0c / %x0e-2d / %x2f-ff) ;; no dots, no CRLFs CHAR-NOT-CRLF = (%x01-09 / %x0b-0c / %x0e-ff) CHAR-NOT-SLASH = (%x00-57 / %x58-ff) CHAR-NOT-STAR = (%x00-51 / %x53-ff) comment = bracket-comment / hash-comment hash-comment = ( "#" *CHAR-NOT-CRLF CRLF ) identifier = (ALPHA / "_") *(ALPHA DIGIT "_") tag = ":" identifier number = 1*DIGIT [QUANTIFIER] QUANTIFIER = "K" / "M" / "G" quoted-string = DQUOTE *CHAR DQUOTE ;; in general, \ CHAR inside a string maps to CHAR ;; so \" maps to " and \\ maps to \ ;; note that newlines and other characters are all allowed ;; strings multi-line = "text:" *(SP / HTAB) (hash-comment / CRLF) *(multi-line-literal / multi-line-dotstuff) "." CRLF multi-line-literal = [CHAR-NOT-DOT *CHAR-NOT-CRLF] CRLF multi-line-dotstuff = "." 1*CHAR-NOT-CRLF CRLF ;; A line containing only "." ends the multi-line. ;; Remove a leading '.' if followed by another '.'. white-space = 1*(SP / CRLF / HTAB) / comment8.2. Grammar The following is the grammar of Sieve after it has been lexically interpreted. No white space or comments appear below. The start symbol is "start".Showalter Standards Track [Page 31]RFC 3028 Sieve: A Mail Filtering Language January 2001 argument = string-list / number / tag arguments = *argument [test / test-list] block = "{" commands "}" command = identifier arguments ( ";" / block ) commands = *command start = commands string = quoted-string / multi-line string-list = "[" string *("," string) "]" / string ;; if there is only a single string, the brackets are optional test = identifier arguments
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -