idnits 2.17.1 draft-murchison-jmap-sieve-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 5, 2020) is 1510 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Independent Submission K. Murchison 3 Internet-Draft FastMail 4 Intended status: Standards Track March 5, 2020 5 Expires: September 6, 2020 7 JMAP for Sieve Scripts 8 draft-murchison-jmap-sieve-01 10 Abstract 12 This document specifies a data model for managing Sieve scripts on a 13 server using JMAP. 15 Open Issues 17 o How should doing /set{create} with an existing script name be 18 handled? Should it fail or overwrite the existing script? Should 19 the /set request include an 'overwrite' boolean argument? 21 o Should setting isActive==true on a script automatically deactivate 22 any other existing active script, or should the client have to do 23 so itself (as is currently documented)? 25 o Do we want/need a SieveScript/copy method? 27 o Do we want to leverage draft-ietf-jmap-quotas to query Sieve 28 script storage quotas? 30 Status of This Memo 32 This Internet-Draft is submitted in full conformance with the 33 provisions of BCP 78 and BCP 79. 35 Internet-Drafts are working documents of the Internet Engineering 36 Task Force (IETF). Note that other groups may also distribute 37 working documents as Internet-Drafts. The list of current Internet- 38 Drafts is at https://datatracker.ietf.org/drafts/current/. 40 Internet-Drafts are draft documents valid for a maximum of six months 41 and may be updated, replaced, or obsoleted by other documents at any 42 time. It is inappropriate to use Internet-Drafts as reference 43 material or to cite them other than as "work in progress." 45 This Internet-Draft will expire on September 6, 2020. 47 Copyright Notice 49 Copyright (c) 2020 IETF Trust and the persons identified as the 50 document authors. All rights reserved. 52 This document is subject to BCP 78 and the IETF Trust's Legal 53 Provisions Relating to IETF Documents 54 (https://trustee.ietf.org/license-info) in effect on the date of 55 publication of this document. Please review these documents 56 carefully, as they describe your rights and restrictions with respect 57 to this document. Code Components extracted from this document must 58 include Simplified BSD License text as described in Section 4.e of 59 the Trust Legal Provisions and are provided without warranty as 60 described in the Simplified BSD License. 62 Table of Contents 64 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 65 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 66 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 67 1.3. Addition to the Capabilities Object . . . . . . . . . . . 3 68 1.3.1. urn:ietf:params:jmap:sieve . . . . . . . . . . . . . 3 69 2. Sieve Scripts . . . . . . . . . . . . . . . . . . . . . . . . 4 70 2.1. SieveScript/get . . . . . . . . . . . . . . . . . . . . . 5 71 2.2. SieveScript/set . . . . . . . . . . . . . . . . . . . . . 5 72 2.3. SieveScript/validate . . . . . . . . . . . . . . . . . . 5 73 3. Security Considerations . . . . . . . . . . . . . . . . . . . 6 74 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 75 4.1. JMAP Capability Registration for "sieve" . . . . . . . . 6 76 4.2. JMAP Error Codes Registry . . . . . . . . . . . . . . . . 7 77 4.2.1. scriptIsActive . . . . . . . . . . . . . . . . . . . 7 78 5. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7 79 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 80 6.1. Normative References . . . . . . . . . . . . . . . . . . 7 81 6.2. Informative References . . . . . . . . . . . . . . . . . 8 82 Appendix A. Change History (To be removed by RFC Editor before 83 publication) . . . . . . . . . . . . . . . . . . . . 8 84 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 86 1. Introduction 88 JMAP ([RFC8620] - JSON Meta Application Protocol) is a generic 89 protocol for synchronizing data, such as mail, calendars or contacts, 90 between a client and a server. It is optimized for mobile and web 91 environments, and aims to provide a consistent interface to different 92 data types. 94 This specification defines a data model for managing Sieve [RFC5228] 95 scripts on a server using JMAP. The data model is designed to allow 96 a server to provide consistent access to the same scripts via 97 ManageSieve [RFC5804] as well as JMAP, however the functionality 98 offered over the two protocols may differ. 100 1.1. Notational Conventions 102 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 103 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 104 "OPTIONAL" in this document are to be interpreted as described in BCP 105 14 [RFC2119] [RFC8174] when, and only when, they appear in all 106 capitals, as shown here. 108 Type signatures, examples, and property descriptions in this document 109 follow the conventions established in Section 1.1 of [RFC8620]. Data 110 types defined in the core specification are also used in this 111 document. 113 1.2. Terminology 115 The same terminology is used in this document as in the core JMAP 116 specification, see [RFC8620], Section 1.6. 118 The term SieveScript (with this specific capitalization) is used to 119 refer to the data type defined in this document and instances of 120 those data types. 122 1.3. Addition to the Capabilities Object 124 The capabilities object is returned as part of the JMAP Session 125 object; see [RFC8620], Section 2. This document defines one 126 additional capability URI. 128 1.3.1. urn:ietf:params:jmap:sieve 130 This represents support for the SieveScript data type and associated 131 API methods. The value of this property in the JMAP Session 132 capabilities property is an empty object. 134 The value of this property in an account's accountCapabilities 135 property is an object that MUST contain the following information on 136 server capabilities: 138 o *maxNumberRedirects*: "UnsignedInt|null" The maximum number of 139 Sieve "redirect" actions a script can perform during a single 140 evaluation (see [RFC5804], Section 1.7), or "null" for no limit. 142 o *maxNumberScripts*: "UnsignedInt|null" The maximum number of Sieve 143 scripts the server is willing to store for the user, or "null" for 144 no limit. 146 o *maxSizeScript*: "UnsignedInt|null" The maximum size (in octets) 147 of a Sieve script the server is willing to store for the user, or 148 "null" for no limit. 150 o *sieveExtensions*: "String[]" A list of Sieve extensions (as 151 listed in Sieve "require" action [RFC5228], Section 3.2) supported 152 by the Sieve engine. 154 o *notificationMethods*: "String[]|null" A list of URI schema parts 155 [RFC3986] for notification methods supported by the Sieve 156 "enotify" extension [RFC5435], or "null" if the extension is not 157 supported by the Sieve engine. 159 o *externalLists*: "String[]|null" A list of URI schema parts 160 [RFC3986] for externally stored list types supported by the Sieve 161 "extlists" extension [RFC6134], or "null" if the extension is not 162 supported by the Sieve engine. 164 2. Sieve Scripts 166 A *SieveScript* object represents a single script on the server and 167 has the following properties: 169 o *id*: "Id" (immutable; server-set) The id of the script. 171 o *name*: "String" The user-visible name for the script, subject to 172 the requirements in [RFC5804], Section 1.6. 174 o *content*: "String" The Sieve code in the script. Note that any 175 double (") quote or backslash (\) characters appearing in the 176 script content MUST be escaped by prefixing them with a backslash 177 (\). 179 o *isActive*: "Boolean" (default: false) Is this the user's active 180 script? 182 Example (using the Imap4Flags [RFC5232] Extension): 184 { 185 "id": "665c423a-6991-4733-8c7c-52b299572c66", 186 "name": "example.siv", 187 "content": 188 "require [ \"imap4flags\" ];\r\nkeep :flags \"\\\\flagged\";", 189 "isActive": false 190 } 192 2.1. SieveScript/get 194 This is a standard "/get" method as described in [RFC8620], 195 Section 5.1. The _ids_ argument may be "null" to fetch all at once. 197 This method provides similar functionality to the GETSCRIPT and 198 LISTSCRIPTS commands in [RFC5804]. 200 2.2. SieveScript/set 202 This is a standard "/set" method as described in [RFC8620], 203 Section 5.3. 205 This method provides similar functionality to the PUTSCRIPT, 206 DELETESCRIPT, RENAMESCRIPT, and SETACTIVE commands in [RFC5804]. 208 Per [RFC5804], Section 1.4, a user may have multiple Sieve scripts on 209 the server, yet only one script may be active. Therefore, when 210 changing the active script, the call to this method MUST both set the 211 _isActive_ argument on the currently active script to "false" and set 212 it to "true" on the script to be activated. 214 The following extra SetError type is defined: 216 For "create" and "update": 218 o *scriptIsActive*: The "isActive" argument was true and the user 219 already has another active script. The SetError object SHOULD 220 also include the *id* property of the currently active script. 222 2.3. SieveScript/validate 224 This method is used by the client to verify Sieve script validity 225 without storing the script on the server. 227 The method provides similar functionality to the CHECKSCRIPT command 228 in [RFC5804]. 230 The server MUST check the submitted script for syntactic validity, 231 which includes checking that all Sieve extensions mentioned in Sieve 232 script "require" statement(s) are supported by the Sieve interpreter. 233 (Note that if the Sieve interpreter supports the Sieve "ihave" 234 extension [RFC5463], any unrecognized/unsupported extension mentioned 235 in the "ihave" test MUST NOT cause the syntactic validation failure.) 237 The *SieveScript/validate* method takes the following arguments: 239 o *accountId*: "Id" The id of the account to use. 241 o *content*: "String" The Sieve code to validate. Note that any 242 double (") quote or backslash (\) characters appearing in the 243 script content MUST be escaped by prefixing them with a backslash 244 (\). 246 The response has the following arguments: 248 o *accountId*: "Id" The id of the account used for this call. 250 o *isValid*: "Boolean" Is the Sieve code valid? 252 o *errorDescription*: "String" A description of the error to show to 253 the user, or an empty string if the Sieve code is valid. 255 3. Security Considerations 257 All security considerations of JMAP [RFC8620] apply to this 258 specification. 260 4. IANA Considerations 262 4.1. JMAP Capability Registration for "sieve" 264 IANA will register the "sieve" JMAP Capability as follows: 266 Capability Name: "urn:ietf:params:jmap:sieve" 268 Specification document: this document 270 Intended use: common 272 Change Controller: IETF 274 Security and privacy considerations: this document, Section 3 276 4.2. JMAP Error Codes Registry 278 The following sub-section registers a new error code in the JMAP 279 Error Codes registry, as defined in [RFC8620]. 281 4.2.1. scriptIsActive 283 JMAP Error Code: scriptIsActive 285 Intended use: common 287 Change controller: IETF 289 Reference: This document, section 2.5 291 Description: The client tried to activate a Sieve script, but another 292 acript is already active. 294 5. Acknowledgments 296 The concepts in this document are based largely on those in 297 [RFC5804]. The author would like to thank the authors of that 298 document for providing both inspiration and some borrowed text for 299 this document. 301 6. References 303 6.1. Normative References 305 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 306 Requirement Levels", BCP 14, RFC 2119, 307 DOI 10.17487/RFC2119, March 1997, 308 . 310 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 311 Resource Identifier (URI): Generic Syntax", STD 66, 312 RFC 3986, DOI 10.17487/RFC3986, January 2005, 313 . 315 [RFC5228] Guenther, P., Ed. and T. Showalter, Ed., "Sieve: An Email 316 Filtering Language", RFC 5228, DOI 10.17487/RFC5228, 317 January 2008, . 319 [RFC5435] Melnikov, A., Ed., Leiba, B., Ed., Segmuller, W., and T. 320 Martin, "Sieve Email Filtering: Extension for 321 Notifications", RFC 5435, DOI 10.17487/RFC5435, January 322 2009, . 324 [RFC5804] Melnikov, A., Ed. and T. Martin, "A Protocol for Remotely 325 Managing Sieve Scripts", RFC 5804, DOI 10.17487/RFC5804, 326 July 2010, . 328 [RFC6134] Melnikov, A. and B. Leiba, "Sieve Extension: Externally 329 Stored Lists", RFC 6134, DOI 10.17487/RFC6134, July 2011, 330 . 332 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 333 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 334 May 2017, . 336 [RFC8620] Jenkins, N. and C. Newman, "The JSON Meta Application 337 Protocol (JMAP)", RFC 8620, DOI 10.17487/RFC8620, July 338 2019, . 340 6.2. Informative References 342 [RFC5232] Melnikov, A., "Sieve Email Filtering: Imap4flags 343 Extension", RFC 5232, DOI 10.17487/RFC5232, January 2008, 344 . 346 [RFC5463] Freed, N., "Sieve Email Filtering: Ihave Extension", 347 RFC 5463, DOI 10.17487/RFC5463, March 2009, 348 . 350 Appendix A. Change History (To be removed by RFC Editor before 351 publication) 353 Changes since -00: 355 o Added IANA registration for "scriptIsActive" JMAP error code. 357 o Added open issue about /set{create} with an existing script name. 359 Author's Address 361 Kenneth Murchison 362 Fastmail US LLC 363 1429 Walnut Street - Suite 1201 364 Philadelphia, PA 19102 365 USA 367 Email: murch@fastmailteam.com