<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'
[
<!ENTITY rfc2119 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY rfc2045 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2045.xml'>
<!ENTITY rfc2046 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2046.xml'>
<!ENTITY rfc2047 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2047.xml'>
<!ENTITY rfc2231 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2231.xml'>
<!ENTITY rfc5228 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5228.xml'>
<!ENTITY rfc5230 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5230.xml'>
<!ENTITY rfc5232 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5232.xml'>
<!ENTITY rfc5234 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5234.xml'>
<!ENTITY rfc5321 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5321.xml'>
<!ENTITY rfc5322 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5322.xml'>
<!ENTITY rfc5429 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5429.xml'>
<!ENTITY rfc5435 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5435.xml'>
<!ENTITY rfc5436 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5436.xml'>
<!ENTITY rfc5437 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5437.xml'>
<!ENTITY rfc5490 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5490.xml'>
<!ENTITY rfc6131 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6131.xml'>
<!ENTITY rfc8174 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml'>
]>

<?rfc toc="yes"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc strict="yes"?>
<rfc number="8580" category="std" consensus="yes" submissionType="IETF"
     ipr='trust200902' updates="5230, 5435">
  <front>
    <title abbrev="Sieve Extension: FCC">Sieve Extension: File Carbon Copy
    (FCC)</title>
    <author initials="K." surname="Murchison" fullname="Kenneth Murchison">
      <organization abbrev="FastMail">FastMail US LLC</organization>
      <address>
        <postal>
          <street>1429 Walnut Street, Suite 1201</street>
          <city>Philadelphia</city> <region>PA</region>
          <code>19102</code> <country>United States of America</country>
        </postal>
        <email>murch@fastmailteam.com</email>
      </address>
    </author>

    <author initials="B." surname="Gondwana" fullname="Bron Gondwana">
      <organization abbrev="FastMail">FastMail Pty Ltd</organization>
      <address>
        <postal>
          <street>Level 2, 114 William Street</street>
          <city>Melbourne</city> <region>VIC</region>
          <code>3000</code> <country>Australia</country>
        </postal>
        <email>brong@fastmailteam.com</email>
      </address>
    </author>

    <date month="April" year="2019" />

    <area>ART</area>
    <workgroup>EXTRA</workgroup>

    <keyword>Sieve, Vacation, Notify</keyword>
    <abstract>
      <t>The Sieve email filtering language provides a number of
      action commands, some of which can generate additional messages
      on behalf of the user.  This document defines an extension to
      such commands to allow a copy of any generated message to be
      filed into a target mailbox.</t>

      <t>This document updates RFCs 5230 and 5435 by adding a new
      tagged argument to the Vacation and Notify actions,
      respectively.</t>
    </abstract>
  </front>

  <middle>
    <section title='Introduction'>
      <t>The <xref target='RFC5228'>Sieve email filtering
      language</xref> provides a number of action commands, some of
      which can generate additional messages on behalf of the user.
      It is sometimes desirable for a Sieve user to maintain an
      archive of the messages generated by these commands.</t>

      <t>This extension defines ":fcc", a new optional tagged argument
      for action commands that generate additional messages.
      This argument allows a copy of the generated message to be filed
      into a target mailbox.</t>

      <t>The capability string associated with this extension is
      "fcc".</t>


      <t>Each new action that generates additional messages will need to
      specify how it interacts with the FCC extension. This document
      specifies the interaction of the FCC extension with the
      <xref target='RFC5230'>Vacation</xref> and
      <xref target='RFC5435'>Notify</xref> actions.</t> 

    </section>

    <section title='Conventions Used in This Document'>

      <t>Conventions for notations are as described in Section 1.1 of <xref
      target='RFC5228'/>, including use of the "Usage:" label for the
      definition of the action and the syntax of tagged arguments.</t>
        <t>
    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&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
    </section> 
    
    <section title='Tagged Argument ":fcc"' anchor='fcc'>

      <t>This document specifies ":fcc", a new optional tagged argument
      that alters the behavior of action commands that generate
      additional messages on behalf of the user.</t>

      <figure>
        <artwork><![CDATA[
Usage: :fcc <mailbox: string>
]]></artwork>
      </figure>

      <t>The ":fcc" tagged argument instructs the Sieve interpreter to
      file a copy of the generated message into the mailbox provided
      in the subsequent argument.
      The semantics and treatment of the mailbox argument are defined
      to match
      those of the mailbox argument to the fileinto action specified
      in Section 4.1 of <xref target='RFC5228' />.
      Specifically, use of an invalid mailbox name MAY be treated as
      an error or result in delivery to an implementation-defined
      mailbox, and if the specified mailbox doesn't exist, the
      implementation MAY treat it as an error, create the mailbox, or
      file the message into an implementation-defined mailbox.</t>

      <section title='Interaction with Extensions to the Fileinto Action'
               anchor='fileinto'>

        <t>Some tagged arguments defined in extensions to the
        fileinto action can be used together with the ":fcc" tagged argument.
        The sections below describe these interactions.
        Tagged arguments in future extensions to the fileinto action 
        need to describe their interaction with the FCC extension, if any.</t>

        <t>When any fileinto extension arguments are used with
        the FCC 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.</t>


        <section title='Imap4flags Extension' anchor='imap4flags'>

          <t>This document extends the definition of the ":flags"
          tagged argument (see Section 5 of <xref target='RFC5232'/>)
          so that it can optionally be used with the ":fcc" tagged
	  argument.</t>

          <figure>
            <artwork><![CDATA[
Usage: :fcc <mailbox: string> [:flags <list-of-flags: string-list>]
]]></artwork>
          </figure>

          <t>If the optional ":flags" tagged argument is specified with
          the ":fcc" tagged argument, it instructs the Sieve interpreter to
	  set the IMAP4
          flags provided in the subsequent argument when the generated
          message is filed into the target mailbox.</t> 

        </section> 

        <section title='Mailbox Extension' anchor='mailbox'>

          <t>This document extends the definition of the ":create"
          tagged argument (see Section 3.2 of <xref target='RFC5490' />) 
          so that it can optionally be used with the ":fcc" tagged
	  argument.</t>

          <figure>
            <artwork><![CDATA[
Usage: :fcc <mailbox: string> [:create]
]]></artwork>
          </figure>

          <t>If the optional ":create" tagged argument is specified with
          the ":fcc" tagged argument, it instructs the Sieve interpreter to
	  create the
          target mailbox, if needed, before attempting to file the
          generated message into the target mailbox.</t>

        </section> 

        <section title='Special-Use Extension' anchor='specialuse'>

          <t>This document extends the definition of the ":specialuse"
          tagged argument (see Section 4 of
          <xref target='RFC8579' />)
          so that it can optionally be used with the ":fcc" tagged
	  argument.</t>

         <figure>
          <artwork><![CDATA[
Usage: :fcc <mailbox: string> [:specialuse <special-use-flag: string>]
]]></artwork>
         </figure>

          <t>If the optional ":specialuse" tagged argument is specified with
          the ":fcc" tagged argument, 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 generated message is filed
          into the special-use mailbox.  Otherwise, the generated message
          is filed into the target mailbox.</t>

          <t>If the optional ":specialuse" and ":create" tagged
          arguments are both specified with the ":fcc" tagged argument, the
	  Sieve interpreter
          is instructed to create the target mailbox per Section 4.1
          of <xref target='RFC8579'/>, if
          needed.</t>

        </section> 

      </section> 




      <section title='Collected Grammar' anchor='grammar'>
        <t>For convenience, the "FCC" syntax element is
        defined here using <xref target='RFC5234'>ABNF</xref>
        so that it can be augmented by other extensions.</t>

        <t>Note that the following is the grammar of "FCC" after it has
        been lexically interpreted.  No whitespace or comments appear
        below.</t>

          <figure>
          <artwork><![CDATA[
FCC         = ":fcc" string *FCC-OPTS
                ; per Section 2.6.2 of RFC 5228,
                ; the tagged arguments in FCC may appear in any order

FCC-OPTS    = CREATE / IMAP-FLAGS / SPECIAL-USE
                ; each option MUST NOT appear more than once

CREATE      = ":create"
IMAP-FLAGS  = ":flags" string-list
SPECIAL-USE = ":specialuse" string
]]></artwork>
          </figure>

      </section> 

    </section> 

    <section title='Format of FCC Messages'
             anchor='format'>

      <t>Copies of messages filed into a mailbox via this extension
      are REQUIRED to be in the <xref target="RFC5322">Internet Message
      Format</xref>.  Some messages generated by Sieve actions might
      already conform to this format and MAY be filed without
      modification.  

Messages generated in other formats MUST be
      encapsulated using constructs from the Internet Message Format <xref
      target="RFC5322"/>
      and MIME (<xref target="RFC2045"/>, <xref target="RFC2046"/>,
      <xref target="RFC2047"/>, <xref target="RFC2231"/>).</t>

      <t>The general requirements for encapsulating the copies of
      messages to be filed are as follows:

      <list style='symbols'>
        <t>Date: The Date header field is REQUIRED and SHOULD
        be set to the date and time when the message was
        generated.</t>

        <t>From: The From header field is REQUIRED and SHOULD
        be set to the email address of the owner of the Sieve
        script, unless explicitly overridden by rules for
        encapsulating a particular message type.

        <list style='empty'>
          <t>Per Erratum ID 2035 <xref target="Err2035"/>,</t>
          <t>"Informative advice: Users often have multiple email
          addresses, and "the email address of the owner of the Sieve
          script" may offer a choice among several.
          If the sieve processor recognizes an address belonging to
          the owner of the Sieve script in the To or Cc fields
          of the input message, then it's better to use that address
          for the From field of the generated message, rather
          than any other addresses the script's owner may also
          have".</t>
        </list>
        </t>

        <t>To: The To header field is OPTIONAL and MAY be set
        to the email address of the recipient of the generated
        message, if available.</t>

        <t>Subject: The Subject header field is OPTIONAL and
        MAY be generated by setting the subject to the
        characters "Fcc: " followed by the subject of the message
        being processed by the Sieve interpreter.</t>

        <t>In-Reply-To: The In-Reply-To header field is OPTIONAL
        and MAY be set to the Message-ID of the message being
        processed by the Sieve interpreter.</t>

        <t>Message Body: The body of the filed message is REQUIRED
        and is composed of one or more MIME parts containing
        the generated message and any related metadata.  The
        Content-Type header field(s) MUST be set to the
        appropriate MIME types.  If any of the MIME parts include
        8-bit or binary data, the Content-Transfer-Encoding header
        field(s) MUST be set accordingly.</t>
      </list>
      </t>

    </section>

    <section title='Interaction with the Vacation Action'
             anchor='vacation'>

      <t>This document extends the
      <xref target="RFC5230">Vacation</xref> action (see also
      <xref target="RFC6131">"Seconds" parameter</xref> to
      optionally store a copy of the auto-reply messages into a
      target mailbox.</t>

      <figure>
        <artwork><![CDATA[
Usage:   vacation [FCC]
                  [":days" number | ":seconds" number]
                  [":subject" string]
                  [":from" string]
                  [":addresses" string-list]
                  [":mime"]
                  [":handle" string]
                  <reason: string>
]]></artwork>
      </figure>

      <figure>
        <preamble>Example (using fileinto extensions):</preamble>
        <artwork><![CDATA[
require ["vacation", "fcc", "mailbox", "special-use", "imap4flags"];

vacation :days 7
         :from "hemingway@example.com" "Gone Fishin'"
         :specialuse "\\Sent" :create
         :fcc "INBOX.Sent" :flags ["\\Seen"];
                           
]]></artwork>
      </figure>

      <t>Vacation auto-reply messages are compliant with MIME and can be
      filed into the target mailbox without modification.</t>

    </section> 

    <section title='Interaction with the Notify Action'
             anchor='notify'>

      <t>This document extends the
      <xref target="RFC5435">Notify</xref> action to optionally
      store a copy of the notification messages into a target
      mailbox.</t>

      <figure>
        <artwork><![CDATA[
Usage:   notify [FCC]
                [":from" string]
                [":importance" <"1" / "2" / "3">]
                [":options" string-list]
                [":message" string]
                <method: string>
]]></artwork>
      </figure>

      <figure>
        <preamble>Example:</preamble>
        <artwork><![CDATA[
require ["enotify", "fcc"];

notify :fcc "INBOX.Sent"
       :message "You got mail!"
       "mailto:ken@example.com";
]]></artwork>
      </figure>

      <t>Messages generated using the
      <xref target='RFC5436'>"mailto"</xref> notification method are
      compliant with MIME and can be filed into the target mailbox without
      modification.</t>

      <t>Messages generated by other notification methods (e.g., "xmpp"
      <xref target="RFC5437"></xref>) MUST be encapsulated per
      <xref target="format"/> before being filed.  The body of the
      filed message MUST include the ":message" tagged argument and MAY
      include one or more of the ":from", ":importance", or ":options" tagged
      arguments.  The MIME type(s) of the body part(s) used to
      encapsulate the parameters is an implementation decision.</t>

      <t>An implementation MAY only support the FCC extension in conjunction
      with a
      subset of the notification methods it supports.  An error occurs
      if the FCC extension is used with a notification method that doesn't
      support it.  Notification methods that support the FCC extension can be
      discovered at runtime using the mechanism described in <xref
      target='method-capa'></xref>.</t>

      <section title='Notification-Capability "fcc"'
               anchor='method-capa'>
        <t>This document defines "fcc", a new notification-capability value
        for use with the notify_method_capability test (see
        Section 5 of <xref target='RFC5435'/>.  For the "fcc"
        notification-capability, the notify_method_capability test can
        match one of the following key-list values:

          <list style='hanging'>
            <t hangText="yes"><vspace />A copy of the notification message
	    sent
            using the method identified by the notification-uri can be
            filed into a target mailbox.</t>

            <t hangText="no"><vspace />A copy of the notification message sent
            using the method identified by the notification-uri cannot be
	        filed into a target mailbox.</t>
          </list>

          Note that the "fcc" notify_method_capability test does not
          require the notification-uri argument to specify anything
          other than a scheme.

          <figure>
            <preamble>Example:</preamble>
            <artwork><![CDATA[
require ["enotify", "fcc"];

if notify_method_capability "xmpp:" "fcc" "yes" {
    notify :fcc "INBOX.Sent"
           :message "You got mail"
           "xmpp:ken@example.com?message;subject=SIEVE";
} else {
    notify :fcc "INBOX.Sent"
           :message "You got mail!"
           "mailto:ken@example.com";
}
]]></artwork>
          </figure>
        </t>
      </section>  

    </section> 

    <section title='Compatibility with the Reject and Extended Reject
                    Actions' anchor='reject'>

      <t>Implementations MUST NOT allow use of the FCC extension with the 
      <xref target='RFC5429'>reject and ereject</xref> actions.
      Allowing use of the FCC extension with these actions would violate the
      <xref
      target='RFC5321'>SMTP</xref> principle that a message is
      either delivered or bounced back to the sender.  Namely, the
      saved copy of the rejection message will contain the original
      message.</t>

      <t>It is an error for a script to use the ":fcc" tagged argument with
      either of the reject or ereject actions.</t> 

    </section>

    <section title='Compatibility with Other Actions'
             anchor='other'>

      <t>The FCC extension is not compatible with any Sieve action
      that does not generate an additional message on behalf of the
      user.
      It is an error for a script to use the ":fcc" tagged argument with any
      such action.</t> 

      <t>Future extensions that define actions that generate
      additional messages on behalf of the user need to describe
      their compatibility with the FCC extension and describe how to
      MIME-encapsulate
      the message, if required.</t>

    </section> 


    <section title='Security Considerations' anchor='security'>
      <t>In addition to the security considerations in
      <xref target='RFC5228'/>, <xref target='RFC5230'/>,
      <xref target='RFC5435'/>, and <xref target='RFC6131'/>,
      it should be noted that filing copies of generated messages may
      cause the Sieve script owner to exceed the allocated storage
      (quota) on the mail system, thereby preventing delivery of
      future messages destined for the owner.</t>
    </section>

    <section title='Privacy Considerations' anchor='privacy'>
      <t>In addition to the privacy considerations in
      <xref target='RFC5228'/>, <xref target='RFC5230'/>,
      <xref target='RFC5435'/>, and <xref target='RFC6131'/>,
      it should be noted that a copy of a generated message filed into
      a shared or public mailbox (as opposed to a private mailbox)
      could expose private information about the Sieve script owner to
      third parties.  For instance, users that have access to the
      shared/public mailbox might discover that the Sieve script owner
      is on holiday or might discover the owner's physical location.</t>
    </section>

    <section title='IANA Considerations'>

      <section title="Registration of New Sieve Extension">

	<t>IANA has registered the following Sieve extension in the "Sieve
	Extensions"
	registry at &lt;https://www.iana.org/assignments/sieve-extensions&gt;:
	  <list style='empty'>
	        <t>Capability name: fcc</t>
		    <t>Description: Adds the ":fcc" parameter to Sieve action
            commands that generate additional messages.</t>
	        <t>RFC number: RFC 8580</t>
		    <t>Contact address: The Sieve discussion list
            &lt;sieve@ietf.org&gt;</t>
	  </list>
	</t>
      </section>

      <section title="Registration of New Notification-Capability
                      Parameter">
        <t>IANA has registered the following notification-capability parameter
	in the
	"Notification-Capability Parameters" registry at
	&lt;https://www.iana.org/assignments/notification-capability-parameters&gt;:
          <list style='empty'>

            <t>Capability Name: fcc</t>
            <t>Description: Returns whether a copy of the notification
            message sent using the method identified by the
            notification-uri parameter to the notify_method_capability
            test can be filed into a target mailbox.</t>
            <t>Syntax:  Can contain one of two values: "yes" or "no".
            Values MUST be in lowercase.</t>
            <t>Reference:  RFC 8580</t>
            <t>Contact:  The Sieve discussion list
            &lt;sieve@ietf.org&gt;</t>
          </list>
        </t>
      </section>

    </section> 

  </middle>

  <back>
    <references title='Normative References'>
      &rfc2119;
      &rfc2045;
      &rfc2046;
      &rfc2047;
      &rfc2231;
      &rfc5228;
      &rfc5230;
      &rfc5232;
      &rfc5234;
      &rfc5322;
      &rfc5429;
      &rfc5435;
      &rfc5490;
      &rfc8174;

<!-- draft-ietf-extra-sieve-special-use-05 -->
<reference anchor="RFC8579" target="https://www.rfc-editor.org/info/rfc8579">
<front>
<title>Sieve Email Filtering: Delivering to Special-Use Mailboxes</title>
<author initials='S' surname='Bosch' fullname='Stephan Bosch'>
  <organization/>
</author>
<date month='April' year='2019'/>
</front>
<seriesInfo name="RFC" value="8579"/>
<seriesInfo name="DOI" value="10.17487/RFC8579"/>
</reference>


    </references>

    <references title='Informative References'>
      &rfc5321;
      &rfc5436;
      &rfc5437;
      &rfc6131;


<reference anchor="Err2035" quote-title="false" target="https://www.rfc-editor.org/errata_search.php?eid=2035">
<front>
<title>Errata ID 2035</title>
<author>
  <organization>RFC Errata</organization>
</author>
<date/>
</front>
<seriesInfo name="RFC" value="5230"/>
</reference>







    </references>


    <section title='Acknowledgments' numbered="no">
      <t>The authors would like to thank the following individuals for
      contributing their ideas and supporting this specification: Ned
      Freed, Stan Kalisch, and Alexey Melnikov.</t> 
    </section>

  </back>
</rfc>
