Independent Submission | K. Murchison |
Internet-Draft | FastMail |
Intended status: Standards Track | March 5, 2020 |
Expires: September 6, 2020 |
JMAP for Sieve Scripts
draft-murchison-jmap-sieve-01
This document specifies a data model for managing Sieve scripts on a server using JMAP.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.
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."
This Internet-Draft will expire on September 6, 2020.
Copyright (c) 2020 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 (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
JMAP ([RFC8620] – JSON Meta Application Protocol) is a generic protocol for synchronizing data, such as mail, calendars or contacts, between a client and a server. It is optimized for mobile and web environments, and aims to provide a consistent interface to different data types.
This specification defines a data model for managing Sieve [RFC5228] scripts on a server using JMAP. The data model is designed to allow a server to provide consistent access to the same scripts via ManageSieve [RFC5804] as well as JMAP, however the functionality offered over the two protocols may differ.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
Type signatures, examples, and property descriptions in this document follow the conventions established in Section 1.1 of [RFC8620]. Data types defined in the core specification are also used in this document.
The same terminology is used in this document as in the core JMAP specification, see [RFC8620], Section 1.6.
The term SieveScript (with this specific capitalization) is used to refer to the data type defined in this document and instances of those data types.
The capabilities object is returned as part of the JMAP Session object; see [RFC8620], Section 2. This document defines one additional capability URI.
This represents support for the SieveScript data type and associated API methods. The value of this property in the JMAP Session capabilities property is an empty object.
The value of this property in an account’s accountCapabilities property is an object that MUST contain the following information on server capabilities:
A SieveScript object represents a single script on the server and has the following properties:
Example (using the Imap4Flags [RFC5232] Extension):
{ "id": "665c423a-6991-4733-8c7c-52b299572c66", "name": "example.siv", "content": "require [ \"imap4flags\" ];\r\nkeep :flags \"\\\\flagged\";", "isActive": false }
This is a standard "/get" method as described in [RFC8620], Section 5.1. The ids argument may be null to fetch all at once.
This method provides similar functionality to the GETSCRIPT and LISTSCRIPTS commands in [RFC5804].
This is a standard "/set" method as described in [RFC8620], Section 5.3.
This method provides similar functionality to the PUTSCRIPT, DELETESCRIPT, RENAMESCRIPT, and SETACTIVE commands in [RFC5804].
Per [RFC5804], Section 1.4, a user may have multiple Sieve scripts on the server, yet only one script may be active. Therefore, when changing the active script, the call to this method MUST both set the isActive argument on the currently active script to false and set it to true on the script to be activated.
The following extra SetError type is defined:
For "create" and "update":
This method is used by the client to verify Sieve script validity without storing the script on the server.
The method provides similar functionality to the CHECKSCRIPT command in [RFC5804].
The server MUST check the submitted script for syntactic validity, which includes checking that all Sieve extensions mentioned in Sieve script "require" statement(s) are supported by the Sieve interpreter. (Note that if the Sieve interpreter supports the Sieve "ihave" extension [RFC5463], any unrecognized/unsupported extension mentioned in the "ihave" test MUST NOT cause the syntactic validation failure.)
The SieveScript/validate method takes the following arguments:
The response has the following arguments:
All security considerations of JMAP [RFC8620] apply to this specification.
IANA will register the "sieve" JMAP Capability as follows:
Capability Name: urn:ietf:params:jmap:sieve
Specification document: this document
Intended use: common
Change Controller: IETF
Security and privacy considerations: this document, Section 3
The following sub-section registers a new error code in the JMAP Error Codes registry, as defined in [RFC8620].
JMAP Error Code: scriptIsActive
Intended use: common
Change controller: IETF
Reference: This document, section 2.5
Description: The client tried to activate a Sieve script, but another acript is already active.
The concepts in this document are based largely on those in [RFC5804]. The author would like to thank the authors of that document for providing both inspiration and some borrowed text for this document.
[RFC5232] | Melnikov, A., "Sieve Email Filtering: Imap4flags Extension", RFC 5232, DOI 10.17487/RFC5232, January 2008. |
[RFC5463] | Freed, N., "Sieve Email Filtering: Ihave Extension", RFC 5463, DOI 10.17487/RFC5463, March 2009. |
Changes since -00: