idnits 2.17.1 draft-murchison-sieve-regex-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing document type: Expected "INTERNET-DRAFT" in the upper left hand corner of the first page ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** There are 7 instances of too long lines in the document, the longest one being 1 character in excess of 72. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 156: '... Implementations MUST support extended...' RFC 2119 keyword, line 162: '...expressions that MUST be supported. T...' Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (13 July 2000) is 8685 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Missing reference section? 'SIEVE' on line 242 looks like a reference -- Missing reference section? 'KEYWORDS' on line 239 looks like a reference Summary: 7 errors (**), 0 flaws (~~), 2 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Ken Murchison 3 Document: draft-murchison-sieve-regex-02.txt Oceana Matrix Ltd. 4 Expires January 18, 2001 13 July 2000 6 Sieve -- Regular Expression Extension 8 Status of this Memo 10 This document is an Internet-Draft and is in full conformance with 11 all provisions of Section 10 of RFC2026. Internet-Drafts are working 12 documents of the Internet Engineering Task Force (IETF), its areas, 13 and its working groups. Note that other groups may also distribute 14 working documents as Internet-Drafts. 16 Internet-Drafts are draft documents valid for a maximum of six months 17 and may be updated, replaced, or obsoleted by other documents at any 18 time. It is inappropriate to use Internet-Drafts as reference 19 material or to cite them other than as "work in progress." 21 The list of current Internet-Drafts can be accessed at 22 http://www.ietf.org/ietf/1id-abstracts.txt 24 To view the list Internet-Draft Shadow Directories, see 25 http://www.ietf.org/shadow.html. 27 Distribution of this memo is unlimited. 29 Copyright Notice 31 Copyright (C) The Internet Society 2000. All Rights Reserved. 33 Abstract 35 In some cases, it is desirable to have a string matching mechanism 36 which is more powerful than a simple exact match, a substring match 37 or a glob-style wildcard match. The regular expression matching 38 mechanism defined in this draft should allow users to isolate just 39 about any string or address in a message header or envelope. 41 Table of Contents 43 Status of this Memo . . . . . . . . . . . . . . . . . . . . . . . . 1 45 Copyright Notice . . . . . . . . . . . . . . . . . . . . . . . . . . 1 47 Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 49 0. Meta-information on this draft . . . . . . . . . . . . . . . 3 51 0.1. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 3 53 0.2. Noted Changes . . . . . . . . . . . . . . . . . . . . . . . . 3 55 0.2.1 since -01 . . . . . . . . . . . . . . . . . . . . . . . . . . 3 57 0.2.2 since -00 . . . . . . . . . . . . . . . . . . . . . . . . . . 3 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 61 2. Capability Identifier . . . . . . . . . . . . . . . . . . . . 4 63 3. Regex Match Type . . . . . . . . . . . . . . . . . . . . . . 4 65 4. Security Considerations . . . . . . . . . . . . . . . . . . . 6 67 5. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 6 69 6. Author's Address . . . . . . . . . . . . . . . . . . . . . . 6 71 Appendix A. References . . . . . . . . . . . . . . . . . . . . . . 6 73 Appendix B. Full Copyright Statement . . . . . . . . . . . . . . . 7 74 0. Meta-information on this draft 76 This information is intended to facilitate discussion. It will be 77 removed when this document leaves the Internet-Draft stage. 79 0.1. Discussion 81 This draft is intended to be an extension to the Sieve mail filtering 82 language, available from the Internet-Drafts repository as 83 84 (where 11 is the version number, which is actually currently 11). 86 This draft and the Sieve language itself are being discussed on the 87 MTA Filters mailing list at . Subscription 88 requests can be sent to (send an 89 email message with the word "subscribe" in the body). More 90 information on the mailing list along with a WWW archive of back 91 messages is available at . 93 0.2. Noted Changes 95 0.2.1 since -01 97 Added augmented MATCH-TYPE syntax element. 99 Editorial changes. 101 0.2.2 since -00 103 Added POSIX.2 ERE summary. 105 Added examples. 107 Editorial changes. 109 1. Introduction 111 This is an extension to the Sieve language defined by [SIEVE] for 112 comparing strings to regular expressions. 114 Conventions for notations are as in [SIEVE] section 1.1, including 115 use of [KEYWORDS]. 117 2. Capability Identifier 119 The capability string associated with the extension defined in this 120 document is "regex". 122 3. Regex Match Type 124 Commands that support matching may take the optional tagged argument 125 ":regex" to specify that a regular expression match should be 126 performed. The ":regex" match type is subject to the same rules and 127 restrictions as the standard match types defined in [SIEVE]. For 128 convenience, the "MATCH-TYPE" syntax element defined in [SIEVE] is 129 augmented here as follows: 131 MATCH-TYPE =/ ":regex" 133 Example: 135 require "regex"; 137 # Try to catch unsolicited email. 138 if anyof ( 139 # if a message is not to me (with optional +detail), 140 not address :regex ["to", "cc", "bcc"] 141 "me(\\+.*)?@company.com", 143 # or the subject contains 2 or more dollar signs, 144 header :regex "subject" "\\$\\$+", 146 # or the subject is all uppercase (no lowercase) 147 header :regex :comparator "i;octet" "subject" 148 "^[^:lower:]*$" ) { 150 discard; # junk it 151 } 153 The ":regex" match type is compatible with both the "i;octet" and 154 "i;ascii-casemap" comparators and may be used with them. 156 Implementations MUST support extended regular expressions (EREs) as 157 defined by [POSIX.2]. Any regular expression not defined by 158 [POSIX.2], including [POSIX.2] basic regular expressions, word 159 boundaries and backreferences are not supported by this extension. 161 The following table provides a brief summary of the regular 162 expressions that MUST be supported. This table is presented here 163 only as a guideline. [POSIX.2] should be used as the definitive 164 reference. 166 +------------+-----------------------------------------------------+ 167 | Expression | Pattern | 168 +------------+-----------------------------------------------------+ 169 | Items to match a single character | 170 +------------+-----------------------------------------------------+ 171 | . | Match any single character except newline. | 172 | [ ] | Bracket expression. Match any one of the enclosed | 173 | | characters. A hypen (-) indicates a range of | 174 | | consecutive characters. | 175 | [^ ] | Negated bracket expression. Match any one | 176 | | character NOT in the enclosed list. A hypen (-) | 177 | | indicates a range of consecutive characters. | 178 | \\ | Escape the following special character (match | 179 | | the literal character). Undefined for other | 180 | | characters. | 181 | | NOTE: Unlike [POSIX.2], a double-backslash is | 182 | | required as per section 2.4.2 of [SIEVE]. | 183 +------------+-----------------------------------------------------+ 184 | Items to be used within a bracket expression (localization) | 185 +------------+-----------------------------------------------------+ 186 | [: :] | Character class (alnum, alpha, blank, cntrl, | 187 | | digit, graph, lower, print, punct, space, | 188 | | upper, xdigit). | 189 | [= =] | Character equivalents. | 190 | [. .] | Collating sequence. | 191 +------------+-----------------------------------------------------+ 192 | Quantifiers - Items to count the preceding regular expression | 193 +------------+-----------------------------------------------------+ 194 | ? | Match zero or one instances. | 195 | * | Match zero or more instances. | 196 | + | Match one or more instances. | 197 | {n,m} | Match any number of instances between | 198 | | n and m (inclusive). {n} matches exactly n | 199 | | instances. {n,} matches n or more instances. | 200 +------------+-----------------------------------------------------+ 201 | Anchoring - Items to match positions | 202 +------------+-----------------------------------------------------+ 203 | ^ | Match the beginning of the line or string. | 204 | $ | Match the end of the line or string. | 205 +------------+-----------------------------------------------------+ 206 +------------+-----------------------------------------------------+ 207 | Expression | Pattern | 208 +------------+-----------------------------------------------------+ 209 | Other constructs | 210 +------------+-----------------------------------------------------+ 211 | | | Alternation. Match either of the separated | 212 | | regular expressions. | 213 | ( ) | Group the enclosed regular expression(s). | 214 +------------+-----------------------------------------------------+ 216 4. Security Considerations 218 Security considerations are discussed in [SIEVE]. It is believed 219 that this extension doesn't introduce any additional security 220 concerns. 222 5. Acknowledgments 224 Thanks to Tim Showalter, Alexey Melnikov and Tony Hansen for help 225 with this document. 227 6. Author's Address 229 Ken Murchison 230 Oceana Matrix Ltd. 231 21 Princeton Place 232 Orchard Park, NY 14127 234 Phone: (716) 662-8973 235 EMail: ken@oceana.com 237 Appendix A. References 239 [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate 240 Requirement Levels", Harvard University, RFC 2119, March, 1997. 242 [SIEVE] Showalter, T., "Sieve: A Mail Filtering Language", Mira- 243 point, Inc., Work In Progress. 245 [POSIX.2], "Portable Operating System Interface (POSIX). Part 2, 246 Shell and utilities", National Institute of Standards and Tech- 247 nology (U.S.). 249 Appendix B. Full Copyright Statement 251 Copyright (C) The Internet Society 2000. All Rights Reserved. 253 This document and translations of it may be copied and furnished to 254 others, and derivative works that comment on or otherwise explain it 255 or assist in its implementation may be prepared, copied, published 256 and distributed, in whole or in part, without restriction of any 257 kind, provided that the above copyright notice and this paragraph 258 are included on all such copies and derivative works. However, this 259 document itself may not be modified in any way, such as by removing 260 the copyright notice or references to the Internet Society or other 261 Internet organizations, except as needed for the purpose of develop- 262 ing Internet standards in which case the procedures for copyrights 263 defined in the Internet Standards process must be followed, or as 264 required to translate it into languages other than English. 266 The limited permissions granted above are perpetual and will not be 267 revoked by the Internet Society or its successors or assigns. 269 This document and the information contained herein is provided on an 270 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 271 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 272 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 273 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 274 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.