| < draft-ietf-sieve-imap-sieve-02.txt | draft-ietf-sieve-imap-sieve-03.txt > | |||
|---|---|---|---|---|
| Sieve Working Group B. Leiba | Sieve Working Group B. Leiba | |||
| Internet-Draft Huawei Technologies | Internet-Draft Huawei Technologies | |||
| Intended status: Standards Track July 8, 2011 | Intended status: Standards Track March 6, 2012 | |||
| Expires: January 9, 2012 | Expires: September 7, 2012 | |||
| Support for Sieve in Internet Message Access Protocol (IMAP4) | Support for Internet Message Access Protocol (IMAP) Events in Sieve | |||
| draft-ietf-sieve-imap-sieve-02 | draft-ietf-sieve-imap-sieve-03 | |||
| Abstract | Abstract | |||
| Sieve defines an email filtering language that can, in principle, | Sieve defines an email filtering language that can, in principle, | |||
| plug into any point in the processing of an email message. As | plug into any point in the processing of an email message. As | |||
| defined in the base specification, it plugs into mail delivery. This | defined in the base specification, it plugs into mail delivery. This | |||
| document defines how Sieve can plug into points in the IMAP protocol | document defines how Sieve can plug into points in the IMAP protocol | |||
| where messages are created or changed, adding the option of user- | where messages are created or changed, adding the option of user- | |||
| defined or installation-defined filtering (or, with Sieve extensions, | defined or installation-defined filtering (or, with Sieve extensions, | |||
| features such as notifications). | features such as notifications). | |||
| Note | Note | |||
| [[anchor1: RFC Editor: Please remove this note prior to | ||||
| publication.]] | ||||
| This document defines extensions to IMAP and Sieve. It is the work | This document defines extensions to IMAP and Sieve. It is the work | |||
| of the Sieve Working Group, but had previously been in the lemonade | of the Sieve Working Group, but had previously been in the lemonade | |||
| mailing list, as draft-ietf-lemonade-imap-sieve. | mailing list, as draft-ietf-lemonade-imap-sieve. | |||
| 1. Discussion of this document should be taken to the Sieve mailing | 1. Discussion of this document should be taken to the Sieve mailing | |||
| list at mailto:sieve@ietf.org | list at mailto:sieve@ietf.org | |||
| 2. Subscription requests can be sent to | 2. Subscription requests can be sent to | |||
| mailto:sieve@ietf.org?body=subscribe (send an email message with | mailto:sieve@ietf.org?body=subscribe (send an email message with | |||
| the word "subscribe" in the body). | the word "subscribe" in the body). | |||
| skipping to change at page 2, line 40 ¶ | skipping to change at page 2, line 43 ¶ | |||
| 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 http://datatracker.ietf.org/drafts/current/. | Drafts is at http://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 January 9, 2012. | This Internet-Draft will expire on September 7, 2012. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2011 IETF Trust and the persons identified as the | Copyright (c) 2012 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 | |||
| (http://trustee.ietf.org/license-info) in effect on the date of | (http://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| carefully, as they describe your rights and restrictions with respect | carefully, as they describe your rights and restrictions with respect | |||
| to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
| include Simplified BSD License text as described in Section 4.e of | include Simplified BSD License text as described in Section 4.e of | |||
| the Trust Legal Provisions and are provided without warranty as | the Trust Legal Provisions and are provided without warranty as | |||
| described in the Simplified BSD License. | described in the Simplified BSD License. | |||
| Table of Contents | Table of Contents | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 5 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
| 1.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 5 | 1.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
| 1.2. Conventions used in this document . . . . . . . . . . . . 5 | 1.2. Differences Between IMAP Events and Mail Delivery . . . . 5 | |||
| 1.3. Conventions used in this document . . . . . . . . . . . . 6 | ||||
| 2. The IMAPSieve Extension . . . . . . . . . . . . . . . . . 6 | 1.4. Notes from Reviews, and To-Do Items . . . . . . . . . . . 6 | |||
| 2.1. The "IMAPSieve" Capability String . . . . . . . . . . . . 6 | ||||
| 2.2. Existing IMAP Functions Affected by IMAPSieve . . . . . . 6 | ||||
| 2.2.1. The IMAP APPEND Command . . . . . . . . . . . . . . . . . 7 | ||||
| 2.2.2. The IMAP MULTIAPPEND Command . . . . . . . . . . . . . . . 7 | ||||
| 2.2.3. The IMAP COPY Command . . . . . . . . . . . . . . . . . . 7 | ||||
| 2.2.4. Changes to IMAP Message Flags . . . . . . . . . . . . . . 7 | ||||
| 2.3. New Functions Defined by IMAPSieve . . . . . . . . . . . . 8 | ||||
| 2.3.1. Interaction with Metadata . . . . . . . . . . . . . . . . 8 | ||||
| 3. Applicable Sieve Actions and Interactions . . . . . . . . 10 | 2. The IMAP Events in Sieve Extension . . . . . . . . . . . . 8 | |||
| 3.1. The Implicit Keep . . . . . . . . . . . . . . . . . . . . 10 | 2.1. The "imapsieve" Capability Strings . . . . . . . . . . . . 8 | |||
| 3.2. The Keep Action . . . . . . . . . . . . . . . . . . . . . 10 | 2.2. Existing IMAP Functions Affected by IMAP events in | |||
| 3.3. The Fileinto Action . . . . . . . . . . . . . . . . . . . 10 | Sieve . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 3.4. The Redirect Action . . . . . . . . . . . . . . . . . . . 11 | 2.2.1. The IMAP APPEND Command . . . . . . . . . . . . . . . . . 8 | |||
| 3.5. The Discard Action . . . . . . . . . . . . . . . . . . . . 11 | 2.2.2. The IMAP MULTIAPPEND Command . . . . . . . . . . . . . . . 9 | |||
| 3.6. The Notify Action . . . . . . . . . . . . . . . . . . . . 12 | 2.2.3. The IMAP COPY Command . . . . . . . . . . . . . . . . . . 9 | |||
| 3.7. The Addheader and Deleteheader Actions . . . . . . . . . . 12 | 2.2.4. Changes to IMAP Message Flags . . . . . . . . . . . . . . 9 | |||
| 3.8. The Setflag, Deleteflag, and Removeflag Actions . . . . . 12 | 2.3. New Functions Defined by IMAP events in Sieve . . . . . . 9 | |||
| 3.9. MIME Part Tests and Replacement . . . . . . . . . . . . . 12 | 2.3.1. Interaction with Metadata . . . . . . . . . . . . . . . . 10 | |||
| 3.10. Spamtest and Virustest . . . . . . . . . . . . . . . . . . 13 | ||||
| 3.11. Inapplicable Actions . . . . . . . . . . . . . . . . . . . 13 | ||||
| 4. New Sieve Environment Items . . . . . . . . . . . . . . . 14 | 3. Applicable Sieve Actions and Interactions . . . . . . . . 11 | |||
| 4.1. New Sieve Environment Items: imapuser and imapemail . . . 14 | 3.1. The Implicit Keep . . . . . . . . . . . . . . . . . . . . 11 | |||
| 4.2. New Sieve Environment Item: cause . . . . . . . . . . . . 14 | 3.2. The Keep Action . . . . . . . . . . . . . . . . . . . . . 11 | |||
| 4.3. New Sieve Environment Item: mailbox . . . . . . . . . . . 14 | 3.3. The Fileinto Action . . . . . . . . . . . . . . . . . . . 11 | |||
| 4.4. New Sieve Environment Item: changedflags . . . . . . . . . 15 | 3.4. The Redirect Action . . . . . . . . . . . . . . . . . . . 12 | |||
| 4.5. Interaction With Sieve Tests (Comparisons) . . . . . . . . 15 | 3.5. The Discard Action . . . . . . . . . . . . . . . . . . . . 12 | |||
| 3.6. The Notify Action . . . . . . . . . . . . . . . . . . . . 13 | ||||
| 3.7. The Addheader and Deleteheader Actions . . . . . . . . . . 13 | ||||
| 3.8. The Setflag, Deleteflag, and Removeflag Actions . . . . . 13 | ||||
| 3.9. MIME Part Tests and Replacement . . . . . . . . . . . . . 13 | ||||
| 3.10. Spamtest and Virustest . . . . . . . . . . . . . . . . . . 14 | ||||
| 3.11. Inapplicable Actions . . . . . . . . . . . . . . . . . . . 14 | ||||
| 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . 16 | 4. Interaction With Sieve Environment . . . . . . . . . . . . 15 | |||
| 4.1. Base Sieve Environment Items: location and phase . . . . . 15 | ||||
| 4.2. New Sieve Environment Items: imapuser and imapemail . . . 15 | ||||
| 4.3. New Sieve Environment Item: cause . . . . . . . . . . . . 15 | ||||
| 4.4. New Sieve Environment Item: mailbox . . . . . . . . . . . 16 | ||||
| 4.5. New Sieve Environment Item: changedflags . . . . . . . . . 16 | ||||
| 4.6. Interaction With Sieve Tests (Comparisons) . . . . . . . . 16 | ||||
| 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . 17 | ||||
| 6. Security Considerations . . . . . . . . . . . . . . . . . 17 | 6. Security Considerations . . . . . . . . . . . . . . . . . 18 | |||
| 7. IANA Considerations . . . . . . . . . . . . . . . . . . . 18 | 7. IANA Considerations . . . . . . . . . . . . . . . . . . . 19 | |||
| 7.1. Registration of IMAPSIEVE IMAP capability . . . . . . . . 18 | 7.1. Registration of "imapsieve" IMAP capability . . . . . . . 19 | |||
| 7.2. Registration of imapsieve Sieve extension . . . . . . . . 18 | 7.2. Registration of imapsieve Sieve extension . . . . . . . . 19 | |||
| 7.3. Registration of environment item: cause . . . . . . . . . 18 | 7.3. Registration of environment item: cause . . . . . . . . . 19 | |||
| 7.4. Registration of environment item: mailbox . . . . . . . . 19 | 7.4. Registration of environment item: mailbox . . . . . . . . 20 | |||
| 7.5. Registration of environment item: changedflags . . . . . . 19 | 7.5. Registration of environment item: changedflags . . . . . . 20 | |||
| 7.6. Registration of environment item: imapuser . . . . . . . . 19 | 7.6. Registration of environment item: imapuser . . . . . . . . 20 | |||
| 7.7. Registration of environment item: imapemail . . . . . . . 20 | 7.7. Registration of environment item: imapemail . . . . . . . 21 | |||
| 7.8. Registration of IMAP METADATA mailbox entry name . . . . . 20 | 7.8. Registration of IMAP METADATA mailbox entry name . . . . . 21 | |||
| 7.9. Registration of IMAP METADATA server entry name . . . . . 21 | 7.9. Registration of IMAP METADATA server entry name . . . . . 22 | |||
| 8. References . . . . . . . . . . . . . . . . . . . . . . . . 22 | 8. References . . . . . . . . . . . . . . . . . . . . . . . . 23 | |||
| 8.1. Normative References . . . . . . . . . . . . . . . . . . . 22 | 8.1. Normative References . . . . . . . . . . . . . . . . . . . 23 | |||
| 8.2. Non-Normative References . . . . . . . . . . . . . . . . . 22 | 8.2. Non-Normative References . . . . . . . . . . . . . . . . . 23 | |||
| Author's Address . . . . . . . . . . . . . . . . . . . . . 24 | Author's Address . . . . . . . . . . . . . . . . . . . . . 25 | |||
| 1. Introduction | 1. Introduction | |||
| 1.1. Overview | 1.1. Overview | |||
| Some applications have a need to apply Sieve filters [RFC5228] in | Some applications have a need to apply Sieve filters [RFC5228] in | |||
| situations other than initial mail delivery. This is especially true | contexts other than initial mail delivery. This is especially true | |||
| in diverse service environments, such as when the client is | in diverse service environments, such as when the client is | |||
| sporadically connected, is connected through a high-latency or high- | sporadically connected, is connected through a high-latency or high- | |||
| cost channel, or is on a limited-function device. For such clients, | cost channel, or is on a limited-function device. For such clients, | |||
| it may be very important, for higher performance and reliability, to | it may be very important, for higher performance and reliability, to | |||
| take advantage of server capabilities, including those provided by | take advantage of server capabilities, including those provided by | |||
| Sieve filtering (and Sieve extensions, such as Notify [RFC5435]). | Sieve filtering (and Sieve extensions, such as Notify [RFC5435]). | |||
| This specification defines extensions to IMAP [RFC3501] to support | This specification defines extensions to IMAP [RFC3501] to support | |||
| the invocation of Sieve scripts at times when the IMAP server creates | the invocation of Sieve scripts at times when the IMAP server creates | |||
| new messages or modifies existing ones. It also defines how Sieve | new messages or modifies existing ones. It also defines how Sieve | |||
| scripts will process these invocations. Support for IMAPSieve | scripts will process these invocations. Support for IMAP events in | |||
| requires support for IMAP Metadata [RFC5464] and Sieve Environment | Sieve requires support for IMAP Metadata [RFC5464] and Sieve | |||
| [RFC5183] as well, because Metadata is used to associate scripts with | Environment [RFC5183] as well, because Metadata is used to associate | |||
| IMAP mailboxes and Environment defines an important way for Sieve | scripts with IMAP mailboxes and Environment defines an important way | |||
| scripts to test the conditions under which they have been invoked. | for Sieve scripts to test the conditions under which they have been | |||
| invoked. | ||||
| 1.2. Conventions used in this document | 1.2. Differences Between IMAP Events and Mail Delivery | |||
| Invoking Sieve scripts in a context other than initial mail delivery | ||||
| introduces new situations, which changes the applicability of Sieve | ||||
| features and creates implementation challenges and user interface | ||||
| issues. This section discusses some of those differences, | ||||
| challenges, and issues. | ||||
| At times other than message delivery, delivery "envelope" | ||||
| information, might not be available. With messages added through | ||||
| IMAP APPEND, there might be no way to even guess who the intended | ||||
| recipient is, and no concept of who "sent" the message. Sieve | ||||
| actions that relate to contacting the sender, for example, will not | ||||
| be applicable. | ||||
| Because IMAP events will often be triggered by user actions, and | ||||
| because user interfaces allow bulk actions that differ from | ||||
| individual message arrival, it now becomes possible for a single user | ||||
| action, such as drag-and-drop, to initiate Sieve script processing on | ||||
| a large number of messages at once. Implementations will have to | ||||
| deal with such situations as a "COPY" action or flag changes on | ||||
| dozens, or even thousands of messages. | ||||
| Other issues might surface as this extension is deployed and | ||||
| experience with it develops. | ||||
| 1.3. Conventions used in this document | ||||
| The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
| "SHOULD", "SHOULD NOT", "MAY", and "OPTIONAL" in this document are to | "SHOULD", "SHOULD NOT", "MAY", and "OPTIONAL" in this document are to | |||
| be interpreted as described in [RFC2119]. | be interpreted as described in [RFC2119]. | |||
| 2. The IMAPSieve Extension | 1.4. Notes from Reviews, and To-Do Items | |||
| 2.1. The "IMAPSieve" Capability String | [[anchor3: This section should be resolved and removed prior to | |||
| publication.]] | ||||
| [[anchor1: Should we use "imapsieve" for both of these, as here? Or | Stephan Bosch: 4) Invoking the Sieve script linked to the mailbox for | |||
| should we use something like "SieveEvents" for the IMAP capability | every possible event seems inefficient, especially when only one | |||
| and "IMAPEvents" for the Sieve capability? I rather think it's less | event (e.g. APPEND) is of interest. Whould a means to explicitly | |||
| confusing to use the same string for both.]] | select which events are applicable for a (mailbox, script) pair be | |||
| useful? | ||||
| An IMAP server advertises support for this extension through the | Barry: We did discuss the general issue of multiple scripts, and I | |||
| capability string "IMAPSieve" (the string is not case-sensitive, and | had originally planned to have separate scripts for each event | |||
| is shown here with this capitalization for readability). A server | type ("cause"). In the end, we decided that was too complicated, | |||
| that advertises IMAPSieve is claiming to be in compliance with this | and could be added as a later extension if it turns out to be | |||
| specification in all aspects. | important. | |||
| Stephan Bosch: 6) Allowing redirect seems risky. What if I | ||||
| accidently 'drag' in my mailclient the content of some enormous | ||||
| mailing list mailbox to a Sieve-enabled mailbox with a redirect? | ||||
| Shouldn't this at least be bounded somehow? | ||||
| Barry: I don't know if we can specify what to do -- I don't know | ||||
| if we KNOW what to do -- but I've incorporated this into my answer | ||||
| to (7), below. | ||||
| Stephan Bosch: 7) Since this document essentially defines a whole new | ||||
| context in which Sieve scripts can be executed, it can be helpful for | ||||
| the reader to have an introductory section that outlines and | ||||
| summarizes the main differences between the new and the familiar | ||||
| context, e.g. things like the lack of an envelope as pointed out | ||||
| earlier on this list, the undesirability of sending responses back to | ||||
| senders, etc. | ||||
| Barry: I've added a section to the introduction, "Differences | ||||
| Between IMAP Events and Mail Delivery". Please review it, and see | ||||
| if there's stuff to add. | ||||
| To Do: "Interaction with Metadata": Add text requiring ManageSieve, | ||||
| and giving ManageSieve URI in IMAP capability. | ||||
| To Do: "Interaction with Metadata": Add ManageSieve action to set | ||||
| metadata item. | ||||
| 2. The IMAP Events in Sieve Extension | ||||
| 2.1. The "imapsieve" Capability Strings | ||||
| An IMAP server advertises support for IMAP events in Sieve through | ||||
| the capability string "imapsieve". A server that advertises | ||||
| "imapsieve" is claiming to be in compliance with this specification | ||||
| in all aspects. | ||||
| The corresponding Sieve implementation uses the Sieve capability | The corresponding Sieve implementation uses the Sieve capability | |||
| string "IMAPSieve (also case-insensitive), and scripts that depend | string "imapsieve", and Sieve scripts that depend upon the IMAP | |||
| upon the IMAP events MUST include that string in their "required" | events MUST include that string in their "required" lists. | |||
| lists. | ||||
| Implementations that support IMAPSieve MUST also support IMAP | Implementations that support IMAP events in Sieve MUST also support | |||
| Metadata [RFC5464] and Sieve Environment [RFC5183], because Metadata | IMAP Metadata [RFC5464] and Sieve Environment [RFC5183], because | |||
| is used to associate scripts with IMAP mailboxes and Environment | Metadata is used to associate scripts with IMAP mailboxes and | |||
| defines an important way for Sieve scripts to test the conditions | Environment defines an important way for Sieve scripts to test the | |||
| under which they have been invoked. Notwithstanding the support | conditions under which they have been invoked. Notwithstanding the | |||
| requirement, scripts that directly use Environment MUST also include | support requirement, scripts that directly use Environment MUST also | |||
| its capability string in their "required" lists. | include its capability string in their "required" lists. | |||
| 2.2. Existing IMAP Functions Affected by IMAPSieve | 2.2. Existing IMAP Functions Affected by IMAP events in Sieve | |||
| The subsections below describe in detail the IMAP commands and | The subsections below describe in detail the IMAP commands and | |||
| situations on which IMAPSieve has an effect. Not all Sieve actions | situations on which IMAP events in Sieve have an effect. Not all | |||
| make sense in the case of messages affected by IMAP commands. See | Sieve actions make sense in the case of messages affected by IMAP | |||
| Section 3 for details. | commands. See Section 3 for details. | |||
| It's important to note that since the base Sieve specification (see | It's important to note that since the base Sieve specification (see | |||
| [RFC5228]) and its extensions define functions for scripts that are | [RFC5228]) and its extensions define functions for scripts that are | |||
| invoked during initial mail delivery, those function definitions are | invoked during initial mail delivery, those function definitions are | |||
| necessarily tailored to and limited by that context. This document | necessarily tailored to and limited by that context. This document | |||
| extends those function definitions for use during IMAP events. By | extends those function definitions for use during IMAP events. By | |||
| nature of that, Sieve functions, in this extended context, may behave | nature of that, Sieve functions, in this extended context, may behave | |||
| somewhat differently, though their extended behaviour will still be | somewhat differently, though their extended behaviour will still be | |||
| consistent with the functions' goals. | consistent with the functions' goals. | |||
| If more than one message is affected at the same time, each message | If more than one message is affected at the same time, each message | |||
| triggers the execution of a Sieve script separately. The scripts MAY | triggers the execution of a Sieve script separately. The scripts MAY | |||
| be run in parallel. | be run in parallel. | |||
| 2.2.1. The IMAP APPEND Command | 2.2.1. The IMAP APPEND Command | |||
| A message may be added to a mailbox through the IMAP APPEND command. | A message may be added to a mailbox through the IMAP APPEND command. | |||
| In a server that advertises IMAPSieve, new messages added in this way | In a server that advertises "imapsieve", new messages added in this | |||
| MUST trigger the execution of a Sieve script, subject to the settings | way MUST trigger the execution of a Sieve script, subject to the | |||
| defined through Metadata (see Section 2.3.1). | settings defined through Metadata (see Section 2.3.1). | |||
| 2.2.2. The IMAP MULTIAPPEND Command | 2.2.2. The IMAP MULTIAPPEND Command | |||
| If the IMAP server supports the IMAP MultiAppend extension [RFC3502], | If the IMAP server supports the IMAP MultiAppend extension [RFC3502], | |||
| messages may be added to a mailbox through the IMAP MULTIAPPEND | messages may be added to a mailbox through the IMAP MULTIAPPEND | |||
| command. In a server that advertises IMAPSieve, new messages added | command. In a server that advertises "imapsieve", new messages added | |||
| in this way MUST trigger the execution of a Sieve script, as with the | in this way MUST trigger the execution of a Sieve script, as with the | |||
| APPEND command, also subject to the settings defined through | APPEND command, also subject to the settings defined through | |||
| Metadata. | Metadata. | |||
| 2.2.3. The IMAP COPY Command | 2.2.3. The IMAP COPY Command | |||
| One or more messages may be added to a mailbox through the IMAP COPY | One or more messages may be added to a mailbox through the IMAP COPY | |||
| command. In a server that advertises IMAPSieve, new messages added | command. In a server that advertises "imapsieve", new messages added | |||
| in this way MUST trigger the execution of a Sieve script, subject to | in this way MUST trigger the execution of a Sieve script, subject to | |||
| the settings defined through Metadata. | the settings defined through Metadata. | |||
| 2.2.4. Changes to IMAP Message Flags | 2.2.4. Changes to IMAP Message Flags | |||
| One or more existing messages can have their flags changed in a | One or more existing messages can have their flags changed in a | |||
| number of ways, including: | number of ways, including: | |||
| o The FETCH command (may cause the \Seen flag to be set). | o The FETCH command (may cause the \Seen flag to be set). | |||
| o The STORE command (may cause the \Answered, \Deleted, \Draft, | o The STORE command (may cause the \Answered, \Deleted, \Draft, | |||
| \Flagged, and \Seen flags to be set or reset, and may cause | \Flagged, and \Seen flags to be set or reset, and may cause | |||
| keywords to be set or reset). | keywords to be set or reset). | |||
| o The invocation of a Sieve script on an existing message, where the | o The invocation of a Sieve script on an existing message, where the | |||
| Sieve implementation supports the IMAP4Flags extension [RFC5232] | Sieve implementation supports the IMAP4Flags extension [RFC5232] | |||
| and the script uses one of the actions defined in that extension. | and the script uses one of the actions defined in that extension. | |||
| In a server that advertises IMAPSieve, messages whose flags are | In a server that advertises "imapsieve", messages whose flags are | |||
| changed in any way (except as explained in the next sentence) MUST | changed in any way (except as explained in the next sentence) MUST | |||
| trigger the execution of a Sieve script, subject to the settings | trigger the execution of a Sieve script, subject to the settings | |||
| defined through Metadata. The exception is that in order to avoid | defined through Metadata. The exception is that in order to avoid | |||
| script loops, flag changes that are made as a result of a script that | script loops, flag changes that are made as a result of a script that | |||
| was itself invoked because of flag changes SHOULD NOT result in | was itself invoked because of flag changes SHOULD NOT result in | |||
| another script invocation. In any case, implementations MUST take | another script invocation. In any case, implementations MUST take | |||
| steps to avoid such loops. | steps to avoid such loops. | |||
| For flag-change events, the Sieve script will see the message flags | For flag-change events, the Sieve script will see the message flags | |||
| as they are AFTER the changes. | as they are AFTER the changes. | |||
| 2.3. New Functions Defined by IMAPSieve | 2.3. New Functions Defined by IMAP events in Sieve | |||
| 2.3.1. Interaction with Metadata | 2.3.1. Interaction with Metadata | |||
| Support for IMAPSieve requires support for IMAP Metadata [RFC5464] as | Support for IMAP events in Sieve requires support for IMAP Metadata | |||
| well, since the latter is used to associate scripts with IMAP | [RFC5464] as well, since the latter is used to associate scripts with | |||
| mailboxes. | IMAP mailboxes. | |||
| When an applicable event occurs on an IMAP mailbox, if there is an | When an applicable event occurs on an IMAP mailbox, if there is an | |||
| IMAP metadata entry named "/IMAPSieve/Script" for the mailbox, that | IMAP metadata entry named "/IMAPSieve/Script" for the mailbox, that | |||
| entry is used. If there is not, but there is an IMAP metadata entry | entry is used. If there is not, but there is an IMAP metadata entry | |||
| named "/IMAPSieve/Script" for the server, that entry is used | named "/IMAPSieve/Script" for the server, that entry is used | |||
| (providing a way to define a global script for all mailboxes on a | (providing a way to define a global script for all mailboxes on a | |||
| server). If neither entry exists, then no script will be invoked. | server). If neither entry exists, then no script will be invoked. | |||
| If an "/IMAPSieve/Script" metadata entry was selected above, the | If an "/IMAPSieve/Script" metadata entry was selected above, the | |||
| shared value of that metadata name (its "value.shared" attribute) | shared value of that metadata name (its "value.shared" attribute) | |||
| MUST be the name of the Sieve script that will be invoked in response | MUST be the name of the Sieve script that will be invoked in response | |||
| to the IMAP event OR the name of another metadata entry, the name | to the IMAP event. Note that only the value.shared attribute is | |||
| prefixed with "metadata:" (such as "metadata:/IMAPSieve/ | used; any value.priv attributes are ignored. | |||
| ScriptContents"), that contains the actual script in its value.shared | ||||
| attribute. Note that only the value.shared attribute is used; any | ||||
| value.priv attributes are ignored. | ||||
| [[COMMENT FROM NED: But the real question is why should we limit | ||||
| ourselves this way? Why not make the contents of "/IMAPSieve/Script" | ||||
| a URL? (The metadata: prefix can then be defined as a URL.) If we | ||||
| want to reach into ManageSieve, use a sieve: URL. (I do see a big | ||||
| problem with this currently - RFC 5804 appears to have badly botched | ||||
| the specification of sieve: URLs - the authority field is mandatory | ||||
| when it shouldn't be, and the owner field is encoded into the URL | ||||
| path when it should have been extracted from the authority field if | ||||
| it is present. The way it's done now, you cannot write | ||||
| sieve:///scriptname and have it mean what it should mean: Select out | ||||
| of the mailbox owner's scripts. -------- Now, there is no doubt that | ||||
| allowing URLs creates additional concerns, mostly security related. | ||||
| But we've dealt with this sort of thing before, e.g., in BURL. All | ||||
| we have to say is that metadata:foo MUST be implemented and sieve:bar | ||||
| (modulo some fixes to RFC 5804) SHOULD work if ManageSieve is | ||||
| available. -------- If this goes too far, then at a minimum I believe | ||||
| this section needs to be more explicit about how, if ManageSieve is | ||||
| used, the mapping from script collections in ManageSieve to a mailbox | ||||
| works.]] | ||||
| This specifies the mechanism for "activating" a script for a given | This specifies the mechanism for "activating" a script for a given | |||
| mailbox (or for all mailboxes), but does not specify a mechanism for | mailbox (or for all mailboxes), but does not specify a mechanism for | |||
| creating, storing, or validating the script. Implementations MAY use | creating, storing, or validating the script. Implementations MUST | |||
| ManageSieve [RFC5804] to acomplish this, using the PUTSCRIPT command | support ManageSieve [RFC5804], and can use the PUTSCRIPT command to | |||
| to store the script without using the SETACTIVE command to activate | store the script without using the SETACTIVE command to activate it. | |||
| it. In any case, the script name that is specified in the | In any case, the script name that is specified in the /IMAPSieve/ | |||
| /IMAPSieve/Script metadata entry is in a form that depends upon how | Script metadata entry is in a form that depends upon how the server | |||
| the server handles the storing of Sieve scripts. | handles the storing of Sieve scripts. Script names used here MUST | |||
| match script names used by METADATA. | ||||
| Only one Sieve script may currently be defined per mailbox, | Only one Sieve script may currently be defined per mailbox, | |||
| eliminating the complexity and possible ambiguity involved with | eliminating the complexity and possible ambiguity involved with | |||
| coordinating the results of multiple scripts. Any sub-filtering is | coordinating the results of multiple scripts. Any sub-filtering is | |||
| done in the Sieve script. For example, if it's only necessary to | done in the Sieve script. For example, if it's only necessary to | |||
| deal with flag changes, but not with new messages appended or copied, | deal with flag changes, but not with new messages appended or copied, | |||
| the Sieve script will still be invoked for all events, and the script | the Sieve script will still be invoked for all events, and the script | |||
| is responsible for checking the event type. | is responsible for checking the event type. | |||
| The possibility is open for an extension to add support for multiple | The possibility is open for an extension to add support for multiple | |||
| skipping to change at page 10, line 19 ¶ | skipping to change at page 11, line 19 ¶ | |||
| created by other means or when changes are made to data associated | created by other means or when changes are made to data associated | |||
| with existing messages. This section describes how actions in the | with existing messages. This section describes how actions in the | |||
| base Sieve specification, and those in extensions known at this | base Sieve specification, and those in extensions known at this | |||
| writing, relate to this specification. | writing, relate to this specification. | |||
| In addition to what is specified here, interactions noted in the | In addition to what is specified here, interactions noted in the | |||
| individual specifications apply, and must be considered. | individual specifications apply, and must be considered. | |||
| 3.1. The Implicit Keep | 3.1. The Implicit Keep | |||
| For all cases that fall under IMAPSieve, the implicit keep means that | For all cases that fall under IMAP events in Sieve, the implicit keep | |||
| the message is treated as it would have been if no Sieve script were | means that the message is treated as it would have been if no Sieve | |||
| run. For APPEND, MULTIAPPEND and COPY, the message is stored into | script were run. For APPEND, MULTIAPPEND and COPY, the message is | |||
| the target mailbox normally. For flag changes, the message is left | stored into the target mailbox normally. For flag changes, the | |||
| in the mailbox. If actions have been taken that change the message, | message is left in the mailbox. If actions have been taken that | |||
| those changes are considered transient and MUST NOT be retained for | change the message, those changes are considered transient and MUST | |||
| any keep action (because IMAP messages are immutable). No error is | NOT be retained for any keep action (because IMAP messages are | |||
| generated, but the original message, without the changes, is kept. | immutable). No error is generated, but the original message, without | |||
| the changes, is kept. | ||||
| 3.2. The Keep Action | 3.2. The Keep Action | |||
| The keep action is applicable in all cases that fall under IMAPSieve. | The keep action is applicable in all cases that fall under IMAP | |||
| Its behaviour is as described for implicit keep, in Section 3.1. | events in Sieve. Its behaviour is as described for implicit keep, in | |||
| Section 3.1. | ||||
| 3.3. The Fileinto Action | 3.3. The Fileinto Action | |||
| If the Sieve implementation supports the fileinto action, that action | If the Sieve implementation supports the fileinto action, that action | |||
| is applicable in all cases that fall under IMAPSieve. If the Copy | is applicable in all cases that fall under IMAP events in Sieve. If | |||
| extension [RFC3894] is available and the :copy option is specified, | the Copy extension [RFC3894] is available and the :copy option is | |||
| the implicit keep is retained; otherwise, fileinto cancels the | specified, the implicit keep is retained; otherwise, fileinto cancels | |||
| implicit keep, as specified in the base Sieve specification. | the implicit keep, as specified in the base Sieve specification. | |||
| For APPEND, MULTIAPPEND, and COPY, the message is stored into the | For APPEND, MULTIAPPEND, and COPY, the message is stored into the | |||
| fileinto mailbox IN ADDITION TO the original target mailbox. For | fileinto mailbox IN ADDITION TO the original target mailbox. For | |||
| flag changes, the message is COPIED into the fileinto mailbox, | flag changes, the message is COPIED into the fileinto mailbox, | |||
| without removing the original. | without removing the original. | |||
| If a keep action is NOT also in effect, the original message is then | If a keep action is NOT also in effect, the original message is then | |||
| marked with the \Deleted flag (and a flag-change Sieve script is NOT | marked with the \Deleted flag (and a flag-change Sieve script is NOT | |||
| invoked). The implementation MAY then expunge the original message | invoked). The implementation MAY then expunge the original message | |||
| (WITHOUT expunging other messages in the mailbox), or it MAY choose | (WITHOUT expunging other messages in the mailbox), or it MAY choose | |||
| skipping to change at page 11, line 4 ¶ | skipping to change at page 12, line 6 ¶ | |||
| flag changes, the message is COPIED into the fileinto mailbox, | flag changes, the message is COPIED into the fileinto mailbox, | |||
| without removing the original. | without removing the original. | |||
| If a keep action is NOT also in effect, the original message is then | If a keep action is NOT also in effect, the original message is then | |||
| marked with the \Deleted flag (and a flag-change Sieve script is NOT | marked with the \Deleted flag (and a flag-change Sieve script is NOT | |||
| invoked). The implementation MAY then expunge the original message | invoked). The implementation MAY then expunge the original message | |||
| (WITHOUT expunging other messages in the mailbox), or it MAY choose | (WITHOUT expunging other messages in the mailbox), or it MAY choose | |||
| to have expunges batched, or done by a user. If the server does the | to have expunges batched, or done by a user. If the server does the | |||
| expunge, the effect is as though a client had flagged the message and | expunge, the effect is as though a client had flagged the message and | |||
| done a UID EXPUNGE (see [RFC4315]) on the affected message(s) only. | done a UID EXPUNGE (see [RFC4315]) on the affected message(s) only. | |||
| Handling it this way allows clients to handle messages consistently, | Handling it this way allows clients to handle messages consistently, | |||
| and avoids hidden changes that might invalidate their message caches. | and avoids hidden changes that might invalidate their message caches. | |||
| 3.4. The Redirect Action | 3.4. The Redirect Action | |||
| The redirect action is applicable in all cases that fall under | The redirect action is applicable in all cases that fall under IMAP | |||
| IMAPSieve. It causes the message to be sent, as specified in the | events in Sieve. It causes the message to be sent, as specified in | |||
| base Sieve specification, to the designated address. If the Copy | the base Sieve specification, to the designated address. If the Copy | |||
| extension [RFC3894] is available and the :copy option is specified, | extension [RFC3894] is available and the :copy option is specified, | |||
| the implicit keep is retained; otherwise, redirect cancels the | the implicit keep is retained; otherwise, redirect cancels the | |||
| implicit keep, as specified in the base Sieve specification. | implicit keep, as specified in the base Sieve specification. | |||
| It's possible that a message processed in this way does not have the | It's possible that a message processed in this way does not have the | |||
| information necessary to be redirected properly. It might lack | information necessary to be redirected properly. It might lack | |||
| necessary header information, and there might not be appropriate | necessary header information, and there might not be appropriate | |||
| information for the MAIL FROM command. In such cases, the "redirect" | information for the MAIL FROM command. In such cases, the "redirect" | |||
| action uses Message Submission [RFC4409], and it is up to the Sieve | action uses Message Submission [RFC4409], and it is up to the Sieve | |||
| engine to supply the missing information. The redirect address is, | engine to supply the missing information. The redirect address is, | |||
| skipping to change at page 11, line 46 ¶ | skipping to change at page 12, line 47 ¶ | |||
| invoked). The implementation MAY then expunge the original message | invoked). The implementation MAY then expunge the original message | |||
| (WITHOUT expunging other messages in the mailbox), or it MAY choose | (WITHOUT expunging other messages in the mailbox), or it MAY choose | |||
| to have expunges batched, or done by a user. If the server does the | to have expunges batched, or done by a user. If the server does the | |||
| expunge, the effect is as though a client had flagged the message and | expunge, the effect is as though a client had flagged the message and | |||
| done a UID EXPUNGE (see [RFC4315]) on the affected message(s) only. | done a UID EXPUNGE (see [RFC4315]) on the affected message(s) only. | |||
| Handling it this way allows clients to handle messages consistently, | Handling it this way allows clients to handle messages consistently, | |||
| and avoids hidden changes that might invalidate their message caches. | and avoids hidden changes that might invalidate their message caches. | |||
| 3.5. The Discard Action | 3.5. The Discard Action | |||
| The discard action is applicable in all cases that fall under | The discard action is applicable in all cases that fall under IMAP | |||
| IMAPSieve. For APPEND, MULTIAPPEND, and COPY, the message is first | events in Sieve. For APPEND, MULTIAPPEND, and COPY, the message is | |||
| stored into the target mailbox. If an explicit keep action is also | first stored into the target mailbox. If an explicit keep action is | |||
| in effect, the discard action now does nothing. Otherwise, the | also in effect, the discard action now does nothing. Otherwise, the | |||
| original message is then marked with the \Deleted flag (and a flag- | original message is then marked with the \Deleted flag (and a flag- | |||
| change Sieve script is NOT invoked). The implementation MAY then | change Sieve script is NOT invoked). The implementation MAY then | |||
| expunge the original message (WITHOUT expunging other messages in the | expunge the original message (WITHOUT expunging other messages in the | |||
| mailbox), or it MAY choose to have expunges batched, or done by a | mailbox), or it MAY choose to have expunges batched, or done by a | |||
| user. If the server does the expunge, the effect is as though a | user. If the server does the expunge, the effect is as though a | |||
| client had flagged the message and done a UID EXPUNGE (see [RFC4315]) | client had flagged the message and done a UID EXPUNGE (see [RFC4315]) | |||
| on the affected message(s) only. Handling it this way allows clients | on the affected message(s) only. Handling it this way allows clients | |||
| to handle messages consistently, and avoids hidden changes that might | to handle messages consistently, and avoids hidden changes that might | |||
| invalidate their message caches. | invalidate their message caches. | |||
| 3.6. The Notify Action | 3.6. The Notify Action | |||
| If the Nofity extension [RFC5435] is available, the notify action is | If the Nofity extension [RFC5435] is available, the notify action is | |||
| applicable in all cases that fall under IMAPSieve. The result is | applicable in all cases that fall under IMAP events in Sieve. The | |||
| that the requested notification is sent, and that the message is | result is that the requested notification is sent, and that the | |||
| otherwise handled as it would normally have been. | message is otherwise handled as it would normally have been. | |||
| 3.7. The Addheader and Deleteheader Actions | 3.7. The Addheader and Deleteheader Actions | |||
| If the EditHeader extension [RFC5293] is available, it can be used to | If the EditHeader extension [RFC5293] is available, it can be used to | |||
| make transient changes to header fields, which aren't saved in place, | make transient changes to header fields, which aren't saved in place, | |||
| such as for "redirect" or "fileinto" actions. Because messages in | such as for "redirect" or "fileinto" actions. Because messages in | |||
| IMAP mailboxes are immutable, such changes are NOT applicable for the | IMAP mailboxes are immutable, such changes are NOT applicable for the | |||
| "keep" acton (explicit or implicit). See Section 3.1. | "keep" acton (explicit or implicit). See Section 3.1. | |||
| 3.8. The Setflag, Deleteflag, and Removeflag Actions | 3.8. The Setflag, Deleteflag, and Removeflag Actions | |||
| Implementations of the IMAPSieve extension MUST also support the | Implementations of IMAP events in Sieve MUST also support the | |||
| IMAP4Flags extension [RFC5232], and the actions associated with it | IMAP4Flags extension [RFC5232], and the actions associated with it | |||
| are all applicable to any case that falls under IMAPSieve. | are all applicable to any case that falls under IMAP events in Sieve. | |||
| It is worth noting also that the "hasflag" test that is defined in | It is worth noting also that the "hasflag" test that is defined in | |||
| the IMAP4Flags extension might be particularly useful in scripts | the IMAP4Flags extension might be particularly useful in scripts | |||
| triggered by flag changes ("hasflag" will see the new, changed | triggered by flag changes ("hasflag" will see the new, changed | |||
| flags). The flag changes behave as though a client had made the | flags). The flag changes behave as though a client had made the | |||
| change. | change. | |||
| As explained above, in order to avoid script loops flag changes that | As explained above, in order to avoid script loops flag changes that | |||
| are made as a result of a script that was itself invoked because of | are made as a result of a script that was itself invoked because of | |||
| flag changes SHOULD NOT result in another script invocation. In any | flag changes SHOULD NOT result in another script invocation. In any | |||
| skipping to change at page 13, line 8 ¶ | skipping to change at page 14, line 10 ¶ | |||
| functions can be used, but any changes made to the message, using the | functions can be used, but any changes made to the message, using the | |||
| "replace" or "enclose" action, MUST be considered transient, and are | "replace" or "enclose" action, MUST be considered transient, and are | |||
| only applicable with actions such as "redirect" and "fileinto". | only applicable with actions such as "redirect" and "fileinto". | |||
| Because messages in IMAP mailboxes are immutable, such changes are | Because messages in IMAP mailboxes are immutable, such changes are | |||
| NOT applicable for the "keep" acton (explicit or implicit). See | NOT applicable for the "keep" acton (explicit or implicit). See | |||
| Section 3.1. | Section 3.1. | |||
| 3.10. Spamtest and Virustest | 3.10. Spamtest and Virustest | |||
| If the Spamtest and Virustest extensions [RFC5235] are available, | If the Spamtest and Virustest extensions [RFC5235] are available, | |||
| they are applicable in all cases that fall under IMAPSieve. | they are applicable in all cases that fall under IMAP events in | |||
| Sieve. | ||||
| 3.11. Inapplicable Actions | 3.11. Inapplicable Actions | |||
| The following actions and extensions are NOT applicable to any case | The following actions and extensions are NOT applicable to any case | |||
| that falls under IMAPSieve. Their use or their appearance in the | that falls under IMAP events in Sieve, because they are specifically | |||
| "require" control MUST result in an error condition that will | designed to respond to delivery of a new email message. Their | |||
| terminate the Sieve script: | appearance in the "require" control or their use in an IMAP event | |||
| MUST result in an error condition that will terminate the Sieve | ||||
| script: | ||||
| reject [RFC5228] | reject [RFC5228] | |||
| ereject [RFC5429] | ereject [RFC5429] | |||
| vacation [RFC5230] | vacation [RFC5230] | |||
| 4. New Sieve Environment Items | Future extensions that are specifically designed to respond to | |||
| delivery of a new email message will likewise not be applicable to | ||||
| this extension. | ||||
| 4.1. New Sieve Environment Items: imapuser and imapemail | 4. Interaction With Sieve Environment | |||
| 4.1. Base Sieve Environment Items: location and phase | ||||
| The Sieve Environment extension defines a set of standard environment | ||||
| items (see [RFC5183], Section 4.1). Two of those items are affected | ||||
| when the script is invoked through an IMAP event. | ||||
| The value of "location" is set to "MS" -- evaluation is being | ||||
| performed by a Message Store. | ||||
| The value of "phase" is set to "post" -- processing is taking place | ||||
| after (or perhaps instead of, in the case of APPEND) final delivery. | ||||
| 4.2. New Sieve Environment Items: imapuser and imapemail | ||||
| In the normal case, when Sieve is used in final delivery, there is no | In the normal case, when Sieve is used in final delivery, there is no | |||
| identity for the "filer" -- the user who is creating or changing the | identity for the "filer" -- the user who is creating or changing the | |||
| message. In this case, there is such an identity, and a Sieve script | message. In this case, there is such an identity, and a Sieve script | |||
| might want to access that identity. | might want to access that identity. | |||
| Implementations MUST set and make available two new environment | Implementations MUST set and make available two new environment | |||
| items: | items: | |||
| "imapuser" -- the identity (login ID) of the IMAP user that caused | "imapuser" -- the identity (login ID) of the IMAP user that caused | |||
| the action. This MUST be the empty string if it is accessed during | the action. This MUST be the empty string if it is accessed during | |||
| normal (final delivery) Sieve processing. | normal (final delivery) Sieve processing. | |||
| "imapemail" -- the primary email address of the IMAP user that caused | "imapemail" -- the primary email address of the IMAP user that caused | |||
| the action (the user identified by "imapuser"). In some | the action (the user identified by "imapuser"). In some | |||
| implementations, "imapuser" and "imapemail" might have the same | implementations, "imapuser" and "imapemail" might have the same | |||
| value. This MUST be the empty string if it is accessed during normal | value. This MUST be the empty string if it is accessed during normal | |||
| (final delivery) Sieve processing. | (final delivery) Sieve processing. | |||
| 4.2. New Sieve Environment Item: cause | 4.3. New Sieve Environment Item: cause | |||
| Implementations MAY invoke different Sieve scripts for the different | ||||
| conditions described in this document (append, copy, flag changes). | ||||
| If the actions to be taken are common, and the implementation | ||||
| supports the Include extension [I-D.ietf-sieve-include], the common | ||||
| script code can be included as specified there. | ||||
| Each mailbox uses a single script for all the change conditions | Each mailbox uses a single script for all the change conditions | |||
| described in this document (append, copy, flag changes). To support | described in this document (append, copy, flag changes). To support | |||
| that, the implementation MUST set the Environment [RFC5183] item | that, the implementation MUST set the Environment [RFC5183] item | |||
| "cause", which contains the name of the action that caused the script | "cause", which contains the name of the action that caused the script | |||
| to be invoked. Its value is one of the following: | to be invoked. Its value is one of the following: | |||
| o APPEND (for invocations resulting from APPEND or MULTIAPPEND) | o APPEND (for invocations resulting from APPEND or MULTIAPPEND) | |||
| o COPY (for invocations resulting from COPY) | o COPY (for invocations resulting from COPY) | |||
| o FLAG (for invocations resulting from flag changes) | o FLAG (for invocations resulting from flag changes) | |||
| Future extensions might define new events and, thus, new causes. | ||||
| Such extensions will come with their own capability strings, and the | ||||
| events they define will only be presented when their capabilities are | ||||
| requested. Scripts that do not request those capabilities will not | ||||
| see those events, and will not encounter the new cause strings. | ||||
| 4.3. New Sieve Environment Item: mailbox | 4.4. New Sieve Environment Item: mailbox | |||
| The implementation MUST set the Environment [RFC5183] item "mailbox" | The implementation MUST set the Environment [RFC5183] item "mailbox" | |||
| to the name of the mailbox that the affected message is in, in the | to the name of the mailbox that the affected message is in, in the | |||
| case of existing messages, or is targeted to be stored into, in the | case of existing messages, or is targeted to be stored into, in the | |||
| case of new messages. The value of this item is fixed when the | case of new messages. The value of this item is fixed when the | |||
| script begins, and, in particular, MUST NOT change as a result of any | script begins, and, in particular, MUST NOT change as a result of any | |||
| action, such as "fileinto". | action, such as "fileinto". | |||
| 4.4. New Sieve Environment Item: changedflags | 4.5. New Sieve Environment Item: changedflags | |||
| If the IMAP4Flags extension [RFC5232] is available, AND the script | If the IMAP4Flags extension [RFC5232] is available, AND the script | |||
| was invoked because of flag changes to an existing message, the | was invoked because of flag changes to an existing message, the | |||
| implementation MUST set the Environment [RFC5183] item "changedflags" | implementation MUST set the Environment [RFC5183] item "changedflags" | |||
| to the name(s) of the flag(s) that have changed. If the script was | to the name(s) of the flag(s) that have changed. If the script was | |||
| not invoked because of flag changes, the value of this item MUST be | not invoked because of flag changes, the value of this item MUST be | |||
| the empty string. The script will not know from this item whether | the empty string. The script will not know from this item whether | |||
| the flags have been set or reset, but it can use the "hasflag" test | the flags have been set or reset, but it can use the "hasflag" test | |||
| to determine the current value. See example 2 in Section 5 for an | to determine the current value. See example 2 in Section 5 for an | |||
| example of how this might be used. | example of how this might be used. | |||
| 4.5. Interaction With Sieve Tests (Comparisons) | 4.6. Interaction With Sieve Tests (Comparisons) | |||
| This extension does not affect the operation of tests or comparisons | Any tests against message envelope information, including the | |||
| in the Sieve base specification. | "envelope" test in the Sieve base specification, as well as any such | |||
| test defined in extensions, are either inapplicable or have serious | ||||
| interoperability issues when performed at other than final-delivery | ||||
| time. Therefore, envelope tests MUST NOT be permitted in the cases | ||||
| described here, and their use MUST generate a runtime error. | ||||
| This extension does not affect the operation of other tests or | ||||
| comparisons in the Sieve base specification. | ||||
| 5. Examples | 5. Examples | |||
| Example 1: | Example 1: | |||
| If a new message is added to the "ActionItems" mailbox, a copy is | If a new message is added to the "ActionItems" mailbox, a copy is | |||
| sent to the address "actionitems@example.com". | sent to the address "actionitems@example.com". | |||
| require ["copy", "environment"]; | require ["copy", "environment", "imapsieve"]; | |||
| if anyof (environment :is "cause" "APPEND", | if anyof (environment :is "cause" "APPEND", | |||
| environment :is "cause" "COPY") { | environment :is "cause" "COPY") { | |||
| if environment :is "mailbox" "ActionItems" { | if environment :is "mailbox" "ActionItems" { | |||
| redirect :copy "actionitems@example.com"; | redirect :copy "actionitems@example.com"; | |||
| } | } | |||
| } | } | |||
| Example 2: | Example 2: | |||
| If the script is called for any message with the \Flagged flag set | If the script is called for any message with the \Flagged flag set | |||
| (tested through the IMAP4Flags extension [RFC5232]), a notification | (tested through the IMAP4Flags extension [RFC5232]), a notification | |||
| is sent using the Notify extension [RFC5435]. No notification will | is sent using the Notify extension [RFC5435]. No notification will | |||
| be sent, though, if we're called with an existing message that | be sent, though, if we're called with an existing message that | |||
| already had that flag set. | already had that flag set. | |||
| require ["enotify", "imap4flags", "variables", "environment"]; | require ["enotify", "imap4flags", "variables", | |||
| "environment", "imapsieve"]; | ||||
| if environment :matches "mailbox" "*" { | if environment :matches "mailbox" "*" { | |||
| set "mailbox" "${1}"; | set "mailbox" "${1}"; | |||
| } | } | |||
| if allof (hasflag "\\Flagged", | if allof (hasflag "\\Flagged", | |||
| not environment :contains "changedflags" "\\Flagged") { | not environment :contains "changedflags" "\\Flagged") { | |||
| notify :message "Important message in ${mailbox}" | notify :message "Important message in ${mailbox}" | |||
| "xmpp:tim@example.com?message;subject=SIEVE"; | "xmpp:tim@example.com?message;subject=SIEVE"; | |||
| } | } | |||
| skipping to change at page 18, line 7 ¶ | skipping to change at page 19, line 7 ¶ | |||
| "notify" actions. See section 10 of Sieve [RFC5228], section 8 of | "notify" actions. See section 10 of Sieve [RFC5228], section 8 of | |||
| Sieve Notify [RFC5435], and the Security Considerations sections of | Sieve Notify [RFC5435], and the Security Considerations sections of | |||
| the applicable notification-method documents for loop-prevention | the applicable notification-method documents for loop-prevention | |||
| information. This extension does not change any of that advice. | information. This extension does not change any of that advice. | |||
| Other security considerations are discussed in IMAP [RFC3501], and | Other security considerations are discussed in IMAP [RFC3501], and | |||
| Sieve [RFC5228], as well as in some of the other extension documents. | Sieve [RFC5228], as well as in some of the other extension documents. | |||
| 7. IANA Considerations | 7. IANA Considerations | |||
| 7.1. Registration of IMAPSIEVE IMAP capability | 7.1. Registration of "imapsieve" IMAP capability | |||
| This document defines a new IMAP capability. IANA is asked to add | This document defines a new IMAP capability. IANA is asked to add | |||
| "IMAPSIEVE" to the IMAP 4 Capabilities registry. | "imapsieve" to the IMAP 4 Capabilities registry. | |||
| 7.2. Registration of imapsieve Sieve extension | 7.2. Registration of imapsieve Sieve extension | |||
| The following template specifies the IANA registration of the Sieve | The following template specifies the IANA registration of the Sieve | |||
| extension specified in this document: | extension specified in this document: | |||
| To: iana@iana.org | To: iana@iana.org | |||
| Subject: Registration of new Sieve extension | Subject: Registration of new Sieve extension | |||
| Capability name: imapsieve | Capability name: imapsieve | |||
| Description: Add Sieve processing for IMAP events. | Description: Add Sieve processing for IMAP events. | |||
| RFC number: this RFC | RFC number: this RFC | |||
| Contact address: Barry Leiba <barryleiba@computer.org> | Contact address: Sieve mailing list <sieve@ietf.org> | |||
| This information should be added to the list of sieve extensions | This information should be added to the list of sieve extensions | |||
| given on http://www.iana.org/assignments/sieve-extensions. | given on http://www.iana.org/assignments/sieve-extensions. | |||
| 7.3. Registration of environment item: cause | 7.3. Registration of environment item: cause | |||
| The following template specifies the IANA registration of a sieve | The following template specifies the IANA registration of a sieve | |||
| environment item specified in this document: | environment item specified in this document: | |||
| To: iana@iana.org | To: iana@iana.org | |||
| skipping to change at page 18, line 46 ¶ | skipping to change at page 19, line 46 ¶ | |||
| invoked. Its value is one of the following: | invoked. Its value is one of the following: | |||
| o APPEND (for invocations resulting from APPEND or MULTIAPPEND) | o APPEND (for invocations resulting from APPEND or MULTIAPPEND) | |||
| o COPY (for invocations resulting from COPY) | o COPY (for invocations resulting from COPY) | |||
| o FLAG (for invocations resulting from flag changes) | o FLAG (for invocations resulting from flag changes) | |||
| RFC number: this RFC | RFC number: this RFC | |||
| Contact address: | Contact address: | |||
| Barry Leiba <barryleiba@computer.org> | Sieve mailing list <sieve@ietf.org> | |||
| This information should be added to the list of sieve environment | This information should be added to the list of sieve environment | |||
| item names given in the Environment extension [RFC5183]. | item names given in the Environment extension [RFC5183]. | |||
| 7.4. Registration of environment item: mailbox | 7.4. Registration of environment item: mailbox | |||
| The following template specifies the IANA registration of a sieve | The following template specifies the IANA registration of a sieve | |||
| environment item specified in this document: | environment item specified in this document: | |||
| To: iana@iana.org | To: iana@iana.org | |||
| Subject: Registration of new Sieve environment item | Subject: Registration of new Sieve environment item | |||
| Item name: mailbox | Item name: mailbox | |||
| Description: The name of the mailbox that the affected message is in, | Description: The name of the mailbox that the affected message is in, | |||
| in the case of existing messages, or is targeted to be stored into, | in the case of existing messages, or is targeted to be stored into, | |||
| in the case of new messages. The value of this item is fixed when | in the case of new messages. The value of this item is fixed when | |||
| the script begins, and, in particular, MUST NOT change as a result of | the script begins, and, in particular, MUST NOT change as a result of | |||
| any action, such as "fileinto". | any action, such as "fileinto". | |||
| RFC number: this RFC | RFC number: this RFC | |||
| Contact address: | Contact address: | |||
| Barry Leiba <barryleiba@computer.org> | Sieve mailing list <sieve@ietf.org> | |||
| This information should be added to the list of sieve environment | This information should be added to the list of sieve environment | |||
| item names given in the Environment extension [RFC5183]. | item names given in the Environment extension [RFC5183]. | |||
| 7.5. Registration of environment item: changedflags | 7.5. Registration of environment item: changedflags | |||
| The following template specifies the IANA registration of a sieve | The following template specifies the IANA registration of a sieve | |||
| environment item specified in this document: | environment item specified in this document: | |||
| To: iana@iana.org | To: iana@iana.org | |||
| Subject: Registration of new Sieve environment item | Subject: Registration of new Sieve environment item | |||
| Item name: changedflags | Item name: changedflags | |||
| Description: If the script was invoked because of flag changes to an | Description: If the script was invoked because of flag changes to an | |||
| existing message, this contains the name(s) of the flag(s) that have | existing message, this contains the name(s) of the flag(s) that have | |||
| changed. Otherwise, the value of this item MUST be the empty string. | changed. Otherwise, the value of this item MUST be the empty string. | |||
| RFC number: this RFC | RFC number: this RFC | |||
| Contact address: | Contact address: | |||
| Barry Leiba <barryleiba@computer.org> | Sieve mailing list <sieve@ietf.org> | |||
| This information should be added to the list of sieve environment | This information should be added to the list of sieve environment | |||
| item names given in the Environment extension [RFC5183]. | item names given in the Environment extension [RFC5183]. | |||
| 7.6. Registration of environment item: imapuser | 7.6. Registration of environment item: imapuser | |||
| The following template specifies the IANA registration of a sieve | The following template specifies the IANA registration of a sieve | |||
| environment item specified in this document: | environment item specified in this document: | |||
| To: iana@iana.org | To: iana@iana.org | |||
| Subject: Registration of new Sieve environment item | Subject: Registration of new Sieve environment item | |||
| Item name: imapuser | Item name: imapuser | |||
| Description: The identity (IMAP login ID) of the IMAP user that | Description: The identity (IMAP login ID) of the IMAP user that | |||
| caused the action. | caused the action. | |||
| RFC number: this RFC | RFC number: this RFC | |||
| Contact address: | Contact address: | |||
| Barry Leiba <barryleiba@computer.org> | Sieve mailing list <sieve@ietf.org> | |||
| This information should be added to the list of sieve environment | This information should be added to the list of sieve environment | |||
| item names given in the Environment extension [RFC5183]. | item names given in the Environment extension [RFC5183]. | |||
| 7.7. Registration of environment item: imapemail | 7.7. Registration of environment item: imapemail | |||
| The following template specifies the IANA registration of a sieve | The following template specifies the IANA registration of a sieve | |||
| environment item specified in this document: | environment item specified in this document: | |||
| To: iana@iana.org | To: iana@iana.org | |||
| Subject: Registration of new Sieve environment item | Subject: Registration of new Sieve environment item | |||
| Item name: imapemail | Item name: imapemail | |||
| Description: The primary email address of the IMAP user that caused | Description: The primary email address of the IMAP user that caused | |||
| the action (the user identified by "imapuser"). | the action (the user identified by "imapuser"). | |||
| RFC number: this RFC | RFC number: this RFC | |||
| Contact address: | Contact address: | |||
| Barry Leiba <barryleiba@computer.org> | Sieve mailing list <sieve@ietf.org> | |||
| This information should be added to the list of sieve environment | This information should be added to the list of sieve environment | |||
| item names given in the Environment extension [RFC5183]. | item names given in the Environment extension [RFC5183]. | |||
| 7.8. Registration of IMAP METADATA mailbox entry name | 7.8. Registration of IMAP METADATA mailbox entry name | |||
| The following template specifies the IANA registration of an IMAP | The following template specifies the IANA registration of an IMAP | |||
| METADATA entry name specified in this document: | METADATA entry name specified in this document: | |||
| To: iana@iana.org | To: iana@iana.org | |||
| Subject: IMAP METADATA Registration | Subject: IMAP METADATA Registration | |||
| Please register the following IMAP METADATA item: | Please register the following IMAP METADATA item: | |||
| [x] Entry [ ] Attribute | [x] Entry [ ] Attribute | |||
| [x] Mailbox [ ] Server | [x] Mailbox [ ] Server | |||
| Name: /IMAPSieve/Script | Name: /IMAPSieve/Script | |||
| Description: This entry name is used to define mailbox metadata | Description: This entry name is used to define mailbox metadata | |||
| associated with IMAPSieve events for the associated mailbox. | associated with IMAP events in Sieve for the associated mailbox. | |||
| Specifically, this specifies the Sieve script that will be invoked | Specifically, this specifies the Sieve script that will be invoked | |||
| when IMAP events occur on the specified mailbox. | when IMAP events occur on the specified mailbox. | |||
| Content-type: text/plain; charset=utf-8 | Content-type: text/plain; charset=utf-8 | |||
| RFC number: this RFC | RFC number: this RFC | |||
| Contact person: Barry Leiba | Contact person: Sieve mailing list | |||
| Contact email: barryleiba@computer.org | Contact email: sieve@ietf.org | |||
| This information should be added to the list of IMAP METADATA item | This information should be added to the list of IMAP METADATA item | |||
| names given in the Metadata extension [RFC5464]. | names given in the Metadata extension [RFC5464]. | |||
| 7.9. Registration of IMAP METADATA server entry name | 7.9. Registration of IMAP METADATA server entry name | |||
| The following template specifies the IANA registration of an IMAP | The following template specifies the IANA registration of an IMAP | |||
| METADATA entry name specified in this document: | METADATA entry name specified in this document: | |||
| To: iana@iana.org | To: iana@iana.org | |||
| Subject: IMAP METADATA Registration | Subject: IMAP METADATA Registration | |||
| Please register the following IMAP METADATA item: | Please register the following IMAP METADATA item: | |||
| [x] Entry [ ] Attribute | [x] Entry [ ] Attribute | |||
| [ ] Mailbox [x] Server | [ ] Mailbox [x] Server | |||
| Name: /IMAPSieve/Script | Name: /IMAPSieve/Script | |||
| Description: This entry name is used to define metadata associated | Description: This entry name is used to define metadata associated | |||
| globally with IMAPSieve events for the associated server. | globally with IMAP events in Sieve for the associated server. | |||
| Specifically, this specifies the Sieve script that will be invoked | Specifically, this specifies the Sieve script that will be invoked | |||
| when IMAP events occur on any mailbox in the server that does not | when IMAP events occur on any mailbox in the server that does not | |||
| have its own mailbox-level /IMAPSieve/Script entry. | have its own mailbox-level /IMAPSieve/Script entry. | |||
| Content-type: text/plain; charset=utf-8 | Content-type: text/plain; charset=utf-8 | |||
| RFC number: this RFC | RFC number: this RFC | |||
| Contact person: Barry Leiba | Contact person: Sieve mailing list | |||
| Contact email: barryleiba@computer.org | Contact email: sieve@ietf.org | |||
| This information should be added to the list of IMAP METADATA item | This information should be added to the list of IMAP METADATA item | |||
| names given in the Metadata extension [RFC5464]. | names given in the Metadata extension [RFC5464]. | |||
| 8. References | 8. References | |||
| 8.1. Normative References | 8.1. Normative References | |||
| [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, March 1997. | Requirement Levels", BCP 14, RFC 2119, March 1997. | |||
| skipping to change at page 22, line 36 ¶ | skipping to change at page 23, line 36 ¶ | |||
| [RFC5228] Guenther, P. and T. Showalter, "Sieve: An Email Filtering | [RFC5228] Guenther, P. and T. Showalter, "Sieve: An Email Filtering | |||
| Language", RFC 5228, January 2008. | Language", RFC 5228, January 2008. | |||
| [RFC5232] Melnikov, A., "Sieve Email Filtering: Imap4flags | [RFC5232] Melnikov, A., "Sieve Email Filtering: Imap4flags | |||
| Extension", RFC 5232, January 2008. | Extension", RFC 5232, January 2008. | |||
| [RFC5464] Daboo, C., "The IMAP METADATA Extension", RFC 5464, | [RFC5464] Daboo, C., "The IMAP METADATA Extension", RFC 5464, | |||
| February 2009. | February 2009. | |||
| 8.2. Non-Normative References | [RFC5804] Melnikov, A. and T. Martin, "A Protocol for Remotely | |||
| Managing Sieve Scripts", RFC 5804, July 2010. | ||||
| [I-D.ietf-sieve-include] | 8.2. Non-Normative References | |||
| Daboo, C. and A. Stone, "Sieve Email Filtering: Include | ||||
| Extension", draft-ietf-sieve-include-06 (work in | ||||
| progress), July 2010. | ||||
| [RFC4315] Crispin, M., "Internet Message Access Protocol (IMAP) - | [RFC4315] Crispin, M., "Internet Message Access Protocol (IMAP) - | |||
| UIDPLUS extension", RFC 4315, December 2005. | UIDPLUS extension", RFC 4315, December 2005. | |||
| [RFC5230] Showalter, T. and N. Freed, "Sieve Email Filtering: | [RFC5230] Showalter, T. and N. Freed, "Sieve Email Filtering: | |||
| Vacation Extension", RFC 5230, January 2008. | Vacation Extension", RFC 5230, January 2008. | |||
| [RFC5235] Daboo, C., "Sieve Email Filtering: Spamtest and Virustest | [RFC5235] Daboo, C., "Sieve Email Filtering: Spamtest and Virustest | |||
| Extensions", RFC 5235, January 2008. | Extensions", RFC 5235, January 2008. | |||
| skipping to change at page 23, line 4 ¶ | skipping to change at page 23, line 51 ¶ | |||
| [RFC4315] Crispin, M., "Internet Message Access Protocol (IMAP) - | [RFC4315] Crispin, M., "Internet Message Access Protocol (IMAP) - | |||
| UIDPLUS extension", RFC 4315, December 2005. | UIDPLUS extension", RFC 4315, December 2005. | |||
| [RFC5230] Showalter, T. and N. Freed, "Sieve Email Filtering: | [RFC5230] Showalter, T. and N. Freed, "Sieve Email Filtering: | |||
| Vacation Extension", RFC 5230, January 2008. | Vacation Extension", RFC 5230, January 2008. | |||
| [RFC5235] Daboo, C., "Sieve Email Filtering: Spamtest and Virustest | [RFC5235] Daboo, C., "Sieve Email Filtering: Spamtest and Virustest | |||
| Extensions", RFC 5235, January 2008. | Extensions", RFC 5235, January 2008. | |||
| [RFC5293] Degener, J. and P. Guenther, "Sieve Email Filtering: | [RFC5293] Degener, J. and P. Guenther, "Sieve Email Filtering: | |||
| Editheader Extension", RFC 5293, August 2008. | Editheader Extension", RFC 5293, August 2008. | |||
| [RFC5429] Stone, A., "Sieve Email Filtering: Reject and Extended | [RFC5429] Stone, A., "Sieve Email Filtering: Reject and Extended | |||
| Reject Extensions", RFC 5429, March 2009. | Reject Extensions", RFC 5429, March 2009. | |||
| [RFC5435] Melnikov, A., Leiba, B., Segmuller, W., and T. Martin, | [RFC5435] Melnikov, A., Leiba, B., Segmuller, W., and T. Martin, | |||
| "Sieve Email Filtering: Extension for Notifications", | "Sieve Email Filtering: Extension for Notifications", | |||
| RFC 5435, January 2009. | RFC 5435, January 2009. | |||
| [RFC5703] Hansen, T. and C. Daboo, "Sieve Email Filtering: MIME Part | [RFC5703] Hansen, T. and C. Daboo, "Sieve Email Filtering: MIME Part | |||
| Tests, Iteration, Extraction, Replacement, and Enclosure", | Tests, Iteration, Extraction, Replacement, and Enclosure", | |||
| RFC 5703, October 2009. | RFC 5703, October 2009. | |||
| [RFC5804] Melnikov, A. and T. Martin, "A Protocol for Remotely | ||||
| Managing Sieve Scripts", RFC 5804, July 2010. | ||||
| Author's Address | Author's Address | |||
| Barry Leiba | Barry Leiba | |||
| Huawei Technologies | Huawei Technologies | |||
| Phone: +1 646 827 0648 | Phone: +1 646 827 0648 | |||
| Email: barryleiba@computer.org | Email: barryleiba@computer.org | |||
| URI: http://internetmessagingtechnology.org/ | URI: http://internetmessagingtechnology.org/ | |||
| End of changes. 69 change blocks. | ||||
| 195 lines changed or deleted | 263 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/ | ||||