idnits 2.17.1 draft-bosch-sieve-special-use-00.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 (April 4, 2016) is 2945 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) == Missing Reference: 'FIXME' is mentioned on line 272, but not defined -- Obsolete informational reference (is this intentional?): RFC 3501 (ref. 'IMAP') (Obsoleted by RFC 9051) Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group S. Bosch 3 Internet-Draft Dovecot Oy 4 Intended status: Standards Track April 4, 2016 5 Expires: October 6, 2016 7 Sieve Email Filtering: Delivering to Special-Use Mailboxes 8 draft-bosch-sieve-special-use-00 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 October 6, 2016. 39 Copyright Notice 41 Copyright (c) 2016 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. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 66 9.1. Normative References . . . . . . . . . . . . . . . . . . 7 67 9.2. Informative References . . . . . . . . . . . . . . . . . 8 68 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 70 1. Introduction 72 Commonly, several mailboxes in an IMAP message store [IMAP] have a 73 special use; e.g. it is where the user's draft messages are stored, 74 where a copy of sent messages are kept, or it is where spam messages 75 are filed automatically at delivery. The SPECIAL-USE capability 76 [SPECIAL-USE] of the IMAP protocol defines mailbox attributes that 77 identify these special mailboxes explicitly to the client. This way, 78 client configuration is simplified significantly. Using the CREATE- 79 SPECIAL-USE capability [SPECIAL-USE], IMAP clients can also configure 80 these attributes dynamically based on user preference. 82 Unlike the IMAP protocol, the Sieve mail filtering language [SIEVE] 83 currently cannot freely access these special-use mailbox attributes. 84 Particularly, the Sieve interpreter cannot find an anonymous mailbox 85 that has a particular special-use attribute assigned. This would be 86 very useful for example to find the user's Spam mailbox at delivery. 88 In Sieve, limited access to the special-use attributes is provided 89 using the "mboxmetadata" extension [MAILBOX], which allows testing 90 for the presence of a special-use attribute in the "/private/ 91 specialuse" IMAP METADATA [IMAP-METADATA] entry of a mailbox. Still, 92 not all implementers will be willing to add the complexity of the 93 IMAP METADATA capability, just to provide access to special-use 94 attributes to the Sieve interpreter. 96 This document defines an extension to the Sieve mail filtering 97 language that adds the ability to freely access mailbox special-use 98 attributes. It adds a test called "specialuse_exists" that checks 99 whether a special-use attribute is assigned for a particular mailbox 100 or - if omitted - any mailbox. It also adds the ability to file 101 messages into an anonymous mailbox that has a particular special-use 102 attribute assigned using a ":specialuse" argument for the "fileinto" 103 command [SIEVE]. 105 2. Conventions Used in This Document 107 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 108 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 109 document are to be interpreted as described in [KEYWORDS]. 111 Conventions for notations are as in [SIEVE] Section 1.1, including 112 use of the "Usage:" label for the definition of action and tagged 113 arguments syntax. 115 3. Test "specialuse_exists" 117 Usage: specialuse_exists [] 118 120 If the "mailbox" string argument is omitted, the "specialuse_exists" 121 test yields true if all of the following statements are true for each 122 of the special-use flags listed in the "special-use-flags" argument: 124 a. at least one mailbox exists in the mail store that has that 125 particular special-use flag assigned, and 127 b. that mailbox allows the user in whose context the Sieve script 128 runs to "deliver" messages into it. 130 If the "mailbox" argument is specified, the "specialuse_exists" test 131 yields true if all of the following statements are true: 133 a. the indicated mailbox exists, 135 b. that mailbox allows the user in whose context the Sieve script 136 runs to "deliver" messages into it, and 138 c. that mailbox has all of the special-use flags listed in the 139 "special-use-flags" argument assigned to it. 141 Refer to the specification of the "mailboxexists" test in Section 3.1 142 of RFC 5490 [MAILBOX] for a definition of when "delivery" of messages 143 into a mailbox is deemed possible. 145 4. ":specialuse" Argument to "fileinto" Command 147 Usage: fileinto [:specialuse ] 148 150 Normally, the "fileinto" command delivers the message in the mailbox 151 specified using its positional mailbox argument. However, if the 152 optional ":specialuse" argument is also specified, the "fileinto" 153 command first checks whether a mailbox exists with the specified 154 special-use flag assigned to it. If that is the case, that special- 155 use mailbox is used for delivery instead. If there is no such 156 mailbox or if the specified special-use flag is unknown to the 157 implementation in general, the "fileinto" action proceeds as it would 158 without the ":specialuse" argument. 160 Summarizing, if the ":specialuse" argument is specified, the fileinto 161 command deals with two mailboxes that may or may not exist: 163 o An anonymous special-use mailbox, which has at least the special- 164 use flag specified with the ":specialuse" argument assigned to it. 166 o The default mailbox named by the positional string argument of the 167 "fileinto" command, which is used when the special-use mailbox is 168 not found. 170 The special-use flag specified with the ":specialuse" argument MUST 171 conform to the "use-attr" syntax described in Section 6 of RFC6154 172 [MAILBOX]. Implementations SHOULD handle an invalid special-use flag 173 in the same way as an invalid mailbox name is handled. The string 174 parameter of the ":specialuse" argument is not a constant string, 175 which means that variable substitutions are allowed when the 176 "variables" extension [VARIABLES] is active. In that case, the 177 syntax of the special-use flag is only verified at runtime. 179 If neither the special-use mailbox nor the default mailbox exists, 180 the "fileinto" action MUST proceed exactly as it does in case the 181 ":specialuse" is argument is absent and the mailbox named by its 182 positional argument does not exist. The various options for handling 183 this situation are described in Section 4.1 of RFC5228 [SIEVE]. 185 More than one mailbox can have a particular special-use flag 186 assigned. In that case, the mailbox that is chosen for delivery is 187 implementation-defined. However, implementations MUST ensure that 188 this choice is made consistently, so that the same mailbox is used 189 every time. 191 If delivery to the special-use mailbox fails for reasons not relating 192 to its existence, the Sieve interpreter MUST NOT subsequently attempt 193 delivery in the indicated default mailbox as a fall-back. Instead, 194 it MUST proceed exactly as it does in case the ":specialuse" argument 195 is absent and delivery to the mailbox named by its positional 196 argument fails. This prevents the situation where messages are 197 unexpectedly spread over two mailboxes in case transient or 198 intermittent delivery failures occur. 200 4.1. Interaction with ":create" Argument to "fileinto" Command 202 The "mailbox" extension [MAILBOX] adds the optional ":create" 203 argument to the "fileinto" command. If the optional ":create" 204 argument is specified with "fileinto", it instructs the Sieve 205 interpreter to create the specified mailbox if needed, before 206 attempting to deliver the message into the specified mailbox. 208 When combined with the ":specialuse" argument, the ":create" argument 209 instructs the Sieve interpreter to create the specified default 210 mailbox if needed. This need arises when both the special-use and 211 the default mailbox are not found. 213 If the server implementation supports the CREATE-SPECIAL-USE 214 capability [SPECIAL-USE] for IMAP, i.e. it allows assigning special- 215 use flags to new mailboxes, it SHOULD assign the special-use flag 216 specified with the ":specialuse" argument to the newly created 217 mailbox. 219 5. Sieve Capability Strings 221 A Sieve implementation that defines the "specialuse_exists" test and 222 the ":specialuse" argument for the "fileinto" command will advertise 223 the capability string "special-use". 225 6. Examples 227 The following example saves the message in the mailbox where messages 228 deemed to be junk mail are held. This mailbox is identified using 229 the "\Junk" special-use attribute. If no mailbox has this attribute 230 assigned, the message is filed into the mailbox named "Spam". 232 require "fileinto"; 233 require "special-use"; 235 fileinto :specialuse "\\Junk" "Spam"; 237 The following very similar example handles the case in which neither 238 a "\Junk" special-use mailbox nor the "Spam" mailbox exist. In that 239 case, a mailbox called "Spam" is created, and the message is stored 240 there. Additionally, the "\Junk" special-use attribute may be 241 assigned to it. 243 require "fileinto"; 244 require "special-use"; 245 require "mailbox"; 247 fileinto :specialuse "\\Junk" :create "Spam"; 249 The following example is used in a Sieve script that is triggered 250 from an IMAP event, rather than at message delivery [IMAPSIEVE]. 251 This Sieve script redirects messages to an automated recipient that 252 processes junk mail, if those messages are copied or moved into a 253 mailbox that has the "\Junk" special-use attribute assigned. 255 require "imapsieve"; 256 require "special-use"; 257 require "environment"; 258 require "variables"; 260 if environment :contains "imap.mailbox" "*" { 261 set "mailbox" "${1}"; 262 } 264 if allof( 265 environment "imap.cause" "COPY", 266 specialuse_exists "${mailbox}" "\\Junk") { 267 redirect "spam-report@example.org"; 268 } 270 7. Security Considerations 272 [FIXME] 274 Additional security considerations are discussed in [SIEVE]. 276 8. IANA Considerations 278 The following template specifies the IANA registration of the Sieve 279 extension specified in this document: 281 To: iana@iana.org 282 Subject: Registration of new Sieve extension 284 Capability name: special-use 285 Description: adds a test for checking whether an IMAP 286 special-use attribute is assigned for a 287 particular mailbox or any mailbox, and it adds 288 the ability to file messages into an anonymous 289 mailbox that has a particular IMAP special-use 290 attribute assigned. 291 RFC number: this RFC 292 Contact address: Sieve mailing list 294 This information should be added to the list of sieve extensions 295 given on http://www.iana.org/assignments/sieve-extensions. 297 9. References 299 9.1. Normative References 301 [IMAP-METADATA] 302 Daboo, C., "The IMAP METADATA Extension", RFC 5464, DOI 303 10.17487/RFC5464, February 2009, 304 . 306 [KEYWORDS] 307 Bradner, S., "Key words for use in RFCs to Indicate 308 Requirement Levels", BCP 14, RFC 2119, March 1997. 310 [MAILBOX] Melnikov, A., "The Sieve Mail-Filtering Language -- 311 Extensions for Checking Mailbox Status and Accessing 312 Mailbox Metadata", RFC 5490, March 2009. 314 [SIEVE] Guenther, P. and T. Showalter, "Sieve: An Email Filtering 315 Language", RFC 5228, January 2008. 317 [SPECIAL-USE] 318 Leiba, B. and J. Nicolson, "IMAP LIST Extension for 319 Special-Use Mailboxes", RFC 6154, DOI 10.17487/RFC6154, 320 March 2011, . 322 [VARIABLES] 323 Homme, K., "Sieve Email Filtering: Variables Extension", 324 RFC 5229, January 2008. 326 9.2. Informative References 328 [IMAP] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 329 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003, 330 . 332 [IMAPSIEVE] 333 Leiba, B., "Support for Internet Message Access Protocol 334 (IMAP) Events in Sieve", RFC 6785, DOI 10.17487/RFC6785, 335 November 2012, . 337 Author's Address 339 Stephan Bosch 340 Dovecot Oy 341 Lars Sonckin Kaari 16 342 Espoo 02600 343 Finland 345 Email: stephan.bosch@dovecot.fi