idnits 2.17.1 draft-ietf-extra-sieve-special-use-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 (January 7, 2018) is 2299 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) -- Obsolete informational reference (is this intentional?): RFC 3501 (ref. 'IMAP') (Obsoleted by RFC 9051) Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 EXTRA S. Bosch 3 Internet-Draft Dovecot Oy 4 Intended status: Standards Track January 7, 2018 5 Expires: July 11, 2018 7 Sieve Email Filtering: Delivering to Special-Use Mailboxes 8 draft-ietf-extra-sieve-special-use-01 10 Abstract 12 The SPECIAL-USE capability of the IMAP protocol (RFC 6154) allows 13 clients to identify special-use mailboxes; e.g., where draft or sent 14 messages should be put. This simplifies client configuration. In 15 contrast, the Sieve mail filtering language (RFC 5228) currently has 16 no such capability. This memo defines a Sieve extension that fills 17 this gap: it adds a test for checking whether a special-use attribute 18 is assigned for a particular mailbox or any mailbox, and it adds the 19 ability to file messages into an anonymous mailbox that has a 20 particular special-use attribute assigned. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on July 11, 2018. 39 Copyright Notice 41 Copyright (c) 2018 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 57 2. Conventions Used in This Document . . . . . . . . . . . . . . 3 58 3. Test "specialuse_exists" . . . . . . . . . . . . . . . . . . 3 59 4. ":specialuse" Argument to "fileinto" Command . . . . . . . . 4 60 4.1. Interaction with ":create" Argument to "fileinto" Command 5 61 5. Sieve Capability Strings . . . . . . . . . . . . . . . . . . 5 62 6. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 5 63 7. Security Considerations . . . . . . . . . . . . . . . . . . . 6 64 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 65 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7 66 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 67 10.1. Normative References . . . . . . . . . . . . . . . . . . 7 68 10.2. Informative References . . . . . . . . . . . . . . . . . 8 69 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 71 1. Introduction 73 Commonly, several mailboxes in an IMAP message store [IMAP] have a 74 special use; e.g. it is where the user's draft messages are stored, 75 where a copy of sent messages are kept, or it is where spam messages 76 are filed automatically at delivery. The SPECIAL-USE capability 77 [SPECIAL-USE] of the IMAP protocol defines mailbox attributes that 78 identify these special mailboxes explicitly to the client. This way, 79 client configuration is simplified significantly. Using the CREATE- 80 SPECIAL-USE capability [SPECIAL-USE], IMAP clients can also configure 81 these attributes dynamically based on user preference. 83 Unlike the IMAP protocol, the Sieve mail filtering language [SIEVE] 84 currently cannot freely access these special-use mailbox attributes. 85 Particularly, the Sieve interpreter cannot find an anonymous mailbox 86 that has a particular special-use attribute assigned. This would be 87 very useful for example to find the user's Spam mailbox at delivery. 89 In Sieve, limited access to the special-use attributes is provided 90 using the "mboxmetadata" extension [SIEVE-MAILBOX], which allows 91 testing for the presence of a special-use attribute in the "/private/ 92 specialuse" IMAP METADATA [IMAP-METADATA] entry of a mailbox. Still, 93 not all implementers will be willing to add the complexity of the 94 IMAP METADATA capability, just to provide access to special-use 95 attributes to the Sieve interpreter. 97 This document defines an extension to the Sieve mail filtering 98 language that adds the ability to freely access mailbox special-use 99 attributes. It adds a test called "specialuse_exists" that checks 100 whether a special-use attribute is assigned for a particular mailbox 101 or - if omitted - any mailbox. It also adds the ability to file 102 messages into an anonymous mailbox that has a particular special-use 103 attribute assigned using a ":specialuse" argument for the "fileinto" 104 command [SIEVE]. 106 2. Conventions Used in This Document 108 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 109 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 110 document are to be interpreted as described in [KEYWORDS]. 112 Conventions for notations are as in [SIEVE] Section 1.1, including 113 use of the "Usage:" label for the definition of action and tagged 114 arguments syntax. 116 3. Test "specialuse_exists" 118 Usage: specialuse_exists [] 119 121 If the "mailbox" string argument is omitted, the "specialuse_exists" 122 test yields true if all of the following statements are true for each 123 of the special-use flags listed in the "special-use-flags" argument: 125 a. at least one mailbox exists in the mail store that has that 126 particular special-use flag assigned, and 128 b. that mailbox allows the user in whose context the Sieve script 129 runs to "deliver" messages into it. 131 If the "mailbox" argument is specified, the "specialuse_exists" test 132 yields true if all of the following statements are true: 134 a. the indicated mailbox exists, 136 b. that mailbox allows the user in whose context the Sieve script 137 runs to "deliver" messages into it, and 139 c. that mailbox has all of the special-use flags listed in the 140 "special-use-flags" argument assigned to it. 142 Refer to the specification of the "mailboxexists" test in Section 3.1 143 of RFC 5490 [SIEVE-MAILBOX] for a definition of when "delivery" of 144 messages into a mailbox is deemed possible. 146 4. ":specialuse" Argument to "fileinto" Command 148 Usage: fileinto [:specialuse ] 149 151 Normally, the "fileinto" command delivers the message in the mailbox 152 specified using its positional mailbox argument. However, if the 153 optional ":specialuse" argument is also specified, the "fileinto" 154 command first checks whether a mailbox exists with the specified 155 special-use flag assigned to it. If that is the case, that special- 156 use mailbox is used for delivery instead. If there is no such 157 mailbox or if the specified special-use flag is unknown to the 158 implementation in general, the "fileinto" action proceeds as it would 159 without the ":specialuse" argument. 161 Summarizing, if the ":specialuse" argument is specified, the fileinto 162 command deals with two mailboxes that may or may not exist: 164 o An anonymous special-use mailbox, which has at least the special- 165 use flag specified with the ":specialuse" argument assigned to it. 167 o The default mailbox named by the positional string argument of the 168 "fileinto" command, which is used when the special-use mailbox is 169 not found. 171 The special-use flag specified with the ":specialuse" argument MUST 172 conform to the "use-attr" syntax described in Section 6 of RFC6154 173 [SIEVE-MAILBOX]. Implementations SHOULD handle an invalid special- 174 use flag in the same way as an invalid mailbox name is handled. The 175 string parameter of the ":specialuse" argument is not a constant 176 string, which means that variable substitutions are allowed when the 177 "variables" extension [VARIABLES] is active. In that case, the 178 syntax of the special-use flag is only verified at runtime. 180 If neither the special-use mailbox nor the default mailbox exists, 181 the "fileinto" action MUST proceed exactly as it does in case the 182 ":specialuse" is argument is absent and the mailbox named by its 183 positional argument does not exist. The various options for handling 184 this situation are described in Section 4.1 of RFC5228 [SIEVE]. 186 More than one mailbox can have a particular special-use flag 187 assigned. In that case, the mailbox that is chosen for delivery is 188 implementation-defined. However, implementations MUST ensure that 189 this choice is made consistently, so that the same mailbox is used 190 every time. 192 If delivery to the special-use mailbox fails for reasons not relating 193 to its existence, the Sieve interpreter MUST NOT subsequently attempt 194 delivery in the indicated default mailbox as a fall-back. Instead, 195 it MUST proceed exactly as it does in case the ":specialuse" argument 196 is absent and delivery to the mailbox named by its positional 197 argument fails. This prevents the situation where messages are 198 unexpectedly spread over two mailboxes in case transient or 199 intermittent delivery failures occur. 201 4.1. Interaction with ":create" Argument to "fileinto" Command 203 The "mailbox" extension [SIEVE-MAILBOX] adds the optional ":create" 204 argument to the "fileinto" command. If the optional ":create" 205 argument is specified with "fileinto", it instructs the Sieve 206 interpreter to create the specified mailbox if needed, before 207 attempting to deliver the message into the specified mailbox. 209 When combined with the ":specialuse" argument, the ":create" argument 210 instructs the Sieve interpreter to create the specified default 211 mailbox if needed. This need arises when both the special-use and 212 the default mailbox are not found. 214 If the server implementation supports the CREATE-SPECIAL-USE 215 capability [SPECIAL-USE] for IMAP, i.e. it allows assigning special- 216 use flags to new mailboxes, it SHOULD assign the special-use flag 217 specified with the ":specialuse" argument to the newly created 218 mailbox. 220 5. Sieve Capability Strings 222 A Sieve implementation that defines the "specialuse_exists" test and 223 the ":specialuse" argument for the "fileinto" command will advertise 224 the capability string "special-use". 226 6. Examples 228 The following example saves the message in the mailbox where messages 229 deemed to be junk mail are held. This mailbox is identified using 230 the "\Junk" special-use attribute. If no mailbox has this attribute 231 assigned, the message is filed into the mailbox named "Spam". 233 require "fileinto"; 234 require "special-use"; 236 fileinto :specialuse "\\Junk" "Spam"; 238 The following very similar example handles the case in which neither 239 a "\Junk" special-use mailbox nor the "Spam" mailbox exist. In that 240 case, a mailbox called "Spam" is created, and the message is stored 241 there. Additionally, the "\Junk" special-use attribute may be 242 assigned to it. 244 require "fileinto"; 245 require "special-use"; 246 require "mailbox"; 248 fileinto :specialuse "\\Junk" :create "Spam"; 250 The following example is used in a Sieve script that is triggered 251 from an IMAP event, rather than at message delivery [IMAPSIEVE]. 252 This Sieve script redirects messages to an automated recipient that 253 processes junk mail, if those messages are copied or moved into a 254 mailbox that has the "\Junk" special-use attribute assigned. 256 require "imapsieve"; 257 require "special-use"; 258 require "environment"; 259 require "variables"; 261 if environment :contains "imap.mailbox" "*" { 262 set "mailbox" "${1}"; 263 } 265 if allof( 266 environment "imap.cause" "COPY", 267 specialuse_exists "${mailbox}" "\\Junk") { 268 redirect "spam-report@example.org"; 269 } 271 7. Security Considerations 273 Security considerations are discussed in [SIEVE], [VARIABLES], and 274 [SPECIAL-USE]. It is believed that this extension does not introduce 275 any additional security concerns. 277 8. IANA Considerations 279 The following template specifies the IANA registration of the Sieve 280 extension specified in this document: 282 To: iana@iana.org 283 Subject: Registration of new Sieve extension 285 Capability name: special-use 286 Description: adds a test for checking whether an IMAP 287 special-use attribute is assigned for a 288 particular mailbox or any mailbox, and it adds 289 the ability to file messages into an anonymous 290 mailbox that has a particular IMAP special-use 291 attribute assigned. 292 RFC number: this RFC 293 Contact address: Sieve mailing list 295 This information should be added to the list of sieve extensions 296 given on http://www.iana.org/assignments/sieve-extensions. 298 9. Acknowledgements 300 Thanks to Stan Kalisch, Barry Leiba, Alexey Melnikov, Ken Murchison, 301 and Ned Freed for reviews and suggestions. 303 Thanks to the authors of RFC5490 [SIEVE-MAILBOX] from which some 304 descriptive text is borrowed in this document. 306 10. References 308 10.1. Normative References 310 [IMAP-METADATA] 311 Daboo, C., "The IMAP METADATA Extension", RFC 5464, 312 DOI 10.17487/RFC5464, February 2009, 313 . 315 [KEYWORDS] 316 Bradner, S., "Key words for use in RFCs to Indicate 317 Requirement Levels", BCP 14, RFC 2119, March 1997. 319 [SIEVE] Guenther, P. and T. Showalter, "Sieve: An Email Filtering 320 Language", RFC 5228, January 2008. 322 [SIEVE-MAILBOX] 323 Melnikov, A., "The Sieve Mail-Filtering Language -- 324 Extensions for Checking Mailbox Status and Accessing 325 Mailbox Metadata", RFC 5490, March 2009. 327 [SPECIAL-USE] 328 Leiba, B. and J. Nicolson, "IMAP LIST Extension for 329 Special-Use Mailboxes", RFC 6154, DOI 10.17487/RFC6154, 330 March 2011, . 332 [VARIABLES] 333 Homme, K., "Sieve Email Filtering: Variables Extension", 334 RFC 5229, January 2008. 336 10.2. Informative References 338 [IMAP] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 339 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003, 340 . 342 [IMAPSIEVE] 343 Leiba, B., "Support for Internet Message Access Protocol 344 (IMAP) Events in Sieve", RFC 6785, DOI 10.17487/RFC6785, 345 November 2012, . 347 Author's Address 349 Stephan Bosch 350 Dovecot Oy 351 Lars Sonckin Kaari 10 352 Espoo 02600 353 Finland 355 Email: stephan.bosch@dovecot.fi