draft-ietf-sieve-mime-loop-08.txt   draft-ietf-sieve-mime-loop-09.txt 
Internet Engineering Task Force T. Hansen Internet Engineering Task Force T. Hansen
Internet-Draft AT&T Laboratories Internet-Draft AT&T Laboratories
Intended status: Standards Track C. Daboo Intended status: Standards Track C. Daboo
Expires: May 24, 2009 Apple Inc. Expires: January 14, 2010 Apple Inc.
November 20, 2008 July 13, 2009
Sieve Email Filtering: MIME part Tests, Iteration, Extraction, Sieve Email Filtering: MIME part Tests, Iteration, Extraction,
Replacement and Enclosure Replacement and Enclosure
draft-ietf-sieve-mime-loop-08 draft-ietf-sieve-mime-loop-09
Status of this Memo Status of this Memo
By submitting this Internet-Draft, each author represents that any This Internet-Draft is submitted to IETF in full conformance with the
applicable patent or other IPR claims of which he or she is aware provisions of BCP 78 and BCP 79. This document may contain material
have been or will be disclosed, and any of which he or she becomes from IETF Documents or IETF Contributions published or made publicly
aware will be disclosed, in accordance with Section 6 of BCP 79. available before November 10, 2008. The person(s) controlling the
copyright in some of this material may not have granted the IETF
Trust the right to allow modifications of such material outside the
IETF Standards Process. Without obtaining an adequate license from
the person(s) controlling the copyright in such materials, this
document may not be modified outside the IETF Standards Process, and
derivative works of it may not be created outside the IETF Standards
Process, except to format it for publication as an RFC or to
translate it into languages other than English.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet- other groups may also distribute working documents as Internet-
Drafts. Drafts.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on May 24, 2009. This Internet-Draft will expire on January 14, 2010.
Copyright Notice
Copyright (c) 2009 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents in effect on the date of
publication of this document (http://trustee.ietf.org/license-info).
Please review these documents carefully, as they describe your rights
and restrictions with respect to this document.
Abstract Abstract
This document defines extensions to the Sieve email filtering This document defines extensions to the Sieve email filtering
language to permit analysis and manipulation of the MIME body parts language to permit analysis and manipulation of the MIME body parts
of an email message. of an email message.
Note Note
This document is being discussed on the MTA-FILTERS mailing list, This document is being discussed on the MTA-FILTERS mailing list,
ietf-mta-filters@imc.org. ietf-mta-filters@imc.org.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Conventions Used in This Document . . . . . . . . . . . . . . 3 2. Conventions Used in This Document . . . . . . . . . . . . . . 4
3. Sieve Loops: Actions "foreverypart" and "break" . . . . . . . 3 3. Sieve Loops: Actions "foreverypart" and "break" . . . . . . . 4
4. Changes to Sieve Tests . . . . . . . . . . . . . . . . . . . . 4 4. Changes to Sieve Tests . . . . . . . . . . . . . . . . . . . . 5
4.1. Test "header" . . . . . . . . . . . . . . . . . . . . . . 4 4.1. Test "header" . . . . . . . . . . . . . . . . . . . . . . 5
4.2. Test "address" . . . . . . . . . . . . . . . . . . . . . 6 4.2. Test "address" . . . . . . . . . . . . . . . . . . . . . 8
4.3. Test "exists" . . . . . . . . . . . . . . . . . . . . . . 7 4.3. Test "exists" . . . . . . . . . . . . . . . . . . . . . . 9
5. Action "replace" . . . . . . . . . . . . . . . . . . . . . . . 8 5. Action "replace" . . . . . . . . . . . . . . . . . . . . . . . 9
6. Action "enclose" . . . . . . . . . . . . . . . . . . . . . . . 9 6. Action "enclose" . . . . . . . . . . . . . . . . . . . . . . . 11
7. Action "extracttext" . . . . . . . . . . . . . . . . . . . . . 10 7. Action "extracttext" . . . . . . . . . . . . . . . . . . . . . 12
8. Sieve Capability Strings . . . . . . . . . . . . . . . . . . . 10 8. Sieve Capability Strings . . . . . . . . . . . . . . . . . . . 12
9. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 9. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
9.1. Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 11 9.1. Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 13
9.2. Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 11 9.2. Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 13
9.3. Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 12 9.3. Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 14
10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 13 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 14
11. Security Considerations . . . . . . . . . . . . . . . . . . . 13 11. Security Considerations . . . . . . . . . . . . . . . . . . . 14
12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15
12.1. foreverypart capability . . . . . . . . . . . . . . . . . 14 12.1. foreverypart capability . . . . . . . . . . . . . . . . . 15
12.2. mime capability . . . . . . . . . . . . . . . . . . . . . 15 12.2. mime capability . . . . . . . . . . . . . . . . . . . . . 16
12.3. replace capability . . . . . . . . . . . . . . . . . . . 15 12.3. replace capability . . . . . . . . . . . . . . . . . . . 16
12.4. enclose capability . . . . . . . . . . . . . . . . . . . 15 12.4. enclose capability . . . . . . . . . . . . . . . . . . . 16
12.5. extracttext capability . . . . . . . . . . . . . . . . . 15 12.5. extracttext capability . . . . . . . . . . . . . . . . . 17
13. Change History . . . . . . . . . . . . . . . . . . . . . . . . 16 13. Change History . . . . . . . . . . . . . . . . . . . . . . . . 17
13.1. draft-ietf-sieve-mime-08 . . . . . . . . . . . . . . . . 16 13.1. draft-ietf-sieve-mime-09 . . . . . . . . . . . . . . . . 17
13.2. draft-ietf-sieve-mime-07 . . . . . . . . . . . . . . . . 16 13.2. draft-ietf-sieve-mime-08 . . . . . . . . . . . . . . . . 17
13.3. draft-ietf-sieve-mime-06 . . . . . . . . . . . . . . . . 16 13.3. draft-ietf-sieve-mime-07 . . . . . . . . . . . . . . . . 18
13.4. draft-ietf-sieve-mime-05 . . . . . . . . . . . . . . . . 16 13.4. draft-ietf-sieve-mime-06 . . . . . . . . . . . . . . . . 18
13.5. draft-ietf-sieve-mime-04 . . . . . . . . . . . . . . . . 17 13.5. draft-ietf-sieve-mime-05 . . . . . . . . . . . . . . . . 18
13.6. draft-ietf-sieve-mime-03 . . . . . . . . . . . . . . . . 17 13.6. draft-ietf-sieve-mime-04 . . . . . . . . . . . . . . . . 18
13.7. draft-ietf-sieve-mime-02 . . . . . . . . . . . . . . . . 17 13.7. draft-ietf-sieve-mime-03 . . . . . . . . . . . . . . . . 19
13.8. draft-ietf-sieve-mime-01 . . . . . . . . . . . . . . . . 17 13.8. draft-ietf-sieve-mime-02 . . . . . . . . . . . . . . . . 19
13.9. draft-ietf-sieve-mime-00 . . . . . . . . . . . . . . . . 18 13.9. draft-ietf-sieve-mime-01 . . . . . . . . . . . . . . . . 19
13.10. draft-sieve-mime-loop-04 . . . . . . . . . . . . . . . . 18 13.10. draft-ietf-sieve-mime-00 . . . . . . . . . . . . . . . . 19
13.11. draft-hansen-sieve-loop-03 . . . . . . . . . . . . . . . 18 13.11. draft-sieve-mime-loop-04 . . . . . . . . . . . . . . . . 20
13.12. draft-hansen-sieve-loop-02 . . . . . . . . . . . . . . . 18 13.12. draft-hansen-sieve-loop-03 . . . . . . . . . . . . . . . 20
13.13. draft-hansen-sieve-loop-01 . . . . . . . . . . . . . . . 19 13.13. draft-hansen-sieve-loop-02 . . . . . . . . . . . . . . . 20
14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 19 13.14. draft-hansen-sieve-loop-01 . . . . . . . . . . . . . . . 20
14.1. Normative References . . . . . . . . . . . . . . . . . . 19 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 21
14.2. Informative References . . . . . . . . . . . . . . . . . 19 14.1. Normative References . . . . . . . . . . . . . . . . . . 21
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 19 14.2. Informative References . . . . . . . . . . . . . . . . . 21
Intellectual Property and Copyright Statements . . . . . . . . . . 21 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 22
1. Introduction 1. Introduction
MIME messages ([RFC2045]) are often complex objects, consisting of MIME messages ([RFC2045]) are often complex objects, consisting of
many parts and sub-parts. This extension defines mechanisms for many parts and sub-parts. This extension defines mechanisms for
performing tests on MIME body parts, looping through the MIME body performing tests on MIME body parts, looping through the MIME body
parts, extracting information from a MIME body part, changing the parts, extracting information from a MIME body part, changing the
contents of a MIME body part, and enclosing the entire message within contents of a MIME body part, and enclosing the entire message within
a wrapper. a wrapper.
skipping to change at page 4, line 41 skipping to change at page 5, line 41
Syntax: ":type" / ":subtype" / ":contenttype" / Syntax: ":type" / ":subtype" / ":contenttype" /
":param" <param-list: string-list> ":param" <param-list: string-list>
When the ":mime" tagged argument is present in the "header" test, it When the ":mime" tagged argument is present in the "header" test, it
will parse the MIME header lines in the message so that tests can be will parse the MIME header lines in the message so that tests can be
performed on specific elements. performed on specific elements.
When used outside the context of a "foreverypart" iterator, and When used outside the context of a "foreverypart" iterator, and
without an ":anychild" tagged argument, the "header" test will without an ":anychild" tagged argument, the "header" test will
examine only the outer top-level RFC2822 headers of the message. examine only the outer top-level [RFC5322] headers of the message.
When used inside the context of a "foreverypart" iterator, and When used inside the context of a "foreverypart" iterator, and
without an ":anychild" tagged argument, the "header" test will without an ":anychild" tagged argument, the "header" test will
examine the headers associated with the current MIME part context examine the headers associated with the current MIME part context
from the loop. from the loop.
When used outside the context of a "foreverypart" iterator, and with When used outside the context of a "foreverypart" iterator, and with
an ":anychild" tagged argument, the "header" test will examine all an ":anychild" tagged argument, the "header" test will examine all
MIME body parts and return true if any of them satisfies the test. MIME body parts and return true if any of them satisfies the test.
When used inside the context of a "foreverypart" iterator, and with When used inside the context of a "foreverypart" iterator, and with
an ":anychild" tagged argument, the "header" test will examine the an ":anychild" tagged argument, the "header" test will examine the
current MIME part context and all its nested MIME body parts, current MIME part context and all its nested MIME body parts,
returning true if any of them satisfies the test. returning true if any of them satisfies the test.
The "header" test with the ":mime" tagged argument can test various The "header" test with the ":mime" tagged argument can test various
aspects of certain structured MIME headers. These options are aspects of certain structured MIME headers. Implementations SHOULD
available: support desegmentation, decoding, and charset translation of
parameter values encoded according to [RFC2231] as part of this test.
Additionally, [RFC2047] describes a process whereby [RFC5322] headers
can be encoded in various ways. That encoding is not strictly
allowed in MIME parameters, however in practice it has been used in
many email implementations. So, SIEVE implementations MAY decode
[RFC2047] encoded words in parameter values as part of this test.
:type parses the header assuming it has the format of a "Content- These options are available:
Type:" MIME header field, and tests the value of the MIME type
specified in the header.
:subtype parses the header assuming it has the format of a "Content- :type for a "Content-Type" MIME header field, parses and tests the
Type:" MIME header field, and tests the value of the MIME subtype value of the MIME type specified in the header; for a "Content-
specified in the header. Disposition" MIME header field, parses and tests the value of the
disposition specified in the header; for other MIME headers, uses
a blank string for the test
:contenttype parses the header assuming it has the format of a :subtype for a "Content-Type" MIME header field, parses and tests
"Content-Type:" MIME header field, and tests the combined value of the value of the MIME subtype specified in the header; for a
the MIME type and subtype specified in the header. "Content-Disposition" MIME header field, uses a blank string for
the test; for other MIME headers, uses a blank string for the test
:contenttype for a "Content-Type" MIME header field, parses and
tests the combined value of the MIME type and subtype specified in
the header; for a "Content-Disposition" MIME header field, behaves
the same as the :type option; for other MIME headers, uses a blank
string for the test
:param parses the header looking for MIME parameters in the header. :param parses the header looking for MIME parameters in the header.
The supplied string-list lists the names of any parameters to be The supplied string-list lists the names of any parameters to be
tested. If any one named parameter value matches any of the test tested. If any one named parameter value matches any of the test
string values, the test will return true. string values, the test will return true.
When the :count option from [RFC5231] is used, the following applies:
a. for :type, :subtype or :contenttype, return a count of the number
of headers that parsed successfully
b. for :param, return a count of the number of parameters with the
given name that were found
Example: Example:
require ["mime", "fileinto"]; require ["mime", "fileinto"];
if header :mime :type "Content-Type" "image" if header :mime :type "Content-Type" "image"
{ {
fileinto "INBOX.images"; fileinto "INBOX.images";
} }
In this example, any message that contains a MIME image type part at In this example, any message that contains a MIME image type part at
skipping to change at page 7, line 24 skipping to change at page 8, line 48
require ["mime", "fileinto"]; require ["mime", "fileinto"];
if address :mime :is :all "content-from" "tim@example.com" if address :mime :is :all "content-from" "tim@example.com"
{ {
fileinto "INBOX.part-from-tim"; fileinto "INBOX.part-from-tim";
} }
In this example, any message that contains a MIME Content-From header In this example, any message that contains a MIME Content-From header
at the top-level matching the text "tim@example.com" is saved to the at the top-level matching the text "tim@example.com" is saved to the
mailbox "INBOX.part-from-time". mailbox "INBOX.part-from-tim".
4.3. Test "exists" 4.3. Test "exists"
The "exists" test is extended with the addition of the new ":mime" The "exists" test is extended with the addition of the new ":mime"
and ":anychild" tagged arguments and their associated options. and ":anychild" tagged arguments and their associated options.
Usage: exists [":mime"] [":anychild"] <header-names: string-list> Usage: exists [":mime"] [":anychild"] <header-names: string-list>
When the ":mime" tagged argument is present in the "exists" test, the When the ":mime" tagged argument is present in the "exists" test, the
test is extended to check for the existence of MIME headers in MIME test is extended to check for the existence of MIME headers in MIME
skipping to change at page 8, line 43 skipping to change at page 10, line 26
alter the overall message structure.) If the MIME structure is alter the overall message structure.) If the MIME structure is
altered, the change takes effect immediately: the "foreverypart" altered, the change takes effect immediately: the "foreverypart"
iterator that is executing does not go into the no-longer existing iterator that is executing does not go into the no-longer existing
body parts, and subsequent "foreverypart" iterators would use the new body parts, and subsequent "foreverypart" iterators would use the new
message structure. message structure.
When used outside the context of a "foreverypart" loop, the MIME part When used outside the context of a "foreverypart" loop, the MIME part
to be replaced is the entire message. to be replaced is the entire message.
If the :mime parameter is not specified, the replacement string is a If the :mime parameter is not specified, the replacement string is a
text/plain part in UTF-8. text/plain part in UTF-8 [RFC3629].
If the :mime parameter is specified, then the replacement string is, If the :mime parameter is specified, then the replacement string is,
in fact, a MIME entity as defined in [RFC2045] section 2.4, including in fact, a MIME entity as defined in [RFC2045] section 2.4, including
both MIME headers and content. both MIME headers and content.
If the entire message is being replaced, the optional ":subject" If the entire message is being replaced, the optional ":subject"
parameter specifies a subject line to attach to the message that is parameter specifies a subject line to attach to the message that is
generated. UTF-8 characters can be used in the string argument; generated. UTF-8 characters can be used in the string argument;
implementations MUST convert the string to [RFC2047] encoded words if implementations MUST convert the string to [RFC2047] encoded words if
and only if non-ASCII characters are present. Implementations MUST and only if non-ASCII characters are present. Implementations MUST
preserve the previous Subject header as an Original-Subject header. preserve the previous Subject header as an Original-Subject header.
Implementations MUST preserve all other header fields from the Implementations MUST preserve all other header fields from the
original message with the exception of those relating to the MIME original message with the exception of those relating to the MIME
structure that is being replaced. structure that is being replaced.
If the entire message is being replaced, the optional ":from" If the entire message is being replaced, as an indication that the
parameter may be used to specify an alternate address to use in the message is no longer as created by the original author of the
From field of the message that is generated. The string must specify message, the optional ":from" parameter may be used to specify an
a valid [RFC2822] mailbox-list. Implementations SHOULD check the alternate address to use in the From field of the message that is
syntax and generate an error when a syntactically invalid ":from" generated. The string must specify a valid [RFC5322] mailbox-list.
parameter is specified. Implementations MAY also impose restrictions Implementations SHOULD check the syntax and generate an error when a
on what addresses can be specified in a ":from" parameter; it is syntactically invalid ":from" parameter is specified.
suggested that values that fail such a validity check simply be Implementations MAY also impose restrictions on what addresses can be
ignored rather than causing the replace action to fail. specified in a ":from" parameter; it is suggested that values that
Implementations MUST preserve the previous From header as an fail such a validity check simply be ignored rather than causing the
Original-From header. replace action to fail. Implementations MUST preserve the previous
From header as an Original-From header.
Implementations that support the "editheader" extension [RFC5293]
MUST ensure that any Original-Subject or Original-From headers added
by the system cannot be modified or removed. Implementations MAY
prevent the addition of Original-Subject and Orignal-From headers via
the "editheader" extension.
If ":mime" is specified and either ":subject" or ":from" is If ":mime" is specified and either ":subject" or ":from" is
specified, the ":subject:" or ":from" parameter MUST be ignored. specified, the ":subject:" or ":from" parameter MUST be ignored.
This SHOULD be flagged as a compilation error. This SHOULD be flagged as a compilation error.
6. Action "enclose" 6. Action "enclose"
Usage: enclose <:subject string> <:headers string-list> string Usage: enclose <:subject string> <:headers string-list> string
A new Sieve action command is defined to allow an entire message to A new Sieve action command is defined to allow an entire message to
be enclosed as an attachment to a new message. After enclosure, be enclosed as an attachment to a new message. After enclosure,
subsequent actions affecting the message header or content, as well subsequent actions affecting the message header or content, as well
as tests operating on the MIME structure or accessing MIME header as tests operating on the MIME structure or accessing MIME header
fields, use the newly created message instead of the original fields, use the newly created message instead of the original
message; this means that any use of a "replace" action or other message; this means that any use of a "replace" action or other
similar actions should be executed before the "enclose" action. similar actions should be executed before the "enclose" action.
If multiple "enclose" actions are executed by a script, the message If multiple "enclose" actions are executed by a script, the message
is enclosed multiple times. (If a Sieve script desires to choose is enclosed multiple times. (If a Sieve script desires to choose
between different enclosures, or wants to delay the enclosure to the between different enclosures, or wants to delay the enclosure to the
end of the script, it can use variables with appropriate tests. end of the script, it can use variables with appropriate tests
[RFC5229]) [RFC5229].)
This action does not affect messages that are forwarded via a This action does not affect messages that are forwarded via a
"redirect" action. "redirect" action.
Specifically, the original message becomes a multipart/mixed message Specifically, the original message becomes a multipart/mixed message
with two parts: a text/plain portion with the string argument as its with two parts: a text/plain portion with the string argument as its
body, and a message/rfc822 portion with the original message body, and a message/rfc822 portion with the original message
enclosed. The Content-Type: header field becomes multipart/mixed. enclosed. The Content-Type: header field becomes multipart/mixed.
The optional Subject: header is specified by the :subject argument; The optional Subject: header is specified by the :subject argument;
if not present the subject will be taken from the enclosed message. if not present the subject will be taken from the enclosed message.
Any headers specified by :headers are copied from the old message Any headers specified by :headers are copied from the old message
into the new message. If not specified by :headers, Date: and From: into the new message. If not specified by :headers, Date: and From:
headers should be synthesized to reflect the current date and the headers should be synthesized to reflect the current date and the
user running the Sieve action. user running the Sieve action.
7. Action "extracttext" 7. Action "extracttext"
Usage: extracttext [MODIFIER] [":first" number] <varname: string> Usage: extracttext [MODIFIER] [":first" number] <varname: string>
The "extracttext" action may be used within the context of a The "extracttext" action may be used within the context of a
"foreverypart" loop. Servers MUST support transcoding of any textual "foreverypart" loop and is used to store text into a variable as
body part into UTF-8 for use with this action. This requires defined by [RFC5229]. Servers MUST support transcoding of any
textual body part into UTF-8 for use with this action. This requires
decoding any transfer encoding as well as transcoding from the decoding any transfer encoding as well as transcoding from the
indicated character set into UTF-8. It stores at most :first indicated character set into UTF-8. It stores at most :first
characters of the transcoded content of the current MIME body part in characters of the transcoded content of the current MIME body part in
the variable identified by varname. If the :first parameter is not the variable identified by varname. If the :first parameter is not
present, the whole content of the current MIME body part is stored. present, the whole content of the current MIME body part is stored.
In either case the actually stored data MAY be truncated to conform In either case the actually stored data MAY be truncated to conform
to implementation specific limit on variable length and/or on MIME to implementation specific limit on variable length and/or on MIME
body part length. If the transfer encoding or character set is body part length. If the transfer encoding or character set is
unrecognized by the implementation or recognized but invalid, an unrecognized by the implementation or recognized but invalid, an
empty string will result. empty string will result.
If "extracttext" is used outside the context of a "foreverypart" If "extracttext" is used outside the context of a "foreverypart"
loop, the action will set the variable identified by varname to the loop, the action will set the variable identified by varname to the
empty string. This SHOULD be flagged as a compilation error. empty string. This SHOULD be flagged as a compilation error.
Modifiers are applied on the extracted text before it is stored in Modifiers are applied on the extracted text before it is stored in
the variable. See [RFC5229] for details. the variable.
8. Sieve Capability Strings 8. Sieve Capability Strings
A Sieve implementation that defines the "foreverypart" and "break" A Sieve implementation that defines the "foreverypart" and "break"
actions will advertise the capability string "foreverypart". actions will advertise the capability string "foreverypart".
A Sieve implementation that defines the ":mime" and ":anychild" A Sieve implementation that defines the ":mime" and ":anychild"
tagged arguments to the "header", "address" and "exists" commands tagged arguments to the "header", "address" and "exists" commands
will advertise the capability string "mime". will advertise the capability string "mime".
skipping to change at page 11, line 24 skipping to change at page 13, line 16
9.1. Example 1 9.1. Example 1
A Sieve script to replace all the Windows executable attachments in a A Sieve script to replace all the Windows executable attachments in a
message would be: message would be:
require [ "foreverypart", "mime", "replace" ]; require [ "foreverypart", "mime", "replace" ];
foreverypart foreverypart
{ {
if anyof ( if anyof (
header :mime :contenttype :is "Content-Type" "application/exe", header :mime :contenttype :is
"Content-Type" "application/exe",
header :mime :param "filename" header :mime :param "filename"
["Content-Type", "Content-Disposition"] :matches "*.com" ) :matches ["Content-Type", "Content-Disposition"] "*.com" )
{ {
replace "Executable attachment removed by user filter"; replace "Executable attachment removed by user filter";
} }
} }
9.2. Example 2 9.2. Example 2
A Sieve script to warn the user about executable attachment types A Sieve script to warn the user about executable attachment types
would be: would be:
require [ "foreverypart", "mime", "enclose" ]; require [ "foreverypart", "mime", "enclose" ];
foreverypart foreverypart
{ {
if header :mime :param "filename" if header :mime :param "filename"
["Content-Type", "Content-Disposition"] :matches :matches ["Content-Type", "Content-Disposition"]
["*.com", "*.exe", "*.vbs", "*.scr", ["*.com", "*.exe", "*.vbs", "*.scr",
"*.pif", "*.hta", "*.bat", "*.zip" ] "*.pif", "*.hta", "*.bat", "*.zip" ]
{ {
# these attachment types are executable # these attachment types are executable
enclose :subject "Warning" :text enclose :subject "Warning" :text
WARNING! The enclosed message contains executable attachments. WARNING! The enclosed message contains executable attachments.
These attachments types may contain a computer virus program These attachments types may contain a computer virus program
that can infect your computer and potentially damage your data. that can infect your computer and potentially damage your data.
Before clicking on these message attachments, you should verify Before clicking on these message attachments, you should verify
skipping to change at page 13, line 50 skipping to change at page 15, line 9
11. Security Considerations 11. Security Considerations
The "enclose" action creates an entirely new message, as compared to The "enclose" action creates an entirely new message, as compared to
just redirecting or forwarding the existing message. Therefore, any just redirecting or forwarding the existing message. Therefore, any
site policies applicable to message submission should be enforced. site policies applicable to message submission should be enforced.
The looping specification specified here provides easier access to The looping specification specified here provides easier access to
information about the message contents, which may also be achieved information about the message contents, which may also be achieved
through other sieve tests. This is not believed to raise any through other sieve tests. This is not believed to raise any
additional security issues beyond those for the Sieve "envelope" and additional security issues beyond those for the Sieve "envelope" and
"body" [I-D.ietf-sieve-body] tests. "body" [RFC5173] tests.
Any change in message content may interfere with digital signature Any change in message content may interfere with digital signature
mechanisms that include that content in the signed material. In mechanisms that include that content in the signed material. In
particular, using "replace" makes direct changes to the body content particular, using "replace" makes direct changes to the body content
and will affect the body hash included in DKIM signatures, or the and will affect the body hash included in DKIM signatures [RFC4871],
message signature used for S/MIME or OpenPGP. or the message signature used for S/MIME [RFC3851], PGP [RFC1991] or
OpenPGP [RFC4880].
It is not possible to examine the MIME structure of decrypted content It is not possible to examine the MIME structure of decrypted content
in a multipart/encrypted MIME part. in a multipart/encrypted MIME part.
When "enclose" is used on a message containing a multipart/signed When "enclose" is used on a message containing a multipart/signed
MIME part, the SIEVE implementation MUST ensure that the original MIME part, the SIEVE implementation MUST ensure that the original
message is copied octet-for-octet to maintain the validity of the message is copied octet-for-octet to maintain the validity of the
digital signature. digital signature.
The system MUST be sized and restricted in such a manner that even The system MUST be sized and restricted in such a manner that even
malicious use of mime part matching does not deny service to other malicious use of mime part matching does not deny service to other
users of the host system. users of the host system.
All of the security considerations given in the base Sieve All of the security considerations given in the base Sieve
specification also apply to these extensions. specification also apply to these extensions.
12. IANA Considerations 12. IANA Considerations
The Original-Subject: and Original-From: headers are to be registered The Original-Subject: and Original-From: headers are to be registered
in the Permanent Message Header Fields table. in the Permanent Message Header Fields registry.
The following templates specify the IANA registrations of the Sieve The following templates specify the IANA registrations of the Sieve
extensions specified in this document. This information should be extensions specified in this document. This information should be
added to the list of sieve extensions given on added to the IANA registry of Sieve Extensions (currently found at
http://www.iana.org/assignments/sieve-extensions. http://www.iana.org/assignments/sieve-extensions).
[[ RFC Editor Note: replace RFC XXXX with a reference to this RFC. ]] [[ RFC Editor Note: replace RFC XXXX with a reference to this RFC. ]]
12.1. foreverypart capability 12.1. foreverypart capability
To: iana@iana.org To: iana@iana.org
Subject: Registration of new Sieve extension Subject: Registration of new Sieve extension
Capability name: foreverypart Capability name: foreverypart
Description: adds the "foreverypart" and "break" actions for Description: adds the "foreverypart" and "break" actions for
skipping to change at page 15, line 12 skipping to change at page 16, line 17
Contact address: The Sieve discussion list Contact address: The Sieve discussion list
<ietf-mta-filters@imc.org>. <ietf-mta-filters@imc.org>.
12.2. mime capability 12.2. mime capability
To: iana@iana.org To: iana@iana.org
Subject: Registration of new Sieve extension Subject: Registration of new Sieve extension
Capability name: mime Capability name: mime
Description: adds the ":mime" and ":anychild" tagged arguments to the Description: adds the ":mime" and ":anychild" tagged arguments to the
"header", "address" and "exists" tests. "header", "address" and "exists" tests. Adds the :type, :subtype,
:contenttype and :param options when ":mime" is used with the
"header" test.
RFC number: RFC XXXX RFC number: RFC XXXX
Contact address: The Sieve discussion list Contact address: The Sieve discussion list
<ietf-mta-filters@imc.org>. <ietf-mta-filters@imc.org>.
12.3. replace capability 12.3. replace capability
To: iana@iana.org To: iana@iana.org
Subject: Registration of new Sieve extension Subject: Registration of new Sieve extension
skipping to change at page 16, line 11 skipping to change at page 17, line 22
RFC number: RFC XXXX RFC number: RFC XXXX
Contact address: The Sieve discussion list Contact address: The Sieve discussion list
<ietf-mta-filters@imc.org>. <ietf-mta-filters@imc.org>.
13. Change History 13. Change History
[[ RFC Editor NOTE: This section is to be removed prior to [[ RFC Editor NOTE: This section is to be removed prior to
publication as an RFC. ]] publication as an RFC. ]]
13.1. draft-ietf-sieve-mime-08 13.1. draft-ietf-sieve-mime-09
Allow for 2231 processing.
Optional 2047 decoding.
Explain what test options do against a Content-Disposition header.
Explain interaction with :count.
Updated to SIEVE body reference.
Updated IANA section for :mime to also indicate the four options are
added.
Added comments on the interaction of editheader and replace action.
Made variables normative as extracttext requires it.
Fixed some examples.
13.2. draft-ietf-sieve-mime-08
enhance description of enclose and multiple enclose. enhance description of enclose and multiple enclose.
Minor nits Minor nits
13.2. draft-ietf-sieve-mime-07 13.3. draft-ietf-sieve-mime-07
List :anychild parameter next to :mime, where it was added. List :anychild parameter next to :mime, where it was added.
Expand description of "address" and "exists". Expand description of "address" and "exists".
In replace, discuss interaction of :mime with :subject/:from. In replace, discuss interaction of :mime with :subject/:from.
In enclose, expand discussion o fmultiple enclosures. In enclose, expand discussion o fmultiple enclosures.
Mention compilation error if extracttext is used outside of a Mention compilation error if extracttext is used outside of a
foreverypart loop. foreverypart loop.
13.3. draft-ietf-sieve-mime-06 13.4. draft-ietf-sieve-mime-06
Added note to foreverypart about nested identical names hiding outer Added note to foreverypart about nested identical names hiding outer
names. names.
Added notes to Security Considerations section about it not working Added notes to Security Considerations section about it not working
on multipart/signed sections, and how replace/enclose may affect on multipart/signed sections, and how replace/enclose may affect
signatures. signatures.
13.4. draft-ietf-sieve-mime-05 13.5. draft-ietf-sieve-mime-05
Changed for_every_part to foreverypart, and extract_text to Changed for_every_part to foreverypart, and extract_text to
extracttext. extracttext.
Add option :name parameter to foreverypart and break. break :name Add option :name parameter to foreverypart and break. break :name
"string" will break out of closest enclosing foreverypart loop "string" will break out of closest enclosing foreverypart loop
with that name. with that name.
Clarify nesting a bit more. Clarify nesting a bit more.
Minor consistency nit picking. Minor consistency nit picking.
13.5. draft-ietf-sieve-mime-04 13.6. draft-ietf-sieve-mime-04
loops are depth first loops are depth first
:anychild clarifications :anychild clarifications
update examples update examples
grammar nits grammar nits
transcoding for extract_text transcoding for extract_text
13.6. draft-ietf-sieve-mime-03 13.7. draft-ietf-sieve-mime-03
add extraction add extraction
add security considerations add security considerations
fill in iana considerations fill in iana considerations
13.7. draft-ietf-sieve-mime-02 13.8. draft-ietf-sieve-mime-02
minor syntax glitches in examples minor syntax glitches in examples
Add clarification on "replace" affecting subsequent for_every_part Add clarification on "replace" affecting subsequent for_every_part
loops? loops?
Add IANA considerations for Original-Subject: and Original-From:. Add IANA considerations for Original-Subject: and Original-From:.
Add note on "enclose" creating From: and Date: headers. Add note on "enclose" creating From: and Date: headers.
13.8. draft-ietf-sieve-mime-01 13.9. draft-ietf-sieve-mime-01
what happens when nested for_every_part loop's what happens when nested for_every_part loop's
a "mime" shorthand for testing the type/subtype, without requiring a "mime" shorthand for testing the type/subtype, without requiring
interactions with variables interactions with variables
notifications notifications
notifications to calendar service notifications to calendar service
address tests, exists tests address tests, exists tests
mimeheader, mimeparameter tests mimeheader, mimeparameter tests
13.9. draft-ietf-sieve-mime-00 13.10. draft-ietf-sieve-mime-00
Changed title and text to emphasize MIME Tests. Changed title and text to emphasize MIME Tests.
Changed for.every.part to for_every_part. Changed for.every.part to for_every_part.
Added :anychild to mime test. Default is to use the current Added :anychild to mime test. Default is to use the current
context or outer envelope; specifying :anychild will look at all context or outer envelope; specifying :anychild will look at all
children. children.
Added clarifications to replacing parts affecting the structure. Added clarifications to replacing parts affecting the structure.
Added :mime option to replace, ala draft-ietf-sieve-vacation-06. Added :mime option to replace, ala draft-ietf-sieve-vacation-06.
Various other minor nit fixes. Various other minor nit fixes.
13.10. draft-sieve-mime-loop-04 13.11. draft-sieve-mime-loop-04
update reference for recent published rfcs update reference for recent published rfcs
extract-text now required to do decode transfer encoding and extract-text now required to do decode transfer encoding and
transcode to UTF-8 transcode to UTF-8
removed editheader reference since its not actually used removed editheader reference since its not actually used
several text changes as suggested by Nigel Swinson, including re- several text changes as suggested by Nigel Swinson, including re-
writes to abstract and introduction writes to abstract and introduction
13.11. draft-hansen-sieve-loop-03 13.12. draft-hansen-sieve-loop-03
after enclosure, subsequent actions affect newly created message after enclosure, subsequent actions affect newly created message
synthesis of Date/From headers by the enclose action is no longer synthesis of Date/From headers by the enclose action is no longer
controversial controversial
Filled in Security Considerations Filled in Security Considerations
Picked up extract_text action from draft-ietf-sieve-notify Picked up extract_text action from draft-ietf-sieve-notify
Expanded the IANA considerations section Expanded the IANA considerations section
13.12. draft-hansen-sieve-loop-02 13.13. draft-hansen-sieve-loop-02
Update to 3028bis reference. Update to 3028bis reference.
Added 2119 conventions section. Added 2119 conventions section.
Terminology/title tweaks. Terminology/title tweaks.
Added informative references to body and editheader extensions. Added informative references to body and editheader extensions.
Added description of nested loops. Added description of nested loops.
Replaced mime test by extensions to header, address and exists Replaced mime test by extensions to header, address and exists
tests. tests.
13.13. draft-hansen-sieve-loop-01 13.14. draft-hansen-sieve-loop-01
Merged with draft-daboo-sieve-mime-00.txt. Merged with draft-daboo-sieve-mime-00.txt.
14. References 14. References
14.1. Normative References 14.1. Normative References
[RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part One: Format of Internet Message Extensions (MIME) Part One: Format of Internet Message
Bodies", RFC 2045, November 1996. Bodies", RFC 2045, November 1996.
[RFC2047] Moore, K., "MIME (Multipurpose Internet Mail Extensions) [RFC2047] Moore, K., "MIME (Multipurpose Internet Mail Extensions)
Part Three: Message Header Extensions for Non-ASCII Text", Part Three: Message Header Extensions for Non-ASCII Text",
RFC 2047, November 1996. RFC 2047, November 1996.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2822] Resnick, P., "Internet Message Format", RFC 2822, [RFC2231] Freed, N. and K. Moore, "MIME Parameter Value and Encoded
April 2001. Word Extensions:
Character Sets, Languages, and Continuations", RFC 2231,
November 1997.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, November 2003.
[RFC5173] Degener, J. and P. Guenther, "Sieve Email Filtering: Body
Extension", RFC 5173, April 2008.
[RFC5228] Guenther, P. and T. Showalter, "Sieve: An Email Filtering [RFC5228] Guenther, P. and T. Showalter, "Sieve: An Email Filtering
Language", RFC 5228, January 2008. Language", RFC 5228, January 2008.
[RFC5229] Homme, K., "Sieve Email Filtering: Variables Extension",
RFC 5229, January 2008.
[RFC5231] Segmuller, W. and B. Leiba, "Sieve Email Filtering:
Relational Extension", RFC 5231, January 2008.
[RFC5293] Degener, J. and P. Guenther, "Sieve Email Filtering:
Editheader Extension", RFC 5293, August 2008.
[RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322,
October 2008.
14.2. Informative References 14.2. Informative References
[I-D.ietf-sieve-body] [RFC1991] Atkins, D., Stallings, W., and P. Zimmermann, "PGP Message
Guenther, P. and J. Degener, "Sieve Email Filtering: Body Exchange Formats", RFC 1991, August 1996.
Extension", draft-ietf-sieve-body-09 (work in progress),
March 2008.
[RFC5229] Homme, K., "Sieve Email Filtering: Variables Extension", [RFC3851] Ramsdell, B., "Secure/Multipurpose Internet Mail
RFC 5229, January 2008. Extensions (S/MIME) Version 3.1 Message Specification",
RFC 3851, July 2004.
[RFC4871] Allman, E., Callas, J., Delany, M., Libbey, M., Fenton,
J., and M. Thomas, "DomainKeys Identified Mail (DKIM)
Signatures", RFC 4871, May 2007.
[RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R.
Thayer, "OpenPGP Message Format", RFC 4880, November 2007.
Authors' Addresses Authors' Addresses
Tony Hansen Tony Hansen
AT&T Laboratories AT&T Laboratories
200 Laurel Ave. 200 Laurel Ave.
Middletown, NJ 07748 Middletown, NJ 07748
USA USA
Email: tony+sieveloop@maillennium.att.com Email: tony+sieveloop@maillennium.att.com
Cyrus Daboo Cyrus Daboo
Apple Inc. Apple Inc.
1 Infinite Loop 1 Infinite Loop
Cupertino, CA 95014 Cupertino, CA 95014
USA USA
Email: cyrus@daboo.name Email: cyrus@daboo.name
URI: http://www.apple.com/ URI: http://www.apple.com/
Full Copyright Statement
Copyright (C) The IETF Trust (2008).
This document is subject to the rights, licenses and restrictions
contained in BCP 78, and except as set forth therein, the authors
retain all their rights.
This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Intellectual Property
The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights
might or might not be available; nor does it represent that it has
made any independent effort to identify any such rights. Information
on the procedures with respect to rights in RFC documents can be
found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any
assurances of licenses to be made available, or the result of an
attempt made to obtain a general license or permission for the use of
such proprietary rights by implementers or users of this
specification can be obtained from the IETF on-line IPR repository at
http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights that may cover technology that may be required to implement
this standard. Please address the information to the IETF at
ietf-ipr@ietf.org.
 End of changes. 43 change blocks. 
111 lines changed or deleted 210 lines changed or added

This html diff was produced by rfcdiff 1.35. The latest version is available from http://tools.ietf.org/tools/rfcdiff/