EXTRA | K. Murchison |
Internet-Draft | R. Signes |
Updates: 5232 (if approved) | N. Jenkins |
Intended status: Standards Track | Fastmail |
Expires: February 11, 2021 | August 10, 2020 |
Sieve Email Filtering: Snooze Extension
draft-ietf-extra-sieve-snooze-00
This document describes the "snooze" extension to the Sieve email filtering language. The "snooze" extension gives Sieve the ability to postpone the filing of an incoming into a target mailbox until a later point in time.
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 11, 2021.
Copyright (c) 2020 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.
Users are not always ready, willing, or able to read and respond to email messages at the time of their arrival. Sometimes it is desirable to have messages appear in a mailbox at a more convenient time for the user to act upon them.
This document defines a new Sieve action command "snooze" that postpones filing a message into a target mailbox until a later point in time. The capability string associated with this extension is "snooze".
Conventions for notations are as in Section 1.1 of [RFC5228], including use of the "Usage:" label for the definition of action and tagged arguments syntax.
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.
Usage: snooze *AWAKEN-OPTIONS <times: string-list>
The AWAKEN-OPTIONS argument is defined here in ABNF syntax so that it can be modified by other extensions.
AWAKEN-OPTIONS = MAILBOX / WEEKDAYS / TZID ; each option MUST NOT appear more than once ; however, per Section 2.6.2 of RFC 5228, ; the tagged arguments in AWAKEN-OPTIONS ; may appear in any order MAILBOX = ":mailbox" string WEEKDAYS = ":weekdays" string-list TZID = ":tzid" string
The snooze action is semantically equivalent to a delayed fileinto action (see Section 4.1 of [RFC5228]). The arguments of the snooze action specify when, where, and how the awakened message will be filed.
The process of actually snoozing and awakening (delaying the filing of) the message is implementation specific and outside the scope of this document. However, Section 4 discusses possible methods for implementing the snooze action.
The optional :mailbox argument is used to specify the target mailbox that the message will be filed into when it is awakened. It is equivalent to the mailbox argument of the fileinto action (see Section 4.1 of [RFC5228]).
If :mailbox is omitted, or if the specified mailbox doesn't exist at the time of awakening, the message will be filed into the user's main mailbox. For instance, in an implementation where the IMAP server is running scripts on behalf of the user at time of delivery, the user's "INBOX" would be the implicit target for awakening messages.
The optional :weekdays argument specifies the set of days on which the specified set of awakening times apply. Each day of the week is expressed as an integer between "0" and "6". "0" is Sunday, "1" is Monday, etc. This syntax matches that of the "weekday" date-part argument to the date test extension (see Section 4.2 of [RFC5260]).
If :weekdays is omitted, the set of awakening times applies to every day of the week.
The required times argument, along with the optional :tzid argument, are used to specify when a snoozed message will be awakened. Each time is specified in "hh:mm:ss" format and is interpreted as the local time in the time zone specified by the :tzid argument.
The value of the :tzid argument MUST be a time zone identifier from the IANA Time Zone Database. If :tzid is omitted, the time zone of the Sieve interpreter is used.
The combination of the weekdays and times form a chronological list of awaken times. When a message is snoozed, it is assigned the next future awaken time in the list. If a message is snoozed on a day with no awaken times, or after the last awaken time on a given day, the first awaken time on the next available day is used.
If the local time in the specified time zone occurs more than once (daylight saving to standard time transition), the first occurrence of the specified time value is used. If the local time in the specified time zone does not occur (standard to daylight saving time transition), the specified time value is interpreted using the UTC offset prior to the transition.
The following examples show, given the specified snooze action and a set of message arrival times, the corresponding times at which the message would be awakened and filed.
The following example shows awaken times rolling into the next day or week. Note that 2020-07-30 falls on a Thursday.
require "snooze"; snooze :weekdays ["1", "3", "5", "2", "4"] :tzid "Australia/Melbourne" ["12:00:00", "08:00:00", "16:00:00"];
Arrival (UTC) | Arrival (Melbourne) | Awaken (Melbourne) |
---|---|---|
2020-07-30T00:00:00Z | --07-30T10:00:00+10 | --07-30T12:00:00+10 |
2020-07-30T04:00:00Z | --07-30T14:00:00+10 | --07-30T16:00:00+10 |
2020-07-30T08:00:00Z | --07-30T18:00:00+10 | --07-31T08:00:00+10 |
2020-07-31T12:00:00Z | --07-31T22:00:00+10 | --08-03T08:00:00+10 |
2020-08-01T16:00:00Z | --08-02T02:00:00+10 | --08-03T08:00:00+10 |
The following example shows awaken times falling before, during, and after a daylight saving to standard time transition. Note that the transition occurs at 2020-11-01T02:00:00-04.
require "snooze"; snooze :tzid "America/New_York" "01:30:00";
Arrival (UTC) | Arrival (New York) | Awaken (New York) |
---|---|---|
2020-11-01T05:00:00Z | --11-01T01:00:00-04 | --11-01T01:30:00-04 |
2020-11-01T06:00:00Z | --11-01T01:00:00-05 | --11-02T01:30:00-05 |
2020-11-01T07:00:00Z | --11-01T02:00:00-05 | --11-02T01:30:00-05 |
The following example shows awaken times falling before, during, and after a standard to daylight saving time transition. Note that the transition occurs at 2021-03-14T02:00:00-05.
require "snooze"; snooze :tzid "America/New_York" "02:30:00";
Arrival (UTC) | Arrival (New York) | Awaken (New York) |
---|---|---|
2021-03-13T06:30:00Z | --03-13T01:30:00-05 | --03-13T02:30:00-05 |
2021-03-14T06:30:00Z | --03-14T01:30:00-05 | --03-14T03:30:00-04 |
2021-03-14T07:30:00Z | --03-14T03:30:00-04 | --03-15T02:30:00-04 |
Some tagged arguments defined in extensions to the fileinto action can be used together with the snooze action. The sections below describe these interactions. Tagged arguments in future extensions to the fileinto action need to describe their interaction with the snooze extension, if any.
When any fileinto extension arguments are used with the snooze extension, the corresponding extension MUST be enabled, and the arguments are defined to have the same syntax, semantics, and treatment as they do with the fileinto action.
When the "imap4flags" extension is enabled in a script, two additional tagged arguments are added to "snooze" that allow manipulating the set of flags on a snoozed message.
AWAKEN-OPTIONS /= ADDFLAGS / REMOVEFLAGS ADDFLAGS = ":addflags" string-list REMOVEFLAGS = ":removeflags" string-list
The optional :addflags and :removeflags arguments are used to specify which IMAP flags should be added to and/or removed from the set of IMAP flags present on the snoozed message at the time of awakening. Note that depending on the method used to snooze a message, the set of IMAP flags present at the time of awakening may be the empty set.
This document doesn't dictate how the Sieve interpreter will set the IMAP flags. In particular, the Sieve interpreter may work as an IMAP client or may have direct access to the mailstore.
The general requirements for flag handling specified in Section 2 of [RFC5232] MUST be followed.
This document extends the definition of the ":create" tagged argument so that it can be used with the snooze action.
AWAKEN-OPTIONS /= CREATE CREATE = ":create" ; MUST NOT be appear unless MAILBOX also appears
If the optional ":create" argument is specified with snooze, it instructs the Sieve interpreter to create the target mailbox, if needed, before attempting to file the awakened message into the target mailbox.
This document extends the definition of the ":specialuse" tagged argument so that it can be used with the snooze action.
AWAKEN-OPTIONS /= SPECIAL-USE SPECIAL-USE = ":specialuse" string
If the optional ":specialuse" argument is specified with snooze, it instructs the Sieve interpreter to check whether a mailbox exists with the specific special-use flag assigned to it. If such a mailbox exists, the awakened message is filed into the special-use mailbox. Otherwise, the awakened message is filed into the target mailbox.
If both the optional ":specialuse" and ":create" arguments are specified with snooze, the Sieve interpreter is instructed to create the target mailbox per Section 4.1 of [RFC8579], if needed.
This document extends the definition of the ":mailboxid" tagged argument so that it can be used with the snooze action.
AWAKEN-OPTIONS /= MAILBOXID MAILBOXID = ":mailboxid" string
If the optional ":mailboxid" argument is specified with snooze, it instructs the Sieve interpreter to check whether a mailbox exists in the user's personal namespace with the specified MAILBOXID. If such a mailbox exists, the awakened message is filed into that mailbox. Otherwise, the awakened message is filed into the target mailbox.
If both the optional ":mailboxid" and ":specialuse" arguments are specified with snooze, the Sieve interpreter is instructed to resolve the mailboxid first. If a mailbox with the specified mailboxid does not exist, then the process in Section 3.4.3 is followed.
The process of snoozing is implementation specific and outside the scope of this document. However, the sections below outline possible methods of snoozing and awakening a message to be filed.
A Sieve interpreter may implement the snooze action by leveraging the SMTP Future Message Release submission extension. The message would be snoozed by queuing it for redelivery with a release time that corresponds to the calculated awaken time. The target mailbox for the awakened message would need to be encoded into the recipient address or into a message header field. Care MUST be taken to prevent the awakened message from being re-snoozed by the Sieve script and causing a message loop.
A Sieve interpreter may implement the snooze action by leveraging the user's existing mail store. The message would be snoozed by storing the message in a special "snoozed" mailbox and then moved into the target mailbox at the calculated awaken time.
If a user's Sieve script enables the "imap4flags" extension, and if the "setflag" and/or "addflag" actions have been used to store IMAP flags in the imap4flags internal variable, the Sieve interpreter MAY use the current value of the internal variable as the set of flags to associate with the message when storing it into the "snoozed" mailbox. Note that in this case, the ":addflag" and ":removeflag" tagged arguments to the snooze action operate on this set of flags, but MUST NOT do so until the message is awakened.
< RFC Editor: before publication please remove this section and the reference to [RFC7942] >
This section records the status of known implementations of the protocol defined by this specification at the time of posting of this Internet-Draft, and is based on a proposal described in [RFC7942]. The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs. Please note that the listing of any individual implementation here does not imply endorsement by the IETF. Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors. This is not intended as, and must not be construed to be, a catalog of available implementations or their features. Readers are advised to note that other implementations may exist.
According to [RFC7942], "this will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature. It is up to the individual working groups to use this information as they see fit".
The open source Cyrus Server project is a highly scalable enterprise mail system which supports Sieve email filtering at the point of final delivery. This production level Sieve implementation supports all of the requirements described in this document. This implementation is freely distributable under a BSD style license from Computing Services at Carnegie Mellon University.
Security considerations are discussed in [RFC5228], [RFC5232], [RFC8579], and [I-D.gondwana-sieve-mailboxid].
It is believed that this extension doesn't introduce any additional security concerns.
It is believed that this extension doesn't introduce any privacy considerations beyond those in [RFC5228].
[RFC4865] | White, G. and G. Vaudreuil, "SMTP Submission Service Extension for Future Message Release", RFC 4865, DOI 10.17487/RFC4865, May 2007. |
[RFC5260] | Freed, N., "Sieve Email Filtering: Date and Index Extensions", RFC 5260, DOI 10.17487/RFC5260, July 2008. |
[RFC7942] | Sheffer, Y. and A. Farrel, "Improving Awareness of Running Code: The Implementation Status Section", BCP 205, RFC 7942, DOI 10.17487/RFC7942, July 2016. |