7Network Working Group                                          T. Hansen
 
8Request for Comments: 5703                             AT&T Laboratories
 
9Category: Standards Track                                       C. Daboo
 
14     Sieve Email Filtering: MIME Part Tests, Iteration, Extraction,
 
15                       Replacement, and Enclosure
 
19   This document defines extensions to the Sieve email filtering
 
20   language to permit analysis and manipulation of the MIME body parts
 
25   This document specifies an Internet standards track protocol for the
 
26   Internet community, and requests discussion and suggestions for
 
27   improvements.  Please refer to the current edition of the "Internet
 
28   Official Protocol Standards" (STD 1) for the standardization state
 
29   and status of this protocol.  Distribution of this memo is unlimited.
 
33   Copyright (c) 2009 IETF Trust and the persons identified as the
 
34   document authors.  All rights reserved.
 
36   This document is subject to BCP 78 and the IETF Trust's Legal
 
37   Provisions Relating to IETF Documents
 
38   (http://trustee.ietf.org/license-info) in effect on the date of
 
39   publication of this document.  Please review these documents
 
40   carefully, as they describe your rights and restrictions with respect
 
41   to this document.  Code Components extracted from this document must
 
42   include Simplified BSD License text as described in Section 4.e of
 
43   the Trust Legal Provisions and are provided without warranty as
 
44   described in the BSD License.
 
46   This document may contain material from IETF Documents or IETF
 
47   Contributions published or made publicly available before November
 
48   10, 2008.  The person(s) controlling the copyright in some of this
 
49   material may not have granted the IETF Trust the right to allow
 
50   modifications of such material outside the IETF Standards Process.
 
51   Without obtaining an adequate license from the person(s) controlling
 
52   the copyright in such materials, this document may not be modified
 
58Hansen & Daboo              Standards Track                     [Page 1]
 
60RFC 5703                 Sieve MIME Operations              October 2009
 
63   outside the IETF Standards Process, and derivative works of it may
 
64   not be created outside the IETF Standards Process, except to format
 
65   it for publication as an RFC or to translate it into languages other
 
70   1. Introduction ....................................................2
 
71   2. Conventions Used in This Document ...............................3
 
72   3. Sieve Loops: Actions "foreverypart" and "break" .................3
 
73   4. Changes to Sieve Tests ..........................................4
 
74      4.1. Test "header" ..............................................4
 
75      4.2. Test "address" .............................................7
 
76      4.3. Test "exists" ..............................................8
 
77   5. Action "replace" ................................................8
 
78   6. Action "enclose" ...............................................10
 
79   7. Action "extracttext" ...........................................11
 
80   8. Sieve Capability Strings .......................................11
 
81   9. Examples .......................................................12
 
82      9.1. Example 1 .................................................12
 
83      9.2. Example 2 .................................................12
 
84      9.3. Example 3 .................................................13
 
85   10. Acknowledgements ..............................................13
 
86   11. Security Considerations .......................................14
 
87   12. IANA Considerations ...........................................14
 
88      12.1. foreverypart capability ..................................15
 
89      12.2. mime capability ..........................................15
 
90      12.3. replace capability .......................................15
 
91      12.4. enclose capability .......................................16
 
92      12.5. extracttext capability ...................................16
 
93   13. References ....................................................16
 
94      13.1. Normative References .....................................16
 
95      13.2. Informative References ...................................17
 
99   MIME messages ([RFC2045]) are often complex objects, consisting of
 
100   many parts and sub-parts.  This Sieve ([RFC5228]) extension defines
 
101   mechanisms for performing tests on MIME body parts, looping through
 
102   the MIME body parts, extracting information from a MIME body part,
 
103   changing the contents of a MIME body part, and enclosing the entire
 
104   message within a wrapper.
 
114Hansen & Daboo              Standards Track                     [Page 2]
 
116RFC 5703                 Sieve MIME Operations              October 2009
 
1192.  Conventions Used in This Document
 
121   Conventions for notations are as in [RFC5228], Section 1.1.
 
123   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
 
124   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
 
125   document are to be interpreted as described in [RFC2119].
 
1273.  Sieve Loops: Actions "foreverypart" and "break"
 
129   The base Sieve language has no looping mechanism.  Given that
 
130   messages may contain multiple parts, in order to support filters that
 
131   apply to any and all parts, we introduce a new control command:
 
132   "foreverypart", which is an iterator that walks though every MIME
 
133   part of a message, including nested parts, depth first, and applies
 
134   the commands in the specified block to each of them.  The iterator
 
135   will start with the first MIME part (as its current context) and will
 
136   execute a command block (Sieve commands enclosed by {...}).  Upon
 
137   completion of this command block, the iterator advances to the next
 
138   MIME part (as its current context) and executes the same command
 
141   The iterator can be terminated prematurely by a new Sieve control
 
144   Usage:  foreverypart [":name" string] block
 
146   Usage:  break [":name" string];
 
148   "foreverypart" commands can be nested inside other "foreverypart"
 
149   commands.  When this occurs, the nested "foreverypart" iterates over
 
150   the MIME parts contained within the MIME part currently being
 
151   targeted by the nearest enclosing "foreverypart" command.  (That is,
 
152   the inner loop only operates on children of the bodypart currently
 
153   accessed by the outer loop.)  If that MIME part is a terminal MIME
 
154   part (i.e., does not contain other MIME parts), then the nested
 
155   "foreverypart" loop is simply ignored.
 
157   Sieve implementations MAY limit the number of nested loops that occur
 
158   within one another; however, they MUST support at least one nested
 
159   loop inside another loop.
 
161   If a name is given to a "break" command, it terminates the closest
 
162   enclosing loop with the identical matching name.  (If a nested
 
163   "foreverypart" name is the same as a "foreverypart" name in an outer
 
164   level, the outer level name is hidden.)  It is an error if there is
 
165   no enclosing loop with that name.
 
170Hansen & Daboo              Standards Track                     [Page 3]
 
172RFC 5703                 Sieve MIME Operations              October 2009
 
175   If no name is given in a "break" command (i.e., the ":name" parameter
 
176   is omitted), the break command terminates the closest enclosing loop.
 
1784.  Changes to Sieve Tests
 
180   This specification extends the base Sieve "header", "address", and
 
181   "exists" tests to support targeting those tests at a specific MIME
 
182   part or at all MIME parts in the enclosing scope.
 
186   The "header" test is extended with the addition of new ":mime" and
 
187   ":anychild" tagged arguments and their associated options.
 
189   Usage:  header [":mime"] [":anychild"] [MIMEOPTS]
 
190      [COMPARATOR] [MATCH-TYPE]
 
191      <header-names: string-list> <key-list: string-list>
 
193      The definition of [MIMEOPTS] is:
 
195   Syntax:  ":type" / ":subtype" / ":contenttype" /
 
196      ":param" <param-list: string-list>
 
198   When the ":mime" tagged argument is present in the "header" test, it
 
199   will parse the MIME header lines in the message so that tests can be
 
200   performed on specific elements.  The ":anychild" tagged argument may
 
201   only appear when the ":mime" tagged argument is present, and only
 
202   modifies the semantics of the ":mime" tagged argument.  That is,
 
203   presence of the ":anychild" in absence of ":mime" is an error.
 
205   When used outside the context of a "foreverypart" iterator, and
 
206   without an ":anychild" tagged argument, the "header" test will
 
207   examine only the outer top-level [RFC5322] headers of the message.
 
209   When used inside the context of a "foreverypart" iterator, and
 
210   without an ":anychild" tagged argument, the "header" test will
 
211   examine the headers associated with the current MIME part context
 
214   When used outside the context of a "foreverypart" iterator, and with
 
215   an ":anychild" tagged argument, the "header" test will examine all
 
216   MIME body parts and return true if any of them satisfies the test.
 
218   When used inside the context of a "foreverypart" iterator, and with
 
219   an ":anychild" tagged argument, the "header" test will examine the
 
220   current MIME part context and all its nested MIME body parts,
 
221   returning true if any of them satisfies the test.
 
226Hansen & Daboo              Standards Track                     [Page 4]
 
228RFC 5703                 Sieve MIME Operations              October 2009
 
231   The "header" test with the ":mime" tagged argument can test various
 
232   aspects of certain structured MIME headers.  Implementations SHOULD
 
233   support desegmentation, decoding, and charset translation of
 
234   parameter values encoded according to [RFC2231] as part of this test.
 
235   Additionally, [RFC2047] describes a process whereby [RFC5322] headers
 
236   can be encoded in various ways.  That encoding is not strictly
 
237   allowed in MIME parameters; however, in practice, it has been used in
 
238   many email implementations.  So, Sieve implementations MAY decode
 
239   [RFC2047]-encoded words in parameter values as part of this test.
 
241   These options are available:
 
243   :type          for a "Content-Type" MIME header field, parses and
 
244                  tests the value of the MIME type specified in the
 
245                  header; for a "Content-Disposition" MIME header field,
 
246                  parses and tests the value of the disposition
 
247                  specified in the header; for other MIME headers, uses
 
248                  a blank string for the test.
 
250   :subtype       for a "Content-Type" MIME header field, parses and
 
251                  tests the value of the MIME subtype specified in the
 
252                  header; for a "Content-Disposition" MIME header field,
 
253                  uses a blank string for the test; for other MIME
 
254                  headers, uses a blank string for the test.
 
256   :contenttype   for a "Content-Type" MIME header field, parses and
 
257                  tests the combined value of the MIME type and subtype
 
258                  specified in the header; for a "Content-Disposition"
 
259                  MIME header field, behaves the same as the ":type"
 
260                  option; for other MIME headers, uses a blank string
 
263   :param         parses the header looking for MIME parameters in the
 
264                  header.  The supplied string-list lists the names of
 
265                  any parameters to be tested.  If any one named
 
266                  parameter value matches any of the test string values,
 
267                  the test will return true.
 
269   When the ":count" option from [RFC5231] is used, the following
 
272   a.  for ":type", ":subtype", or ":contenttype", return a count of the
 
273       number of headers that parsed successfully
 
275   b.  for ":param", return a count of the number of parameters with the
 
276       given name that were found
 
282Hansen & Daboo              Standards Track                     [Page 5]
 
284RFC 5703                 Sieve MIME Operations              October 2009
 
289   require ["mime", "fileinto"];
 
291   if header :mime :type "Content-Type" "image"
 
293       fileinto "INBOX.images";
 
296   In this example, any message that contains a MIME image type part at
 
297   the top-level is saved to the mailbox "INBOX.images".
 
301   require ["mime", "fileinto"];
 
303   if header :mime :anychild :contenttype
 
304             "Content-Type" "text/html"
 
306       fileinto "INBOX.html";
 
309   In this example, any message that contains any MIME part with a
 
310   content-type of "text/html" is saved to the mailbox "INBOX.html".
 
314   require ["mime", "foreverypart", "fileinto"];
 
319         header :mime :param "filename" :contains
 
320            "Content-Disposition" "important",
 
321         header :mime :subtype "Content-Type" "pdf",
 
324           fileinto "INBOX.important";
 
329   In this example, any message that contains a MIME part that has a
 
330   content-disposition with a filename parameter containing the text
 
331   "important", has a content-subtype of "pdf" and is bigger than 100 Kb
 
332   is saved to the mailbox "INBOX.important".
 
338Hansen & Daboo              Standards Track                     [Page 6]
 
340RFC 5703                 Sieve MIME Operations              October 2009
 
345   The "address" test is extended with the addition of new ":mime" and
 
346   ":anychild" tagged arguments and their associated options.
 
348   Usage:  address [":mime"] [":anychild"] [COMPARATOR]
 
349      [ADDRESS-PART] [MATCH-TYPE]
 
350      <header-list: string-list> <key-list: string-list>
 
352   When the ":mime" tagged argument is present in the "address" test, it
 
353   will parse the MIME header lines as if they were standard address
 
354   header lines in a message so that tests can be performed on specific
 
357   The behavior of the ":anychild" tagged argument and the interaction
 
358   with the "foreverypart" iterator is the same as for the extended
 
359   "header" test in Section 4.1.
 
363      the use of "address" when both the ":mime" and ":anychild" tagged
 
364      arguments are omitted is the test defined in [RFC5228], i.e., it
 
365      will *only* operate on top-level header fields, whether or not it
 
366      is inside "foreverypart".
 
368      the use of "address" with ":mime" and no ":anychild" operates on
 
369      the current MIME part only (or on the top-level header fields, if
 
370      outside "foreverypart").
 
372      the use of "address" with ":mime" and ":anychild" operates on the
 
373      current MIME part and all of its descendants.
 
377   require ["mime", "fileinto"];
 
379   if address :mime :is :all "content-from" "tim@example.com"
 
381       fileinto "INBOX.part-from-tim";
 
384   In this example, any message that contains a MIME Content-From header
 
385   at the top-level matching the text "tim@example.com" is saved to the
 
386   mailbox "INBOX.part-from-tim".
 
394Hansen & Daboo              Standards Track                     [Page 7]
 
396RFC 5703                 Sieve MIME Operations              October 2009
 
401   The "exists" test is extended with the addition of the new ":mime"
 
402   and ":anychild" tagged arguments and their associated options.
 
404   Usage:  exists [":mime"] [":anychild"] <header-names: string-list>
 
406   When the ":mime" tagged argument is present in the "exists" test, the
 
407   test is extended to check for the existence of MIME headers in MIME
 
410   The behavior of the ":anychild" tagged argument and the interaction
 
411   with the "foreverypart" iterator is the same as for the extended
 
412   "header" test Section 4.1.
 
416      the use of "exists" when both the ":mime" and ":anychild" tagged
 
417      arguments are omitted is the test defined in [RFC5228], i.e., it
 
418      will *only* operate on top-level header fields, whether or not it
 
419      is inside "foreverypart".
 
421      the use of "exists" with ":mime" and no ":anychild" operates on
 
422      the current MIME part only (or on the top-level header fields, if
 
423      outside "foreverypart").
 
425      the use of "exists" with ":mime" and ":anychild" operates on the
 
426      current MIME part and all of its descendants.
 
430   require ["mime", "fileinto"];
 
432   if exists :mime :anychild "content-md5"
 
434       fileinto "INBOX.md5";
 
437   In this example, any message that contains a MIME Content-MD5 header
 
438   in any MIME part is saved to the mailbox "INBOX.md5".
 
442   Usage:  replace [":mime"] [":subject" string] [":from" string]
 
443      <replacement: string>
 
445   The "replace" command is defined to allow a MIME part to be replaced
 
446   with the text supplied in the command.
 
450Hansen & Daboo              Standards Track                     [Page 8]
 
452RFC 5703                 Sieve MIME Operations              October 2009
 
455   When used in the context of a "foreverypart" iterator, the MIME part
 
456   to be replaced is the "current" MIME part.  If the current MIME
 
457   context is a multipart MIME part, the entire multipart MIME part is
 
458   replaced, which would alter the MIME structure of the message by
 
459   eliminating all of the children of the multipart part.  (Replacing a
 
460   non-multipart MIME part within a "foreverypart" loop context does not
 
461   alter the overall message structure.)  If the MIME structure is
 
462   altered, the change takes effect immediately: the "foreverypart"
 
463   iterator that is executing does not go into the no-longer existing
 
464   body parts, and subsequent "foreverypart" iterators would use the new
 
467   When used outside the context of a "foreverypart" loop, the MIME part
 
468   to be replaced is the entire message.
 
470   If the ":mime" parameter is not specified, the replacement string is
 
471   a text/plain part in UTF-8 [RFC3629].
 
473   If the ":mime" parameter is specified, then the replacement string
 
474   is, in fact, a MIME entity as defined in [RFC2045], Section 2.4,
 
475   including both MIME headers and content.
 
477   If the entire message is being replaced, the optional ":subject"
 
478   parameter specifies a subject line to attach to the message that is
 
479   generated.  UTF-8 characters can be used in the string argument;
 
480   implementations MUST convert the string to [RFC2047]-encoded words if
 
481   and only if non-ASCII characters are present.  If the ":subject"
 
482   parameter is used, implementations MUST preserve any previous Subject
 
483   header as an Original-Subject header.  Implementations MUST preserve
 
484   all other header fields from the original message with the exception
 
485   of those relating to the MIME structure that is being replaced.
 
487   If the entire message is being replaced, as an indication that the
 
488   message is no longer as created by the original author of the
 
489   message, the optional ":from" parameter may be used to specify an
 
490   alternate address to use in the From field of the message that is
 
491   generated.  The string must specify a valid [RFC5322] mailbox-list.
 
492   Implementations SHOULD check the syntax and generate an error when a
 
493   syntactically invalid ":from" parameter is specified.
 
494   Implementations MAY also impose restrictions on what addresses can be
 
495   specified in a ":from" parameter; it is suggested that values that
 
496   fail such a validity check simply be ignored rather than causing the
 
497   "replace" action to fail.  If the From header is changed,
 
498   implementations MUST preserve the previous From header as an
 
499   Original-From header.
 
506Hansen & Daboo              Standards Track                     [Page 9]
 
508RFC 5703                 Sieve MIME Operations              October 2009
 
511   Implementations that support the "editheader" extension [RFC5293]
 
512   MUST ensure that any Original-Subject or Original-From headers added
 
513   by the system cannot be modified or removed.  Implementations MAY
 
514   prevent the addition of Original-Subject and Orignal-From headers via
 
515   the "editheader" extension.
 
517   If ":mime" is specified and either ":subject" or ":from" is
 
518   specified, the ":subject:" or ":from" parameter MUST be ignored.
 
519   This SHOULD be flagged as a compilation error.
 
523   Usage:  enclose <:subject string> <:headers string-list> string
 
525   A new Sieve action command is defined to allow an entire message to
 
526   be enclosed as an attachment to a new message.  After enclosure,
 
527   subsequent actions affecting the message header or content, as well
 
528   as tests operating on the MIME structure or accessing MIME header
 
529   fields, use the newly created message instead of the original
 
530   message; this means that any use of a "replace" action or other
 
531   similar actions should be executed before the "enclose" action.
 
533   If multiple "enclose" actions are executed by a script, the message
 
534   is enclosed multiple times.  (If a Sieve script desires to choose
 
535   between different enclosures, or wants to delay the enclosure to the
 
536   end of the script, it can use variables with appropriate tests
 
539   This action does not affect messages that are forwarded via a
 
542   Specifically, the original message becomes a multipart/mixed message
 
543   with two parts: a text/plain portion with the string argument as its
 
544   body, and a message/rfc822 portion with the original message
 
545   enclosed.  The Content-Type: header field becomes multipart/mixed.
 
546   The optional Subject: header is specified by the ":subject" argument;
 
547   if not present, the subject will be taken from the enclosed message.
 
548   Any headers specified by ":headers" are copied from the old message
 
549   into the new message.  If not specified by ":headers", Date: and
 
550   From: headers should be synthesized to reflect the current date and
 
551   the user running the Sieve action.
 
562Hansen & Daboo              Standards Track                    [Page 10]
 
564RFC 5703                 Sieve MIME Operations              October 2009
 
5677.  Action "extracttext"
 
569   Usage:  extracttext [MODIFIER] [":first" number] <varname: string>
 
571   The "extracttext" action may be used within the context of a
 
572   "foreverypart" loop and is used to store text into a variable as
 
573   defined by [RFC5229].  Servers MUST support transcoding of any
 
574   textual body part into UTF-8 for use with this action.  This requires
 
575   decoding any transfer encoding as well as transcoding from the
 
576   indicated character set into UTF-8.  It stores at most ":first"
 
577   characters of the transcoded content of the current MIME body part in
 
578   the variable identified by varname.  If the ":first" parameter is not
 
579   present, the whole content of the current MIME body part is stored.
 
580   In either case, the actually stored data MAY be truncated to conform
 
581   to implementation specific limit on variable length and/or on MIME
 
582   body part length.  If the transfer encoding or character set is
 
583   unrecognized by the implementation or recognized but invalid, an
 
584   empty string will result.
 
586   If "extracttext" is used outside the context of a "foreverypart"
 
587   loop, the action will set the variable identified by varname to the
 
588   empty string.  This SHOULD be flagged as a compilation error.
 
590   Modifiers are applied on the extracted text before it is stored in
 
5938.  Sieve Capability Strings
 
595   A Sieve implementation that defines the "foreverypart" and "break"
 
596   actions will advertise the capability string "foreverypart".
 
598   A Sieve implementation that defines the ":mime" and ":anychild"
 
599   tagged arguments to the "header", "address", and "exists" commands
 
600   will advertise the capability string "mime".
 
602   A Sieve implementation that defines the "replace" action will
 
603   advertise the capability string "replace".
 
605   A Sieve implementation that defines the "enclose" action will
 
606   advertise the capability string "enclose".
 
608   A Sieve implementation that defines the "extracttext" action will
 
609   advertise the capability string "extracttext".  Note that to be
 
610   useful, the "extracttext" action also requires the "variables"
 
611   [RFC5229] and "foreverypart" capabilities.
 
618Hansen & Daboo              Standards Track                    [Page 11]
 
620RFC 5703                 Sieve MIME Operations              October 2009
 
627   Consider a Sieve script to replace some of the Windows executable
 
628   attachments in a message.  (The actual list of executable types and
 
629   extensions is considerably longer and constantly changing.  The tests
 
630   shown here are an example only.)  Such a script might look like this:
 
632   require [ "foreverypart", "mime", "replace" ];
 
636            header :mime :contenttype :is
 
637              "Content-Type" "application/exe",
 
638            header :mime :param "filename"
 
639              :matches ["Content-Type", "Content-Disposition"] "*.com" )
 
641       replace "Executable attachment removed by user filter";
 
647   Consider a Sieve script to warn the user about some of the executable
 
648   attachment types.  (The actual list of executable types and
 
649   extensions is considerably longer and constantly changing.  The tests
 
650   shown here are an example only.)  Such a script might look like this:
 
652   require [ "foreverypart", "mime", "enclose" ];
 
656     if header :mime :param "filename"
 
657        :matches ["Content-Type", "Content-Disposition"]
 
658          ["*.com", "*.exe", "*.vbs", "*.scr",
 
659           "*.pif", "*.hta", "*.bat", "*.zip" ]
 
661       # these attachment types are executable
 
662       enclose :subject "Warning" :text
 
663   WARNING! The enclosed message contains executable attachments.
 
664   These attachment types may contain a computer virus program
 
665   that can infect your computer and potentially damage your data.
 
667   Before clicking on these message attachments, you should verify
 
668   with the sender that this message was sent by them and not a
 
674Hansen & Daboo              Standards Track                    [Page 12]
 
676RFC 5703                 Sieve MIME Operations              October 2009
 
687   A Sieve script to extract subject and text out of messages from the
 
688   boss might look like this:
 
690   require ["mime", "variables", "extracttext"];
 
692   if header :contains "from" "boss@example.org"
 
694     # :matches is used to get the value of the Subject header
 
695     if header :matches "Subject" "*"
 
697       set "subject" "${1}";
 
700     # extract the first 100 characters of the first text/* part
 
703       if header :mime :type :is "Content-Type" "text"
 
705         extracttext :first 100 "msgcontent";
 
710     # if it's not a 'for your information' message
 
711     if not header :contains "subject" "FYI:"
 
713       # do something using ${subject} and ${msgcontent}
 
714       # such as sending a notification using a
 
715       # notification extension
 
721   Comments from members of the MTA Filters Working Group, in particular
 
722   Ned Freed, Kjetil Torgrim Homme, Mark Mallett, Alexey Melnikov, Aaron
 
723   Stone, and Nigel Swinson are gratefully acknowledged.
 
730Hansen & Daboo              Standards Track                    [Page 13]
 
732RFC 5703                 Sieve MIME Operations              October 2009
 
73511.  Security Considerations
 
737   The "enclose" action creates an entirely new message, as compared to
 
738   just redirecting or forwarding the existing message.  Therefore, any
 
739   site policies applicable to message submission should be enforced.
 
741   The looping specification specified here provides easier access to
 
742   information about the message contents, which may also be achieved
 
743   through other sieve tests.  This is not believed to raise any
 
744   additional security issues beyond those for the Sieve "envelope" and
 
745   "body" [RFC5173] tests.
 
747   Any change in message content may interfere with digital signature
 
748   mechanisms that include that content in the signed material.  In
 
749   particular, using "replace" makes direct changes to the body content
 
750   and will affect the body hash included in Domain Keys Identified Mail
 
751   (DKIM) signatures [RFC4871], or the message signature used for Secure
 
752   MIME (S/MIME) [RFC3851], Pretty Good Privacy (PGP) [RFC1991] or
 
755   It is not possible to examine the MIME structure of decrypted content
 
756   in a multipart/encrypted MIME part.
 
758   When "enclose" is used on a message containing a multipart/signed
 
759   MIME part, the Sieve implementation MUST ensure that the original
 
760   message is copied octet-for-octet to maintain the validity of the
 
763   The system MUST be sized and restricted in such a manner that even
 
764   malicious use of MIME part matching does not deny service to other
 
765   users of the host system.
 
767   All of the security considerations given in the base Sieve
 
768   specification also apply to these extensions.
 
77012.  IANA Considerations
 
772   The Original-Subject and Original-From headers have been registered
 
773   in the Permanent Message Header Fields registry.
 
775   The following templates specify the IANA registrations of the Sieve
 
776   extensions specified in this document.  This information has been
 
777   added to the IANA registry of Sieve Extensions (currently found at
 
778   http://www.iana.org).
 
786Hansen & Daboo              Standards Track                    [Page 14]
 
788RFC 5703                 Sieve MIME Operations              October 2009
 
79112.1.  foreverypart capability
 
794   Subject: Registration of new Sieve extension
 
796   Capability name: foreverypart
 
797   Description: adds the "foreverypart" and "break" actions for
 
798   iterating through MIME parts of a message.
 
801   Contact address: The Sieve discussion list
 
802   <ietf-mta-filters@imc.org>.
 
807   Subject: Registration of new Sieve extension
 
809   Capability name: mime
 
810   Description: adds the ":mime" and ":anychild" tagged arguments to the
 
811   "header", "address", and "exists" tests.  Adds the ":type",
 
812   ":subtype", ":contenttype", and ":param" options when ":mime" is used
 
813   with the "header" test.
 
816   Contact address: The Sieve discussion list
 
817   <ietf-mta-filters@imc.org>.
 
81912.3.  replace capability
 
822   Subject: Registration of new Sieve extension
 
824   Capability name: replace
 
825   Description: adds the "replace" action for replacing a MIME body part
 
829   Contact address: The Sieve discussion list
 
830   <ietf-mta-filters@imc.org>.
 
842Hansen & Daboo              Standards Track                    [Page 15]
 
844RFC 5703                 Sieve MIME Operations              October 2009
 
84712.4.  enclose capability
 
850   Subject: Registration of new Sieve extension
 
852   Capability name: enclose
 
853   Description: adds the "enclose" action for enclosing a message with a
 
857   Contact address: The Sieve discussion list
 
858   <ietf-mta-filters@imc.org>.
 
86012.5.  extracttext capability
 
863   Subject: Registration of new Sieve extension
 
865   Capability name: extracttext
 
866   Description: adds the "extracttext" action for extracting text from a
 
871   Contact address: The Sieve discussion list
 
872   <ietf-mta-filters@imc.org>.
 
87613.1.  Normative References
 
878   [RFC2045]  Freed, N. and N. Borenstein, "Multipurpose Internet Mail
 
879              Extensions (MIME) Part One: Format of Internet Message
 
880              Bodies", RFC 2045, November 1996.
 
882   [RFC2047]  Moore, K., "MIME (Multipurpose Internet Mail Extensions)
 
883              Part Three: Message Header Extensions for Non-ASCII Text",
 
884              RFC 2047, November 1996.
 
886   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
 
887              Requirement Levels", BCP 14, RFC 2119, March 1997.
 
889   [RFC2231]  Freed, N. and K. Moore, "MIME Parameter Value and Encoded
 
891              Character Sets, Languages, and Continuations", RFC 2231,
 
898Hansen & Daboo              Standards Track                    [Page 16]
 
900RFC 5703                 Sieve MIME Operations              October 2009
 
903   [RFC3629]  Yergeau, F., "UTF-8, a transformation format of ISO
 
904              10646", STD 63, RFC 3629, November 2003.
 
906   [RFC5173]  Degener, J. and P. Guenther, "Sieve Email Filtering: Body
 
907              Extension", RFC 5173, April 2008.
 
909   [RFC5228]  Guenther, P. and T. Showalter, "Sieve: An Email Filtering
 
910              Language", RFC 5228, January 2008.
 
912   [RFC5229]  Homme, K., "Sieve Email Filtering: Variables Extension",
 
913              RFC 5229, January 2008.
 
915   [RFC5231]  Segmuller, W. and B. Leiba, "Sieve Email Filtering:
 
916              Relational Extension", RFC 5231, January 2008.
 
918   [RFC5293]  Degener, J. and P. Guenther, "Sieve Email Filtering:
 
919              Editheader Extension", RFC 5293, August 2008.
 
921   [RFC5322]  Resnick, P., Ed., "Internet Message Format", RFC 5322,
 
92413.2.  Informative References
 
926   [RFC1991]  Atkins, D., Stallings, W., and P. Zimmermann, "PGP Message
 
927              Exchange Formats", RFC 1991, August 1996.
 
929   [RFC3851]  Ramsdell, B., "Secure/Multipurpose Internet Mail
 
930              Extensions (S/MIME) Version 3.1 Message Specification",
 
933   [RFC4871]  Allman, E., Callas, J., Delany, M., Libbey, M., Fenton,
 
934              J., and M. Thomas, "DomainKeys Identified Mail (DKIM)
 
935              Signatures", RFC 4871, May 2007.
 
937   [RFC4880]  Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R.
 
938              Thayer, "OpenPGP Message Format", RFC 4880, November 2007.
 
954Hansen & Daboo              Standards Track                    [Page 17]
 
956RFC 5703                 Sieve MIME Operations              October 2009
 
967   EMail: tony+sieveloop@maillennium.att.com
 
976   EMail: cyrus@daboo.name
 
977   URI:   http://www.apple.com/
 
1010Hansen & Daboo              Standards Track                    [Page 18]