< draft-ietf-sieve-body-08.txt   draft-ietf-sieve-body-09.txt >
Network Working Group Jutta Degener Network Working Group Jutta Degener
Internet Draft Philip Guenther Internet Draft Philip Guenther
Intended status: Standards Track Sendmail, Inc. Intended status: Standards Track Sendmail, Inc.
Expires: March 2008 September 2008 Expires: March 2008 September 2008
Updates: RFC-ietf-sieve-variables Updates: RFC-ietf-sieve-variables
Sieve Email Filtering: Body Extension Sieve Email Filtering: Body Extension
draft-ietf-sieve-body-08.txt draft-ietf-sieve-body-09.txt
Status of this memo Status of this memo
By submitting this Internet-Draft, each author represents that any By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79. aware will be disclosed, in accordance with Section 6 of BCP 79.
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
skipping to change at page 2, line 19 skipping to change at page 2, line 19
Such a test was initially discussed for the [SIEVE] base Such a test was initially discussed for the [SIEVE] base
document, but was subsequently removed because it was document, but was subsequently removed because it was
thought to be too costly to implement. thought to be too costly to implement.
Nevertheless, several server vendors have implemented Nevertheless, several server vendors have implemented
some form of the "body" test. some form of the "body" test.
This document reintroduces the "body" test as an extension, This document reintroduces the "body" test as an extension,
and specifies its syntax and semantics. and specifies its syntax and semantics.
2. Conventions used. 2. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [KEYWORDS]. document are to be interpreted as described in [KEYWORDS].
Conventions for notations are as in [SIEVE] section 1.1, including Conventions for notations are as in [SIEVE] section 1.1, including
use of the "Usage:" label for the definition of text and tagged use of the "Usage:" label for the definition of text and tagged
arguments syntax. arguments syntax.
The rules for interpreting the grammar are defined in [SIEVE] The rules for interpreting the grammar are defined in [SIEVE]
and inherited by this specification. In particular, readers of and inherited by this specification. In particular, readers of
this document are reminded that according to [SIEVE] sections this document are reminded that according to [SIEVE] sections
2.6.2 and 2.6.3, optional arguments such as COMPARATOR and 2.6.2 and 2.6.3, optional arguments such as COMPARATOR and
MATCH-TYPE can appear in any order. MATCH-TYPE can appear in any order.
3. Capability Identifier
The capability string associated with the extension defined in The capability string associated with the extension defined in
this document is "body". this document is "body".
3. Test body 4. Test body
Usage: "body" [COMPARATOR] [MATCH-TYPE] [BODY-TRANSFORM] Usage: "body" [COMPARATOR] [MATCH-TYPE] [BODY-TRANSFORM]
<key-list: string-list> <key-list: string-list>
The body test matches content in the body of an email message, The body test matches content in the body of an email message,
that is, anything following the first empty line after the header. that is, anything following the first empty line after the header.
(The empty line itself, if present, is not considered to be part (The empty line itself, if present, is not considered to be part
of the body.) of the body.)
The COMPARATOR and MATCH-TYPE keyword parameters are defined in The COMPARATOR and MATCH-TYPE keyword parameters are defined in
[SIEVE]. As specified in section 2.7.3 of [SIEVE], the default [SIEVE]. As specified in section 2.7.3 of [SIEVE], the default
COMPARATOR is "i;ascii-casemap" and the default MATCH-TYPE is COMPARATOR is "i;ascii-casemap" and the default MATCH-TYPE is
":is". ":is".
The BODY-TRANSFORM is a keyword parameter that governs how a set The BODY-TRANSFORM is a keyword parameter that governs how a set
of strings to be matched against are extracted from the body of of strings to be matched against are extracted from the body of
the message. If a message consists of a header only, not followed the message. If a message consists of a header only, not followed
by an empty line, then that set is empty and all "body" tests by an empty line, then that set is empty and all "body" tests
return false, including those that test for an empty string. return false, including those that test for an empty string.
skipping to change at page 3, line 22 skipping to change at page 3, line 26
must be followed as defined below in section 4. must be followed as defined below in section 4.
Note that the transforms defined here do *not* match against Note that the transforms defined here do *not* match against
each line of the message independently, so the strings will each line of the message independently, so the strings will
usually contain CRLFs. How these can be matched is governed by usually contain CRLFs. How these can be matched is governed by
the comparator and match-type. For example, with the default the comparator and match-type. For example, with the default
comparator of "i;ascii-casemap", they can be included literally comparator of "i;ascii-casemap", they can be included literally
in key string, or be matched with the "*" or "?" wildcards of in key string, or be matched with the "*" or "?" wildcards of
the :matches match-type, or be skipped with :contains. the :matches match-type, or be skipped with :contains.
4. Body Transform 5. Body Transform
Prior to matching content in a message body, "transformations" Prior to matching content in a message body, "transformations"
can be applied that filter and decode certain parts of the body. can be applied that filter and decode certain parts of the body.
These transformations are selected by a "BODY-TRANSFORM" These transformations are selected by a "BODY-TRANSFORM"
keyword parameter. keyword parameter.
Usage: ":raw" Usage: ":raw"
/ ":content" <content-types: string-list> / ":content" <content-types: string-list>
/ ":text" / ":text"
The default transformation is :text. The default transformation is :text.
4.1 Body Transform ":raw" 5.1 Body Transform ":raw"
The ":raw" transform matches against the entire, undecoded body The ":raw" transform matches against the entire, undecoded body
of a message as a single item. of a message as a single item.
If the specified body-transform is ":raw", the [MIME] structure If the specified body-transform is ":raw", the [MIME] structure
of the body is irrelevant. The implementation MUST NOT remove of the body is irrelevant. The implementation MUST NOT remove
any transfer encoding from the message, MUST NOT refuse to filter any transfer encoding from the message, MUST NOT refuse to filter
messages with syntactic errors (unless the environment it is messages with syntactic errors (unless the environment it is
part of rejects them outright), and MUST treat multipart boundaries part of rejects them outright), and MUST treat multipart boundaries
or the MIME headers of enclosed body parts as part of the content or the MIME headers of enclosed body parts as part of the content
skipping to change at page 4, line 18 skipping to change at page 4, line 18
# This will match a message containing the literal text # This will match a message containing the literal text
# "MAKE MONEY FAST" in body parts (ignoring any # "MAKE MONEY FAST" in body parts (ignoring any
# content-transfer-encodings) or MIME headers other than # content-transfer-encodings) or MIME headers other than
# the outermost RFC 2822 header. # the outermost RFC 2822 header.
if body :raw :contains "MAKE MONEY FAST" { if body :raw :contains "MAKE MONEY FAST" {
discard; discard;
} }
4.2 Body Transform ":content" 5.2 Body Transform ":content"
If the body transform is ":content", the MIME parts that have If the body transform is ":content", the MIME parts that have
the specified content-types are matched against independently, the specified content-types are matched against independently,
each the entire part as a single string. each the entire part as a single string.
If an individual content type begins or ends with a '/' (slash) If an individual content type begins or ends with a '/' (slash)
or contains multiple slashes, it matches no content types. or contains multiple slashes, it matches no content types.
Otherwise, if it contains a slash, then it specifies a full Otherwise, if it contains a slash, then it specifies a full
<type>/<subtype> pair, and matches only that specific content <type>/<subtype> pair, and matches only that specific content
type. If it is the empty string, all MIME content types are type. If it is the empty string, all MIME content types are
skipping to change at page 7, line 5 skipping to change at page 7, line 5
fileinto "secrets"; fileinto "secrets";
} }
# Save any message with an audio/mp3 MIME part in # Save any message with an audio/mp3 MIME part in
# the "jukebox" folder. # the "jukebox" folder.
if body :content "audio/mp3" :contains "" { if body :content "audio/mp3" :contains "" {
fileinto "jukebox"; fileinto "jukebox";
} }
4.3 Body Transform ":text" 5.3 Body Transform ":text"
The ":text" body transform matches against the results of The ":text" body transform matches against the results of
an implementation's best effort at extracting UTF-8 encoded an implementation's best effort at extracting UTF-8 encoded
text from a message. text from a message.
It is unspecified whether this transformation results in a single It is unspecified whether this transformation results in a single
string or multiple strings being matched against. All the text string or multiple strings being matched against. All the text
extracted from a given non-container MIME part MUST be in the extracted from a given non-container MIME part MUST be in the
same string same string
skipping to change at page 7, line 36 skipping to change at page 7, line 36
Example: Example:
require ["body", "fileinto"]; require ["body", "fileinto"];
# Save messages mentioning the project schedule in the # Save messages mentioning the project schedule in the
# project/schedule folder. # project/schedule folder.
if body :text :contains "project schedule" { if body :text :contains "project schedule" {
fileinto "project/schedule"; fileinto "project/schedule";
} }
5. Interaction with Other Sieve Extensions 6. Interaction with Other Sieve Extensions
Any extension that extends the grammar for the COMPARATOR or Any extension that extends the grammar for the COMPARATOR or
MATCH-TYPE nonterminals will also affect the implementation of MATCH-TYPE nonterminals will also affect the implementation of
"body". "body".
Wildcard expressions used with "body" are exempt from the side Wildcard expressions used with "body" are exempt from the side
effects described in [VARIABLES]. That is, they MUST NOT set effects described in [VARIABLES]. That is, they MUST NOT set
match variables (${1}, ${2}...) to the input values corresponding match variables (${1}, ${2}...) to the input values corresponding
to wild card sequences in the matched pattern. However, if the to wildcard sequences in the matched pattern. However, if the
extension is present, variable references in the key strings or extension is present, variable references in the key strings or
content type strings are evaluated as described in the draft. content type strings are evaluated as described in the draft.
6. IANA Considerations 7. IANA Considerations
The following template specifies the IANA registration of the Sieve The following template specifies the IANA registration of the Sieve
extension specified in this document: extension specified in this document:
To: iana@iana.org To: iana@iana.org
Subject: Registration of new Sieve extension Subject: Registration of new Sieve extension
Capability name: body Capability name: body
Description: adds the 'body' test for matching against the Description: Provides a test for matching against the
the body of the message being processed the body of the message being processed
RFC number: this RFC RFC number: this RFC
Contact Address: Jutta Degener <jutta@pobox.com> Contact Address: Jutta Degener <jutta@pobox.com>
This information should be added to the list of sieve extensions This information should be added to the list of sieve extensions
given on http://www.iana.org/assignments/sieve-extensions. given on http://www.iana.org/assignments/sieve-extensions.
7. Security Considerations 8. Security Considerations
The system MUST be sized and restricted in such a manner that The system MUST be sized and restricted in such a manner that
even malicious use of body matching does not deny service to even malicious use of body matching does not deny service to
other users of the host system. other users of the host system.
Filters relying on string matches in the raw body of an email Filters relying on string matches in the raw body of an email
message may be more general than intended. Text matches are no message may be more general than intended. Text matches are no
replacement for a spam, virus, or other security related replacement for a spam, virus, or other security related
filtering system. filtering system.
8. Acknowledgments 9. Acknowledgments
This document has been revised in part based on comments and This document has been revised in part based on comments and
discussions that took place on and off the SIEVE mailing list. discussions that took place on and off the SIEVE mailing list.
Thanks to Cyrus Daboo, Ned Freed, Bob Johannessen, Simon Josefsson, Thanks to Cyrus Daboo, Ned Freed, Bob Johannessen, Simon Josefsson,
Mark E. Mallett, Chris Markle, Alexey Melnikov, Ken Murchison, Mark E. Mallett, Chris Markle, Alexey Melnikov, Ken Murchison,
Greg Shapiro, Tim Showalter, Nigel Swinson, and Dowson Tong for Greg Shapiro, Tim Showalter, Nigel Swinson, Dowson Tong, and
reviews and suggestions. Christian Vogt for reviews and suggestions.
9. Authors' Addresses 10. Authors' Addresses
Jutta Degener Jutta Degener
5245 College Ave, Suite #127 5245 College Ave, Suite #127
Oakland, CA 94618 Oakland, CA 94618
Email: jutta@pobox.com Email: jutta@pobox.com
Philip Guenther Philip Guenther
Sendmail, Inc. Sendmail, Inc.
6425 Christie Ave, 4th Floor 6425 Christie Ave, 4th Floor
Emeryville, CA 94608 Emeryville, CA 94608
Email: guenther@sendmail.com Email: guenther@sendmail.com
10. Discussion 11. Discussion
This section will be removed when this document leaves the This section will be removed when this document leaves the
Internet-Draft stage. Internet-Draft stage.
This draft is intended as an extension to the Sieve mail filtering This draft is intended as an extension to the Sieve mail filtering
language. Sieve extensions are discussed on the MTA Filters mailing language. Sieve extensions are discussed on the MTA Filters mailing
list at <ietf-mta-filters@imc.org>. Subscription requests can list at <ietf-mta-filters@imc.org>. Subscription requests can
be sent to <ietf-mta-filters-request@imc.org> (send an email be sent to <ietf-mta-filters-request@imc.org> (send an email
message with the word "subscribe" in the body). message with the word "subscribe" in the body).
More information on the mailing list along with a WWW archive of More information on the mailing list along with a WWW archive of
back messages is available at <http://www.imc.org/ietf-mta-filters/>. back messages is available at <http://www.imc.org/ietf-mta-filters/>.
10.1 Changes from draft-ietf-sieve-body-07.txt 11.1 Changes from draft-ietf-sieve-body-08.txt
Add a "Capability Identifier" section to match existing RFCs.
Make the normative and information references subsections of a
"References" section to match existing RFCs.
Tweak description field of the IANA registration.
Change "wild card" to "wildcard".
11.2 Changes from draft-ietf-sieve-body-07.txt
Clarify how transforms generate one or more strings to match against. Clarify how transforms generate one or more strings to match against.
Reiterate the default COMPARATOR and MATCH-TYPE from the base spec. Reiterate the default COMPARATOR and MATCH-TYPE from the base spec.
[SIEVE] and [VARIABLES] have been published. [SIEVE] and [VARIABLES] have been published.
10.2 Changes from draft-ietf-sieve-body-06.txt 11.3 Changes from draft-ietf-sieve-body-06.txt
Changed "matched text" to "matched content". Drop the word Changed "matched text" to "matched content". Drop the word
"proposed". "proposed".
10.3 Changes from draft-ietf-sieve-body-05.txt 11.4 Changes from draft-ietf-sieve-body-05.txt
Updated boilerplate to match RFC 4748. Updated boilerplate to match RFC 4748.
Added "Intended-Status: Standards Track" and Added "Intended-Status: Standards Track" and
"Updates: draft-ietf-sieve-variables-08" "Updates: draft-ietf-sieve-variables-08"
Change the references from appendices to sections. Change the references from appendices to sections.
Update [SIEVE] reference. Update [SIEVE] reference.
10.4 Changes from draft-ietf-sieve-body-04.txt 11.5 Changes from draft-ietf-sieve-body-04.txt
Changed 'reject' to 'discard' in the example. Changed 'reject' to 'discard' in the example.
Removed reference to regex draft. Removed reference to regex draft.
Update copyright boilerplate. Update copyright boilerplate.
10.5 Changes from draft-ietf-sieve-body-03.txt 11.6 Changes from draft-ietf-sieve-body-03.txt
Update IANA registration to match 3028bis. Update IANA registration to match 3028bis.
Added direct boilerplate for [KEYWORDS]. Added direct boilerplate for [KEYWORDS].
10.6 Changes from draft-ietf-sieve-body-02.txt 11.7 Changes from draft-ietf-sieve-body-02.txt
Updated charset conversion to match draft-ietf-sieve-3028bis-06.txt. Updated charset conversion to match draft-ietf-sieve-3028bis-06.txt.
Change "Syntax:" to "Usage:". Change "Syntax:" to "Usage:".
Updated references. Updated references.
10.7 Changes from draft-ietf-sieve-body-01.txt 11.8 Changes from draft-ietf-sieve-body-01.txt
Updated charset conversion requirements to match those in Updated charset conversion requirements to match those in
draft-ietf-sieve-3028bis-03.txt for headers. draft-ietf-sieve-3028bis-03.txt for headers.
10.8 Changes from draft-ietf-sieve-body-00.txt 11.9 Changes from draft-ietf-sieve-body-00.txt
Updated IPR boilerplate to RFC 3978/3979. Updated IPR boilerplate to RFC 3978/3979.
Many prose corrections in response to WGLC comments. Of particular Many prose corrections in response to WGLC comments. Of particular
note: note:
- made clear that :raw treats MIME boundaries and headers as - made clear that :raw treats MIME boundaries and headers as
text to be matched against text to be matched against
- corrected description in comment of :raw example - corrected description in comment of :raw example
- clarified the interpretation of invalid content-types in - clarified the interpretation of invalid content-types in
:content :content
- gave precise description of what gets matched when :content - gave precise description of what gets matched when :content
is used with message/rfc822 or any multipart type, as well is used with message/rfc822 or any multipart type, as well
as a comprehensive example as a comprehensive example
- include an example of :text - include an example of :text
- tightened wording of interaction with [VARIABLES] - tightened wording of interaction with [VARIABLES]
- added informative reference to [REGEX] - added informative reference to [REGEX]
10.9 Changes from draft-degener-sieve-body-04.txt 11.10 Changes from draft-degener-sieve-body-04.txt
Renamed to draft-ietf-sieve-body-00.txt; tweaked the title and Renamed to draft-ietf-sieve-body-00.txt; tweaked the title and
abstract. abstract.
Added Philip Guenther as co-author. Added Philip Guenther as co-author.
Split references into normative and informative. Updated [UTF-8] Split references into normative and informative. Updated [UTF-8]
and [VARIABLES] references. and [VARIABLES] references.
Updated IPR boilerplate. Updated IPR boilerplate.
10.10 Changes from draft-degener-sieve-body-03.txt 11.11 Changes from draft-degener-sieve-body-03.txt
Made "body" exempt from variable-setting side effects in the Made "body" exempt from variable-setting side effects in the
presence of the "variables" extension and wild cards. It's too presence of the "variables" extension and wildcards. It's too
hard to implement. hard to implement.
Removed :binary. It's uglier and less useful than it needs to be Removed :binary. It's uglier and less useful than it needs to be
to bother. to bother.
Added IANA section. Added IANA section.
11. Normative References 12. References
12.1. Normative References
[KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 15, RFC 2119, March 1997. Requirement Levels", BCP 15, RFC 2119, March 1997.
[MIME] Freed, N. and N. Borenstein, "Multipurpose Internet Mail [MIME] 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.
[SIEVE] Guenther, P. and T. Showalter, "Sieve: An Email [SIEVE] Guenther, P. and T. Showalter, "Sieve: An Email
Filtering Language", RFC 5228, January 2008. Filtering Language", RFC 5228, January 2008.
[UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO
10646", RFC 3629, November 2003. 10646", RFC 3629, November 2003.
12. Informative References 12.2. Informative References
[VARIABLES] Homme, K., "Sieve Email Filtering: Variables Extension", [VARIABLES] Homme, K., "Sieve Email Filtering: Variables Extension",
RFC 5229, January 2008. RFC 5229, January 2008.
Full Copyright Statement Full Copyright Statement
Copyright (C) The IETF Trust (2008). Copyright (C) The IETF Trust (2008).
This document is subject to the rights, licenses and restrictions This document is subject to the rights, licenses and restrictions
contained in BCP 78, and except as set forth therein, the authors contained in BCP 78, and except as set forth therein, the authors
 End of changes. 31 change blocks. 
31 lines changed or deleted 45 lines changed or added

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