Network Working Group C. Daboo Internet-Draft Cyrusoft International, Inc. Expires: August 4, 2004 February 4, 2004 SIEVE Email Filtering: MIME Extension draft-daboo-sieve-mime-00 Status of this Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http:// www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on August 4, 2004. Copyright Notice Copyright (C) The Internet Society (2004). All Rights Reserved. Abstract This document describes the SIEVE Email Filtering "mime" extension which adds a new test for testing the values of MIME headers in a message. Open Issues (will be removed prior to publication as an RFC) a. How to deal with MIME encoding/splitting of parameters, i18n etc Change History (to be removed prior to publication as an RFC) Changes: a. Initial draft. Daboo Expires August 4, 2004 [Page 1] Internet-Draft SIEVE Email Filtering: MIME Extension February 2004 Table of Contents 1. Introduction and Overview . . . . . . . . . . . . . . . . . . 3 2. Conventions Used in This Document . . . . . . . . . . . . . . 3 3. SIEVE MIME Extension . . . . . . . . . . . . . . . . . . . . . 3 3.1 General Considerations . . . . . . . . . . . . . . . . . . . . 3 3.2 Test "mime" . . . . . . . . . . . . . . . . . . . . . . . . . 3 4. Security Considerations . . . . . . . . . . . . . . . . . . . 5 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 5.1 mime registration . . . . . . . . . . . . . . . . . . . . . . 5 References . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 6 Intellectual Property and Copyright Statements . . . . . . . . 7 Daboo Expires August 4, 2004 [Page 2] Internet-Draft SIEVE Email Filtering: MIME Extension February 2004 1. Introduction and Overview The SIEVE Email Filtering [RFC3028] specification currently does not provide a way to test the values of MIME [RFC2045] part headers within a message. Currently, all that can be done is a standard "header" test against the top-level message headers (and thus the top-level MIME part of the message). However, it is handy to be able to check for values in any MIME part headers, or check for the presence of specific MIME types etc. This extension introduces a new "mime" test that allows the values of every MIME part header to be tested. 2. Conventions Used in This Document Conventions for notations are as in [RFC3028] section 1.1, including use of [RFC2119]. 3. SIEVE MIME Extension 3.1 General Considerations SIEVE implementations that implement the "mime" test have an identifier of "mime" for use with the capability mechanism. If the "mime" test is used in a SIEVE script, the corresponding capability item MUST appear in the script's "require" statement. Like the "header" test in [RFC3028], folding of long header lines (as described in [RFC2822]) is removed prior to interpretation of the data. 3.2 Test "mime" Syntax: mime [COMPARATOR] [MATCH-TYPE] [] The "mime" test evaluates to true if any MIME header name, or any parameter within a MIME header name, matches any key. The type of match is specified by the optional match argument, which defaults to ":is" if not provided, as specified in section 2.6 of [RFC3028]. If no parameter-names argument is present, then the entire content of the headers specified in the header-names argument is evaluated. So if a message contained the MIME header: Content-Type: image/jpeg; filename="example.jpg" these tests on that MIME header evaluate as follows: Daboo Expires August 4, 2004 [Page 3] Internet-Draft SIEVE Email Filtering: MIME Extension February 2004 mime :contains ["Content-Type"] ["image"] => true mime :contains ["Content-Type"] ["jpg"] => true mime :contains ["Content-Type"] ["filename"] => true mime :contains ["Content-Type"] ["gif"] => false If the parameter-names argument is present, then only the content of matching MIME parameters in the specified headers are evaluated. So if a message contained the MIME header: Content-Type: image/jpeg; filename="example.jpg" these tests on that MIME header evaluate as follows: mime :contains ["Content-Type"] ["filename"] ["image"] => false mime :contains ["Content-Type"] ["filename"] ["jpg"] => true mime :contains ["Content-Type"] ["filename"] ["filename"] => false mime :contains ["Content-Type"] ["filename"] ["gif"] => false mime :contains ["Content-Type"] ["name"] ["jpg"] => false If the parameter-names argument is present, but contains a single empty string, then the content of specified MIME header, excluding any parameters, will be evaluated. So if a message contained the MIME header: Content-Type: image/jpeg; filename="example.jpg" these tests on that MIME header evaluate as follows: mime :contains ["Content-Type"] [""] ["image"] => true mime :contains ["Content-Type"] [""] ["jpg"] => false mime :contains ["Content-Type"] [""] ["filename"] => false mime :contains ["Content-Type"] [""] ["gif"] => false Like the "header" test in [RFC3028], this test returns true if any combination of the header-names, parameters-names and key-list arguments match. Like the "header" test in [RFC3028], if a MIME header listed in the header-names argument exists, it contains the null key (""). However, if the named header is not present, it does not contain the null key. So if a message contained the MIME header: Content-Caffeine: C8H10N4O2 these tests on that header evaluate as follows: mime :is ["Content-Caffeine"] [""] => false mime :contains ["Content-Caffeine"] [""] => true Daboo Expires August 4, 2004 [Page 4] Internet-Draft SIEVE Email Filtering: MIME Extension February 2004 A similar behaviour applies to MIME parameters specified by the parameter-names argument: Content-Caffeine: C8H10N4O2; param1=example these tests on that parameter evaluate as follows: mime :is ["Content-Caffeine"] ["param1"] [""] => false mime :contains ["Content-Caffeine"] ["param1"] [""] => true 4. Security Considerations The "mime" extension does not raise any security considerations that are not present in the base [RFC3028] protocol, and these issues are discussed in [RFC3028]. 5. IANA Considerations The following template specifies the IANA registration of the Sieve extension specified in this document: 5.1 mime registration To: iana@iana.org Subject: Registration of new Sieve extension Capability name: mime Capability keyword: mime Capability arguments: mime [COMPARATOR] [MATCH-TYPE] [] Standards Track/IESG-approved experimental RFC number: this RFC Person and email address to contact for further information: Cyrus Daboo Cyrusoft International, Inc. 5001 Baum Blvd., Suite 780, Pittsburgh, PA 15213 U.S.A. This information should be added to the list of sieve extensions given on http://www.iana.org/assignments/sieve-extensions. Daboo Expires August 4, 2004 [Page 5] Internet-Draft SIEVE Email Filtering: MIME Extension February 2004 References [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2822] Resnick, P., "Internet Message Format", RFC 2822, April 2001. [RFC3028] Showalter, T., "Sieve: A Mail Filtering Language", RFC 3028, January 2001. Author's Address Cyrus Daboo Cyrusoft International, Inc. 5001 Baum Blvd. Suite 780 Pittsburgh, PA 15213 US EMail: daboo@cyrusoft.com Daboo Expires August 4, 2004 [Page 6] Internet-Draft SIEVE Email Filtering: MIME Extension February 2004 Intellectual Property Statement The IETF takes no position regarding the validity or scope of any intellectual property 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; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication 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 implementors or users of this specification can be obtained from the IETF Secretariat. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address the information to the IETF Executive Director. Full Copyright Statement Copyright (C) The Internet Society (2004). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assignees. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION Daboo Expires August 4, 2004 [Page 7] Internet-Draft SIEVE Email Filtering: MIME Extension February 2004 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Acknowledgment Funding for the RFC Editor function is currently provided by the Internet Society. Daboo Expires August 4, 2004 [Page 8]