idnits 2.17.1 draft-hansen-sieve-loop-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 17. -- Found old boilerplate from RFC 3978, Section 5.5 on line 282. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 259. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 266. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 272. ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 3 instances of too long lines in the document, the longest one being 8 characters in excess of 72. == There are 3 instances of lines with non-RFC2606-compliant FQDNs in the document. 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 (October 23, 2005) is 6732 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) -- Looks like a reference, but probably isn't: 'COMPARATOR' on line 86 -- Looks like a reference, but probably isn't: 'MATCH-TYPE' on line 86 == Unused Reference: '2' is defined on line 223, but no explicit reference was found in the text == Unused Reference: '3' is defined on line 226, but no explicit reference was found in the text ** Obsolete normative reference: RFC 2822 (ref. '3') (Obsoleted by RFC 5322) ** Obsolete normative reference: RFC 3028 (ref. '4') (Obsoleted by RFC 5228, RFC 5429) Summary: 6 errors (**), 0 flaws (~~), 5 warnings (==), 10 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force T. Hansen 3 Internet-Draft AT&T Laboratories 4 Expires: April 26, 2006 C. Daboo 5 Cyrusoft International, Inc. 6 October 23, 2005 8 Sieve Extensions: MIME Bodypart Iteration, MIME Tests, Replacement and 9 Enclosure 10 draft-hansen-sieve-loop-01.txt 12 Status of this Memo 14 By submitting this Internet-Draft, each author represents that any 15 applicable patent or other IPR claims of which he or she is aware 16 have been or will be disclosed, and any of which he or she becomes 17 aware will be disclosed, in accordance with Section 6 of BCP 79. 19 Internet-Drafts are working documents of the Internet Engineering 20 Task Force (IETF), its areas, and its working groups. Note that 21 other groups may also distribute working documents as Internet- 22 Drafts. 24 Internet-Drafts are draft documents valid for a maximum of six months 25 and may be updated, replaced, or obsoleted by other documents at any 26 time. It is inappropriate to use Internet-Drafts as reference 27 material or to cite them other than as "work in progress." 29 The list of current Internet-Drafts can be accessed at 30 http://www.ietf.org/ietf/1id-abstracts.txt. 32 The list of Internet-Draft Shadow Directories can be accessed at 33 http://www.ietf.org/shadow.html. 35 This Internet-Draft will expire on April 26, 2006. 37 Copyright Notice 39 Copyright (C) The Internet Society (2005). 41 Abstract 43 The current Sieve language has no looping mechanism, a way to look at 44 individual MIME parts, or any way to manipulate those individual 45 parts. This document defines extensions for each of these needs. 47 Note 48 This document is being discussed in the MTA-FILTERS mailing lists, 49 ietf-mta-filters@imc.org. 51 1. Introduction 53 Sieve scripts are used to make decisions about the disposition of a 54 mail message. The original Sieve spec, [4], defined operators for 55 looking at the message headers, such as addresses and the subject. 56 Other extensions provide access to the body of the message, or allow 57 you to manipulate the header of the message. But none of these 58 extensions take into account that MIME messages ([1]) are often 59 complex objects, consisting of many parts and sub-parts. This 60 extension defines mechanisms for looping through the MIME body parts, 61 performing tests on each body part, changing the contents of a body 62 part, and enclosing the message with a wrapper. 64 2. Sieve Loops 66 The current Sieve language has no looping mechanism. Given that 67 messages may contain multiple attachments, in order to support 68 filters that apply to any and all attachments, we introduce a new 69 control command: "for.every.part", which is an iterator that walks 70 though every MIME part of a message, including nested parts, and 71 applies the specified block to each of them. The iterator will start 72 with the first MIME part (as its current context) and will execute a 73 command block (Sieve commands enclosed by { ...}). Upon completion 74 of this command block, the iterator advances to the next MIME part 75 (as its current context) and executes the same command block again. 77 The iterator can be terminated prematurely by a new sieve command, 78 "break". 80 Syntax: for.every.part block 82 Syntax: break; 84 3. Test "mime" 86 Syntax: mime [COMPARATOR] [MATCH-TYPE] 87 [] 89 Syntax: mime [:filename] ... 91 Syntax: mime [:type] ... 93 Syntax: mime [:subtype] ... 95 For Sieve tests on MIME parts, a new Sieve test ("mime") is defined. 96 Similar in concept to the Sieve "header" test, it will parse the MIME 97 header lines so that tests can be performed on specific elements. 99 If used within the context of a "for.every.part" iterator, the "mime" 100 test will examine the headers associated with the current MIME part 101 context. 103 If used outside the context of a "for.every.part" iterator, the 104 "mime" test will examine all MIME body parts and return true if any 105 of them satisfies the test. 107 The "mime" test has all of the options available from the header 108 test, [4] section 5.7. In addition, these options are available: 110 :filename examines the "Content-Disposition:" header field for its 111 "filename" parameter. If there is no "Content-Disposition:" 112 header field, then it will look at the "Content-Type:" header 113 field for the "name" parameter. 115 :type examines the "Content-Type:" header field type parameter. 117 :subtype examines the "Content-Type:" header field subtype parameter. 119 4. Action Replace 121 Syntax: replace string 123 A new sieve action command is defined to allow the MIME part to be 124 replaced by a text message. The "replace" command causes a MIME part 125 to be removed and replaced with a text/plain part with the text 126 supplied by the command. 128 When used in the context of a "for.every.part" loop, the MIME part to 129 be replaced is the "current" MIME part. If the current MIME context 130 is a multipart MIME part, the entire multipart MIME part is replaced. 131 (Replacing a non-multipart MIME part within a "for.every.part" loop 132 context does not alter the overall message structure.) 134 When used outside the context of a "for.every.part" loop, the MIME 135 part to be replaced is the entire message. 137 5. Action Enclose 139 Syntax: enclose <:subject string> <:headers string-list> string 141 A new sieve action command is defined to allow an entire message to 142 be enclosed as an attachment to a new message. This enclose action 143 takes precedance over all other message modifications, such as 144 "replace". If multiple "enclose" actions are executed by a script, 145 only the text specified on the last one is used when creating the 146 enclosed message. This action does not affect messages that are 147 forwarded via a "redirect" action. 149 Specifically, the original message becomes a multipart/mixed message 150 with two parts: a text/plain portion with the string argument as its 151 body, and a message/rfc822 portion with the original message 152 enclosed. The Content-Type: header field becomes multipart/mixed. 153 The Subject: header is specified by the :subject argument. Any 154 headers specified by :headers are copied from the old message into 155 the new message. 157 6. Sieve Capability Strings 159 A Sieve implementation that defines the "for.every.part" and "break" 160 actions will advertise the capability string "for.every.part". 162 A Sieve implementation that defines the "mime" test will advertise 163 the capability string "mime". 165 A Sieve implementation that defines the "replace" action will 166 advertise the capability string "replace". 168 A Sieve implementation that defines the "enclose" action will 169 advertise the capability string "enclose". 171 7. Examples 173 7.1. Example 1 175 A Sieve script to replace all the Windows executable attachments in a 176 message would be: 178 require [ "for.every.part", "mime", "replace" ]; 179 for.every.part { 180 if ( anyof ( mime :subtype :is "exe", mime :filename :matches "*.com" ) { 181 replace "Executable attachment removed by user filter"; 182 } 184 } 186 7.2. Example 2 188 A Sieve script to warn the user about executable attachment types 189 would be: 191 require [ "for.every.part", "mime", "enclose" ]; 193 for.every.part { 194 if mime :filename :matches ["*.com", "*.exe", "*.vbs", "*.scr", 195 "*.pif", "*.hta", "*.bat", "*.zip" ] { 196 # these attachment types are executable 197 enclose :subject "Warning" " 198 WARNING! The enclosed message contains executable attachments. 199 These attachments types may contain a computer virus program 200 that can infect your computer and potentently damage your data 202 Before clicking on these message attachments, you should verify with 203 the sender that this message was sent by them and not a computer virus. 204 "; 205 break; 206 } 207 } 209 8. Security Considerations 211 To be provided 213 9. IANA Considerations 215 To be provided 217 10. Normative References 219 [1] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 220 Extensions (MIME) Part One: Format of Internet Message Bodies", 221 RFC 2045, November 1996. 223 [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement 224 Levels", BCP 14, RFC 2119, March 1997. 226 [3] Resnick, P., "Internet Message Format", RFC 2822, April 2001. 228 [4] Showalter, T., "Sieve: A Mail Filtering Language", RFC 3028, 229 January 2001. 231 Authors' Addresses 233 Tony Hansen 234 AT&T Laboratories 235 200 Laurel Ave. 236 Middletown, NJ 07748 237 USA 239 Email: tony+sieveloop@maillennium.att.com 241 Cyrus Daboo 242 Cyrusoft International, Inc. 243 5001 Baum Blvd. 244 Suite 780 245 Pittsburgh, PA 15213 246 USA 248 Email: daboo@cyrusoft.com 250 Intellectual Property Statement 252 The IETF takes no position regarding the validity or scope of any 253 Intellectual Property Rights or other rights that might be claimed to 254 pertain to the implementation or use of the technology described in 255 this document or the extent to which any license under such rights 256 might or might not be available; nor does it represent that it has 257 made any independent effort to identify any such rights. Information 258 on the procedures with respect to rights in RFC documents can be 259 found in BCP 78 and BCP 79. 261 Copies of IPR disclosures made to the IETF Secretariat and any 262 assurances of licenses to be made available, or the result of an 263 attempt made to obtain a general license or permission for the use of 264 such proprietary rights by implementers or users of this 265 specification can be obtained from the IETF on-line IPR repository at 266 http://www.ietf.org/ipr. 268 The IETF invites any interested party to bring to its attention any 269 copyrights, patents or patent applications, or other proprietary 270 rights that may cover technology that may be required to implement 271 this standard. Please address the information to the IETF at 272 ietf-ipr@ietf.org. 274 Disclaimer of Validity 276 This document and the information contained herein are provided on an 277 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 278 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 279 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 280 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 281 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 282 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 284 Copyright Statement 286 Copyright (C) The Internet Society (2005). This document is subject 287 to the rights, licenses and restrictions contained in BCP 78, and 288 except as set forth therein, the authors retain all their rights. 290 Acknowledgment 292 Funding for the RFC Editor function is currently provided by the 293 Internet Society.