EXTRA | B. Gondwana, Ed. |
Internet-Draft | FastMail |
Updates: 7162 (if approved) | August 11, 2018 |
Intended status: Standards Track | |
Expires: February 12, 2019 |
Sieve Email Filtering: delivery by mailboxid
draft-gondwana-sieve-mailboxid-00
The OBJECTID capability of the IMAP protocol (I-D.ietf-extra-imap-objectid) allows clients to identify mailboxes by a unique identifier which survives rename. In contrast, the Sieve mail filtering language (RFC 5228) currently has no such capability. This memo defines a Sieve extension that fills this gap: it adds a method for specifying the unique identifier of a mailbox as a target for fileinto rules, and a method for testing the existence of a mailbox by its unique identifier.
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 February 12, 2019.
Copyright (c) 2018 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.
Sieve rules are sometimes created using graphical interfaces which 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 representation of the rule and update the sieve script to match, 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 IMAP client) the rules will get out of sync.
By extending fileinto to reference an immutable mailboxid, sieve rules can continue to target the same mailbox, regardless of how it gets renamed.
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.
The server must advertise the capability "mailboxid", and scripts which use the following extensions must explicitly request the capability "mailboxid".
Example:
require "mailboxid";
Normally, the positional mailbox argument to a fileinto action delivers the message in a mailbox with the matching [RFC3501] name.
This document adds a new tagged argument :mailboxid. If the :mailboxid argument is provided, the positional mailbox argument refers to an [I-D.ietf-extra-imap-objectid] mailboxid rather than an [RFC3501] name.
If there is no mailbox with the specified :mailboxid then the action is the same as if there was no named mailbox, and implementations are free to make the same choices given in [RFC5228] Section 4.1 when the specified mailbox doesn't exist.
The tagged argument :mailboxid to fileinto consumes zero additional tokens.
Example:
require "fileinto"; require "mailboxid"; if header :contains ["from"] "coyote" { fileinto :mailboxid "F6352ae03-b7f5-463c-896f-d8b48ee3"; }
This test behaves identically to the mailboxexists test defined in [RFC5490] but operates on mailboxids rather than mailbox names.
Usage: mailboxidexists <mailboxids: string-list>
The "mailboxidexists" test is true if all mailboxes listed in the "mailboxids" argument exist in the mailstore, and each allows the user in whose context the Sieve script runs to "deliver" messages into it. When the mailstore is an IMAP server, "delivery" of messages is possible if:
a) the READ-WRITE response code is present for the mailbox (see Section 7.1 of [RFC3501]), if IMAP Access Control List (ACL) [RFC4314] is not supported by the server, or
b) the user has 'p' or 'i' rights for the mailbox (see Section 5.2 of [RFC4314]).
Note that a successful "mailboxidexists" test for a mailbox doesn't necessarily mean that a "fileinto :mailboxid" action on this mailbox would succeed. For example, the "fileinto" action might put user over quota. The "mailboxidexists" only verifies existence of the mailbox and whether the user in whose context the Sieve script runs has permissions to execute "fileinto" on it.
Example:
require "fileinto"; require "mailboxid"; if header :contains ["from"] "coyote" { if mailboxidexists "F6352ae03-b7f5-463c-896f-d8b48ee3" { fileinto :mailboxid "F6352ae03-b7f5-463c-896f-d8b48ee3"; } else { fileinto "INBOX.harassment"; } }
test /= ":mailboxidexists" string-list tag /= ":mailboxid"
This document does not add any security considerations beyond those in [RFC5228], [RFC5490] and [I-D.ietf-extra-imap-objectid]. Implementers are referred to the security considerations sections of those documents.
IANA are requested to add a capability to the sieve-extensions registry:
To: iana@iana.org Subject: Registration of new Sieve extension Capability name: mailboxid Description: adds test for checking for mailbox existence by objectid and a new optional argument to fileinto to select the destination mailbox using objectid. RFC number: this RFC Contact address: The EXTRA discussion list <extra@ietf.org>
This document borrows heavily from [RFC5490] for the matching mailboxexists test, and from [I-D.ietf-extra-sieve-special-use] for an example of modifying the fileinto command.
Is there a more explicit way to update the grammar? It seems less fully specified than IMAP.
[I-D.ietf-extra-imap-objectid] | Gondwana, B., "IMAP Extension for object identifiers", Internet-Draft draft-ietf-extra-imap-objectid-08, August 2018. |
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. |
[RFC3501] | Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003. |
[RFC5228] | Guenther, P. and T. Showalter, "Sieve: An Email Filtering Language", RFC 5228, DOI 10.17487/RFC5228, January 2008. |
[RFC5490] | Melnikov, A., "The Sieve Mail-Filtering Language -- Extensions for Checking Mailbox Status and Accessing Mailbox Metadata", RFC 5490, DOI 10.17487/RFC5490, March 2009. |
[RFC8174] | Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017. |
[I-D.ietf-extra-sieve-special-use] | Bosch, S., "Sieve Email Filtering: Delivering to Special-Use Mailboxes", Internet-Draft draft-ietf-extra-sieve-special-use-02, March 2018. |
[RFC4314] | Melnikov, A., "IMAP4 Access Control List (ACL) Extension", RFC 4314, DOI 10.17487/RFC4314, December 2005. |