< draft-gondwana-sieve-mailboxid-01.txt   draft-gondwana-sieve-mailboxid-02.txt >
EXTRA B. Gondwana, Ed. EXTRA B. Gondwana, Ed.
Internet-Draft FastMail Internet-Draft FastMail
Updates: 5228 (if approved) August 11, 2018 Updates: 5228 (if approved) 17 June 2020
Intended status: Standards Track Intended status: Standards Track
Expires: February 12, 2019 Expires: 19 December 2020
Sieve Email Filtering: delivery by mailboxid Sieve Email Filtering: delivery by mailboxid
draft-gondwana-sieve-mailboxid-01 draft-gondwana-sieve-mailboxid-02
Abstract Abstract
The OBJECTID capability of the IMAP protocol (I-D.ietf-extra-imap- The OBJECTID capability of the IMAP protocol (I-D.ietf-extra-imap-
objectid) allows clients to identify mailboxes by a unique identifier objectid) allows clients to identify mailboxes by a unique identifier
which survives rename. In contrast, the Sieve mail filtering which survives rename. In contrast, the Sieve mail filtering
language (RFC 5228) currently has no such capability. This memo language (RFC 5228) currently has no such capability. This memo
defines a Sieve extension that fills this gap: it adds a method for defines a Sieve extension that fills this gap: it adds a method for
specifying the unique identifier of a mailbox as a target for specifying the unique identifier of a mailbox as a target for
fileinto rules, and a method for testing the existence of a mailbox fileinto rules, and a method for testing the existence of a mailbox
skipping to change at page 1, line 38 skipping to change at page 1, line 38
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on February 12, 2019. This Internet-Draft will expire on 19 December 2020.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents (https://trustee.ietf.org/
(https://trustee.ietf.org/license-info) in effect on the date of license-info) in effect on the date of publication of this document.
publication of this document. Please review these documents Please review these documents carefully, as they describe your rights
carefully, as they describe your rights and restrictions with respect and restrictions with respect to this document. Code Components
to this document. Code Components extracted from this document must extracted from this document must include Simplified BSD License text
include Simplified BSD License text as described in Section 4.e of as described in Section 4.e of the Trust Legal Provisions and are
the Trust Legal Provisions and are provided without warranty as provided without warranty as described in the Simplified BSD License.
described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Conventions Used In This Document . . . . . . . . . . . . . . 2 2. Conventions Used In This Document . . . . . . . . . . . . . . 2
3. Sieve capability string . . . . . . . . . . . . . . . . . . . 3 3. Sieve capability string . . . . . . . . . . . . . . . . . . . 3
4. Argument ":mailboxid" to Command "fileinto" . . . . . . . . . 3 4. Argument ":mailboxid" to Command "fileinto" . . . . . . . . . 3
4.1. Interaction with "mailbox" extension . . . . . . . . . . 3 4.1. Interaction with "mailbox" extension . . . . . . . . . . 3
4.2. Interaction with "specialuse" extension . . . . . . . . . 4 4.2. Interaction with "specialuse" extension . . . . . . . . . 4
4.3. Interaction with "fcc" extension . . . . . . . . . . . . 5 4.3. Interaction with "fcc" extension . . . . . . . . . . . . 5
5. Test ":mailboxidexists" . . . . . . . . . . . . . . . . . . . 5 5. Test ":mailboxidexists" . . . . . . . . . . . . . . . . . . . 5
6. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 6 6. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 6
7. Security considerations . . . . . . . . . . . . . . . . . . . 6 7. Security considerations . . . . . . . . . . . . . . . . . . . 6
8. IANA considerations . . . . . . . . . . . . . . . . . . . . . 6 8. IANA considerations . . . . . . . . . . . . . . . . . . . . . 6
9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7
10. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 10. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
10.1. draft-gondwana-sieve-mailboxid-01 . . . . . . . . . . . 7 10.1. draft-gondwana-sieve-mailboxid-02 . . . . . . . . . . . 7
10.2. draft-gondwana-sieve-mailboxid-00 . . . . . . . . . . . 7 10.2. draft-gondwana-sieve-mailboxid-01 . . . . . . . . . . . 7
11. TODO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 10.3. draft-gondwana-sieve-mailboxid-00 . . . . . . . . . . . 7
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 11. TODO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
12.1. Normative References . . . . . . . . . . . . . . . . . . 7 12. Normative References . . . . . . . . . . . . . . . . . . . . 8
12.2. Informative References . . . . . . . . . . . . . . . . . 8 13. Informative References . . . . . . . . . . . . . . . . . . . 8
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 9 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 9
1. Introduction 1. Introduction
Sieve rules are sometimes created using graphical interfaces which Sieve rules are sometimes created using graphical interfaces which
allow users to select the mailbox to be used as a target for a rule. allow users to select the mailbox to be used as a target for a rule.
If that mailbox is renamed, the client may also update its internal If that mailbox is renamed, the client may also update its internal
representation of the rule and update the sieve script to match, representation of the rule and update the sieve script to match,
however this is a multi-step process and subject to partial failures. however this is a multi-step process and subject to partial failures.
Also, if the folder is renamed by a different mechanism (e.g. another Also, if the folder is renamed by a different mechanism (e.g. another
skipping to change at page 3, line 15 skipping to change at page 3, line 13
capitals, as shown here. capitals, as shown here.
3. Sieve capability string 3. Sieve capability string
The server advertises the capability "mailboxid", and scripts which The server advertises the capability "mailboxid", and scripts which
use the following extensions MUST explicitly request the capability use the following extensions MUST explicitly request the capability
"mailboxid". "mailboxid".
Example: Example:
require "mailboxid"; require "mailboxid";
4. Argument ":mailboxid" to Command "fileinto" 4. Argument ":mailboxid" to Command "fileinto"
Normally, the "fileinto" command delivers the message in the mailbox Normally, the "fileinto" command delivers the message in the mailbox
specified using its positional mailbox argument. However, if the specified using its positional mailbox argument. However, if the
optional ":mailboxid" argument is also specified, the "fileinto" optional ":mailboxid" argument is also specified, the "fileinto"
command first checks whether a mailbox exists in the user's personal command first checks whether a mailbox exists in the user's personal
namespace [RFC2342] with the specified [I-D.ietf-extra-imap-objectid] namespace [RFC2342] with the specified [I-D.ietf-extra-imap-objectid]
MAILBOXID. If that is the case, that mailbox is used for delivery MAILBOXID. If that is the case, that mailbox is used for delivery
instead. If there is no such mailbox, the "fileinto" action proceeds instead. If there is no such mailbox, the "fileinto" action proceeds
as it would without the ":mailboxid" argument. as it would without the ":mailboxid" argument.
The tagged argument ":mailboxid" to fileinto consumes one additional The tagged argument ":mailboxid" to fileinto consumes one additional
token, a string with the objectid of the mailbox to file into. token, a string with the objectid of the mailbox to file into.
Example: Example:
require "fileinto"; require "fileinto";
require "mailboxid"; require "mailboxid";
if header :contains ["from"] "coyote" { if header :contains ["from"] "coyote" {
fileinto :mailboxid "F6352ae03-b7f5-463c-896f-d8b48ee3" fileinto :mailboxid "F6352ae03-b7f5-463c-896f-d8b48ee3"
"INBOX.harassment"; "INBOX.harassment";
} }
4.1. Interaction with "mailbox" extension 4.1. Interaction with "mailbox" extension
For servers which also support the [RFC5490] mailbox extension, the For servers which also support the [RFC5490] mailbox extension, the
":create" modifier to fileinto does not create mailbox with the ":create" modifier to fileinto does not create mailbox with the
specified mailboxid, however it may be specified and interacts as specified mailboxid, however it may be specified and interacts as
normal with all other extensions. normal with all other extensions.
Example: Example:
require "fileinto"; require "fileinto";
require "mailboxid"; require "mailboxid";
require "mailbox"; require "mailbox";
fileinto :mailboxid "Fnosuch" fileinto :mailboxid "Fnosuch"
:create :create
"INBOX.no-such-folder"; "INBOX.no-such-folder";
# creates INBOX.no-such-folder, but it doesn't # creates INBOX.no-such-folder, but it doesn't
# get the "Fnosuch" mailboxid. # get the "Fnosuch" mailboxid.
4.2. Interaction with "specialuse" extension 4.2. Interaction with "specialuse" extension
For servers which also support [I-D.ietf-extra-sieve-special-use], if For servers which also support [I-D.ietf-extra-sieve-special-use], if
a fileinto command has both ":mailboxid" and ":special-use" a fileinto command has both ":mailboxid" and ":special-use"
specified, then the mailboxid is resolved first. If the mailboxid specified, then the mailboxid is resolved first. If the mailboxid
does not exist, then the special-use is evaluated next following the does not exist, then the special-use is evaluated next following the
process specified in [I-D.ietf-extra-sieve-special-use] - this process specified in [I-D.ietf-extra-sieve-special-use] - this
includes processing of [RFC5490] ":create" tags to add the special- includes processing of [RFC5490] ":create" tags to add the special-
use on creation. use on creation.
Example: Example:
require "fileinto"; require "fileinto";
require "mailboxid"; require "mailboxid";
require "special-use"; require "special-use";
if header :contains ["from"] "coyote" { if header :contains ["from"] "coyote" {
fileinto :mailboxid "F6352ae03-b7f5-463c-896f-d8b48ee3" fileinto :mailboxid "F6352ae03-b7f5-463c-896f-d8b48ee3"
:specialuse "\\Junk" :specialuse "\\Junk"
"INBOX.harassment"; "INBOX.harassment";
} }
Example: Example:
require "fileinto"; require "fileinto";
require "mailboxid"; require "mailboxid";
require "mailbox"; require "mailbox";
require "special-use"; require "special-use";
fileinto :mailboxid "F1234567" fileinto :mailboxid "F1234567"
:specialuse "\\Archive" :specialuse "\\Archive"
:create :create
"INBOX.Archive"; "INBOX.Archive";
# creates INBOX.Archive with use \Archive but # creates INBOX.Archive with use \Archive but
# with a different mailboxid. # with a different mailboxid.
4.3. Interaction with "fcc" extension 4.3. Interaction with "fcc" extension
This document extends the definition of the :fcc argument so that it This document extends the definition of the :fcc argument so that it
can optionally be used with the ":mailboxid" argument. can optionally be used with the ":mailboxid" argument.
FCC =/ [":mailboxid" <mailboxid: string>] FCC =/ [":mailboxid" <mailboxid: string>]
If the optional ":mailboxid" argument is specified with ":fcc", it If the optional ":mailboxid" argument is specified with ":fcc", it
instructs the Sieve interpreter to check whether a mailbox exists instructs the Sieve interpreter to check whether a mailbox exists
with the specific mailboxid. If such a mailbox exists, the generated with the specific mailboxid. If such a mailbox exists, the generated
message is filed into that mailbox. Otherwise, the generated message message is filed into that mailbox. Otherwise, the generated message
is filed into the ":fcc" target mailbox. is filed into the ":fcc" target mailbox.
Example: Example:
require ["enotify", "fcc", "mailboxid"]; require ["enotify", "fcc", "mailboxid"];
notify :fcc "INBOX.Sent" notify :fcc "INBOX.Sent"
:mailboxid "F6352ae03-b7f5-463c-896f-d8b48ee3" :mailboxid "F6352ae03-b7f5-463c-896f-d8b48ee3"
:message "You got mail!" :message "You got mail!"
"mailto:ken@example.com"; "mailto:ken@example.com";
5. Test ":mailboxidexists" 5. Test ":mailboxidexists"
The "mailboxidexists" test is true if all mailboxes listed in the The "mailboxidexists" test is true if all mailboxes listed in the
"mailboxids" argument exist in the mailstore, and each allows the "mailboxids" argument exist in the mailstore, and each allows the
user in whose context the Sieve script runs to "deliver" messages user in whose context the Sieve script runs to "deliver" messages
into it. When the mailstore is an IMAP server, "delivery" of into it. When the mailstore is an IMAP server, "delivery" of
messages is possible if: messages is possible if:
a) the READ-WRITE response code is present for the mailbox (see a) the READ-WRITE response code is present for the mailbox (see
skipping to change at page 6, line 5 skipping to change at page 6, line 5
Note that a successful "mailboxidexists" test for a mailbox doesn't Note that a successful "mailboxidexists" test for a mailbox doesn't
necessarily mean that a "fileinto :mailboxid" action on this mailbox necessarily mean that a "fileinto :mailboxid" action on this mailbox
would succeed. For example, the "fileinto" action might put user would succeed. For example, the "fileinto" action might put user
over quota. The "mailboxidexists" only verifies existence of the over quota. The "mailboxidexists" only verifies existence of the
mailbox and whether the user in whose context the Sieve script runs mailbox and whether the user in whose context the Sieve script runs
has permissions to execute "fileinto" on it. has permissions to execute "fileinto" on it.
Example: Example:
require "fileinto"; require "fileinto";
require "mailboxid"; require "mailboxid";
if header :contains ["from"] "coyote" { if header :contains ["from"] "coyote" {
if mailboxidexists "F6352ae03-b7f5-463c-896f-d8b48ee3" { if mailboxidexists "F6352ae03-b7f5-463c-896f-d8b48ee3" {
fileinto :mailboxid "F6352ae03-b7f5-463c-896f-d8b48ee3" fileinto :mailboxid "F6352ae03-b7f5-463c-896f-d8b48ee3"
"INBOX.harassment"; "INBOX.harassment";
} else { } else {
fileinto "INBOX.harassment"; fileinto "INBOX.harassment";
} }
} }
Not to implementers: this test behaves identically to the Not to implementers: this test behaves identically to the
"mailboxexists" test defined in [RFC5490] but operates on mailboxids "mailboxexists" test defined in [RFC5490] but operates on mailboxids
rather than mailbox names. rather than mailbox names.
6. Formal Syntax 6. Formal Syntax
test /= ":mailboxidexists" string-list test /= ":mailboxidexists" string-list
tag /= ":mailboxid" string tag /= ":mailboxid" string
If [I-D.ietf-extra-sieve-fcc] is supported: If [I-D.ietf-extra-sieve-fcc] is supported:
FCC =/ [":mailboxid" <mailboxid: string>] FCC =/ [":mailboxid" <mailboxid: string>]
7. Security considerations 7. Security considerations
Because mailboxid is always generated by the server, implementations Because mailboxid is always generated by the server, implementations
MUST NOT allow sieve to make an endrun around this protection by MUST NOT allow sieve to make an endrun around this protection by
creating mailboxes with the specified ID by using ":create" and creating mailboxes with the specified ID by using ":create" and
":mailboxid" in a fileinto rule for a non-existant mailbox. ":mailboxid" in a fileinto rule for a non-existant mailbox.
Implementers are referred to the security considerations sections of Implementers are referred to the security considerations sections of
those documents in [RFC5228], [I-D.ietf-extra-imap-objectid]. those documents in [RFC5228], [I-D.ietf-extra-imap-objectid].
skipping to change at page 7, line 28 skipping to change at page 7, line 28
mailboxexists test, and from [I-D.ietf-extra-sieve-special-use] for mailboxexists test, and from [I-D.ietf-extra-sieve-special-use] for
an example of modifying the fileinto command. an example of modifying the fileinto command.
Thanks to Ned Freed and Ken Murchison for feedback on the EXTRA Thanks to Ned Freed and Ken Murchison for feedback on the EXTRA
mailing list. mailing list.
10. Changes 10. Changes
(EDITOR: remove this section before publication) (EDITOR: remove this section before publication)
10.1. draft-gondwana-sieve-mailboxid-01 10.1. draft-gondwana-sieve-mailboxid-02
o Switch to :mailboxid tagged parameter value with fallback mailbox * Update document date by a couple of years! Ooops, it got
forgotten after a WGLC which got not dissent.
* Create xml2rfc v3 output.
10.2. draft-gondwana-sieve-mailboxid-01
* Switch to :mailboxid tagged parameter value with fallback mailbox
name. name.
o Document interation with special-use. * Document interaction with "mailbox".
o Document security considerations around :mailboxid and :create. * Document interaction with "special-use".
10.2. draft-gondwana-sieve-mailboxid-00 * Document interaction with "fcc".
o Initial version. * Document security considerations around :mailboxid and :create.
10.3. draft-gondwana-sieve-mailboxid-00
* Initial version.
11. TODO 11. TODO
Is there a more explicit way to update the grammar? It seems less Is there a more explicit way to update the grammar? It seems less
fully specified than IMAP. fully specified than IMAP.
12. References 12. Normative References
12.1. Normative References
[I-D.ietf-extra-imap-objectid] [RFC5228] Guenther, P., Ed. and T. Showalter, Ed., "Sieve: An Email
Gondwana, B., "IMAP Extension for object identifiers", Filtering Language", RFC 5228, DOI 10.17487/RFC5228,
draft-ietf-extra-imap-objectid-08 (work in progress), January 2008, <https://www.rfc-editor.org/info/rfc5228>.
August 2018.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC2342] Gahrns, M. and C. Newman, "IMAP4 Namespace", RFC 2342, [RFC2342] Gahrns, M. and C. Newman, "IMAP4 Namespace", RFC 2342,
DOI 10.17487/RFC2342, May 1998, DOI 10.17487/RFC2342, May 1998,
<https://www.rfc-editor.org/info/rfc2342>. <https://www.rfc-editor.org/info/rfc2342>.
[RFC5228] Guenther, P., Ed. and T. Showalter, Ed., "Sieve: An Email [I-D.ietf-extra-imap-objectid]
Filtering Language", RFC 5228, DOI 10.17487/RFC5228, Gondwana, B., "IMAP Extension for object identifiers",
January 2008, <https://www.rfc-editor.org/info/rfc5228>. Work in Progress, Internet-Draft, draft-ietf-extra-imap-
objectid-08, 2 August 2018, <https://tools.ietf.org/html/
draft-ietf-extra-imap-objectid-08>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
12.2. Informative References 13. Informative References
[I-D.ietf-extra-sieve-fcc]
Murchison, K. and B. Gondwana, "Sieve Extension: File
Carbon Copy (Fcc)", draft-ietf-extra-sieve-fcc-03 (work in
progress), August 2018.
[I-D.ietf-extra-sieve-special-use] [I-D.ietf-extra-sieve-special-use]
Bosch, S., "Sieve Email Filtering: Delivering to Special- Bosch, S., "Sieve Email Filtering: Delivering to Special-
Use Mailboxes", draft-ietf-extra-sieve-special-use-02 Use Mailboxes", Work in Progress, Internet-Draft, draft-
(work in progress), March 2018. ietf-extra-sieve-special-use-05, 24 January 2019,
<https://tools.ietf.org/html/draft-ietf-extra-sieve-
special-use-05>.
[RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003, 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003,
<https://www.rfc-editor.org/info/rfc3501>. <https://www.rfc-editor.org/info/rfc3501>.
[RFC4314] Melnikov, A., "IMAP4 Access Control List (ACL) Extension", [RFC4314] Melnikov, A., "IMAP4 Access Control List (ACL) Extension",
RFC 4314, DOI 10.17487/RFC4314, December 2005, RFC 4314, DOI 10.17487/RFC4314, December 2005,
<https://www.rfc-editor.org/info/rfc4314>. <https://www.rfc-editor.org/info/rfc4314>.
[RFC5490] Melnikov, A., "The Sieve Mail-Filtering Language -- [RFC5490] Melnikov, A., "The Sieve Mail-Filtering Language --
Extensions for Checking Mailbox Status and Accessing Extensions for Checking Mailbox Status and Accessing
Mailbox Metadata", RFC 5490, DOI 10.17487/RFC5490, March Mailbox Metadata", RFC 5490, DOI 10.17487/RFC5490, March
2009, <https://www.rfc-editor.org/info/rfc5490>. 2009, <https://www.rfc-editor.org/info/rfc5490>.
[I-D.ietf-extra-sieve-fcc]
Murchison, K. and B. Gondwana, "Sieve Extension: File
Carbon Copy (Fcc)", Work in Progress, Internet-Draft,
draft-ietf-extra-sieve-fcc-09, 13 January 2019,
<https://tools.ietf.org/html/draft-ietf-extra-sieve-fcc-
09>.
Author's Address Author's Address
Bron Gondwana (editor) Bron Gondwana (editor)
FastMail FastMail
Level 2, 114 William St Level 2, 114 William St
Melbourne VIC 3000 Melbourne VIC 3000
Australia Australia
Email: brong@fastmailteam.com Email: brong@fastmailteam.com
URI: https://www.fastmail.com URI: https://www.fastmail.com
 End of changes. 34 change blocks. 
95 lines changed or deleted 108 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/