<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2086 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2086.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3501 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3501.xml">
<!ENTITY RFC3503 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3503.xml">
<!ENTITY RFC5234 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5234.xml">
<!ENTITY RFC5226 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
]>

<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<rfc
    category="info"
    ipr="full3978"
    docName="draft-newman-imap-decaf-00.txt">
    <?rfc strict="yes" ?>
    <?rfc comments="no" ?>
    <?rfc inline="no" ?>
    <?rfc editing="no" ?>
    <?rfc toc="yes" ?>
    <?rfc tocompact="yes" ?>
    <?rfc tocdepth="3" ?>
    <?rfc symrefs="yes" ?>
    <?rfc sortrefs="yes" ?>
    <?rfc compact="yes" ?>
    <?rfc subcompact="no" ?>
<front>
    <title abbrev="DECAF for IMAP">Decrypted Content Attachment Flag for
Internet Message Access Protocol (IMAP)</title>

    <author
        fullname="Dan Newman" 
        initials="D." 
        surname="Newman">
        <organization>Sun Microsystems, Inc.</organization>
        <address>
            <postal>
                <street>4150 Network Circle</street>
                <city>Santa Clara</city>
                <region>CA</region>
                <code>95054</code>
                <country>US</country>
            </postal>
	    <email>dan.newman@sun.com</email>
        </address>
    </author>

    <author
        fullname="Ned Freed" 
        initials="N." 
        surname="Freed">
        <organization>Sun Microsystems, Inc.</organization>
        <address>
            <postal>
                <street>800 Royal Oaks Drive</street>
                <city>Monrovia</city>
                <region>CA</region>
                <code>91016</code>
                <country>US</country>
            </postal>
	    <email>ned.freed@sun.com</email>
        </address>
    </author>

    <date year="2008"/>
    <area>Applications</area>
    <workgroup>Internet Engineering Task Force</workgroup>

    <abstract>
        <t>This document promulgates an Internet Message Access
        Protocol (IMAP) flag keyword which Mail User Agents (MUAs)
        may use to indicate that the decrypted content of an encrypted
        message contains one or more attachments.</t>

        <t>This document intentionally leaves undefined the definition of
        an "attachment" and is neutral as regards the message encryption
	system.</t>

	<t>This document also defines an IANA registry for IMAP flag
	keyword conventions.</t>
    </abstract>

</front>

<middle>

    <section title="Conventions Used in this Document">

      <t>The "C:" and "S:" prefixes in examples indicate lines sent,
      respectively, by the client and server.</t>

      <t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;,
      &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
      &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,
      &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be
      interpreted as described in <xref target="RFC2119"/>.</t>

    </section>

    <section title="Introduction and Overview">

      <t>This document defines a new IMAP mailbox flag keyword 
      <xref target="RFC3501"/> that aids Mail User Agents (MUAs) in
      determining if the decrypted content of an encrypted message
      contains attachments.  This document does not define any new
      command or response for IMAP.</t>

      <t>A conforming MUA, which after decrypting all or part of a
      message and finding that the decrypted content contains one or
      more attachments, MAY store $DECAF IMAP flag keyword for the
      message.  Subsequently and without again repeating the
      decryption, conforming MUAs MAY act upon the presence of the
      $DECAF flag keyword; e.g., by indicating that the
      message has an attachment when presenting a list of
      messages.</t>

      <t>The $DECAF flag keyword put forth in this document does not
      indicate that the message itself has attachments.  Rather, it
      indicates that one or more encrypted portions of the message,
      when decrypted, contain attachments.</t>

      <t>This document does not define encrypted content, places no
      requirements on the format or structure of decrypted content,
      and does not define what constitutes an "attachment".  These
      details are left to MUA implementors to determine as suits their
      needs.  That said, MUAs SHOULD use the $DECAF flag keyword for
      message encryption formats in which the structure of the
      encrypted content cannot be determined without first decrypting
      the encrypted content.</t>

    </section>

    <section title="Client behavior">

      <t>A MUA wishing to store $DECAF flag keyword should first
      verify that the IMAP mailbox in question can store the $DECAF
      flag keyword, either temporarily or permanently.  This is done
      by opening the mailbox and examining the FLAGS and
      PERMANENTFLAGS responses for either the $DECAF keyword or an
      indication that arbitrary keywords may be created.</t>

      <t>Note that even if the $DECAF flag keyword cannot be stored
      permanently, MUAs may still derive benefit from storing it
      temporarily.  For example, an MUA which maintains minimal state.
      Indeed, some MUAs may only want to store $DECAF flag keyword
      temporarily thereby avoiding long term disclosure of the implied
      information.</t>

      <section title="Client behavior when receiving a message">

	<t>Upon receiving a message containing encrypted content, the
	MUA MAY store the $DECAF flag keyword for that message if it
	determines that, when decrypted, any of the encrypted content
	contains one or more attachments. The MUA SHOULD NOT clear the
	$DECAF flag keyword: it may have been stored by another MUA.</t>

      </section>

      <section title="Client behavior when copying a message">

	<t>The client SHOULD verify that the $DECAF flag keyword is
	preserved on a COPY operation.  Furthermore, when copying a
	message between servers with the APPEND command, the client
	SHOULD preserve the $DECAF flag keyword on the resulting copy
	of the message.</t>

      </section>

      <section title="Client behavior when sending a message">

	<t>When saving a sent message to any folder, the client MAY
	store the $DECAF flag keyword provided that the saved message
	has one or more encrypted parts which, when decrypted, contain
	one or more attachments.</t>

      </section>

      <section title="Client behavior when saving a temporary message">

	<t>When saving an unfinished message to any folder, the client
	MAY store the $DECAF flag provided that the unfinished message
	has one or more encrypted parts which, when decrypted, contain
	one or more attachments.</t>

      </section>

    </section>

    <section title="Server Behavior">

      <t>Server implementors seeking to support this specification
      MUST insure that their server complies with either <xref
      target="sec_arb"/> or <xref target="sec_decaf"/>.  If the server
      also supports the IMAP ACL extension <xref target="RFC2086"/>,
      it MUST also comply with <xref target="sec_acl"/>.</t>

      <section title="Server that supports the creation of new
		      flag keywords" anchor="sec_arb">

	<t>If a server supports the creation of new flag keywords,
	then no changes are required to the server to make it
	compatible with the extension described in this document.</t>

      </section>

      <section title="Server that supports only the $DECAF
		      flag keyword" anchor="sec_decaf">

	<t>Servers that support only the $DECAF flag keyword SHOULD
	preserve it on the COPY operation.  It is also expected that a
	server that supports SEARCH &lt;flag&gt; will also support
	SEARCH KEYWORD $DECAF.</t>

      </section>

      <section title="Interaction with the IMAP ACL extension"
	       anchor="sec_acl">

	<t>Any server that conforms to either <xref target="sec_arb"/> or
	<xref target="sec_decaf"/> and also supports the IMAP ACL extension
	<xref target="RFC2086"/>, SHOULD preserve the $DECAF flag keyword on COPY
	even if the client does not have the "w" ACL right.  Note that the
	server MUST still check if the client has rights to perform the COPY
	operation on a message according to <xref target="RFC2086"/>.</t>

      </section>

    </section>

    <section title="Examples">
      <t>
      <list style="format (%d)">
	<t>MUA opens mailbox for the first time.
	<list style="format (%c)">
	  <t>The server supports storing of arbitrary keywords
	  <figure>
	    <artwork>
<![CDATA[
C: A01 SELECT INBOX
S: * FLAGS (\Flagged \Draft \Deleted \Seen)
S: * OK [PERMANENTFLAGS (\Flagged \Draft \Deleted \Seen \*)]
S: * 56 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 55]  
S: * OK [UIDVALIDITY 1078037321]  
S: * OK [UIDNEXT 198245]  
S: A01 OK [READ-WRITE] Completed
]]>
	    </artwork>
	  </figure></t>
	  <t>The server supports storing of the $DECAF flag keyword
	  <figure>
	    <artwork>
<![CDATA[
C: A01 SELECT INBOX
S: * FLAGS (\Flagged \Draft \Deleted \Seen $DECAF)
S: * OK [PERMANENTFLAGS (\Flagged \Draft \Deleted \Seen $DECAF)]
S: * 56 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 55]  
S: * OK [UIDVALIDITY 1078037321]  
S: * OK [UIDNEXT 198245]  
S: A01 OK [READ-WRITE] Completed
]]>
	    </artwork>
	  </figure></t>
	</list></t>
	<t>The MUA successfully stores the $DECAF flag keyword
	  <figure>
	    <artwork>
<![CDATA[
C: A02 STORE 4 +FLAGS ($DECAF)
S: * 4 FETCH (FLAGS (\Seen $DECAF))
S: A02 OK Completed
]]>
	    </artwork>
	  </figure></t>
	  <t>The server refuses to store the $DECAF keyword
	  <figure>
	    <artwork>
<![CDATA[
C: A02 STORE 4 +FLAGS ($DECAF)
S: A02 NO STORE failed : Too many keywords in mailbox
]]>
	    </artwork>
	  </figure></t>
      </list></t>

    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">

        <t>Credit is due Alexey Melnikov whose <xref target="RFC3503"/>
	was emulated for this document.</t
>
    </section>

    <section anchor="IANA" title="IANA Considerations">

        <t>This document requests that IANA create and maintain a First Come
	First Served <xref target="RFC5226"/> registry for IMAP flag keywords.</t>

	<t>
	<list style="format (%d)">
	  <t>The name of the registry is "IMAP Flag Keywords".</t>
	  <t>To register an IMAP flag keyword, the flag keyword name, a
	  description of the flag keyword, and an owner or change controller
	  MUST be specified.  Optionally, a reference to a document
	  describing the flag keyword MAY be provided.</t>
	  <t>The review process for the registry is First Come First Served
	  as per <xref target="RFC5226"/>.</t>
	  <t>The name of each registered flag keyword MUST begin with the
	  character "$" and MUST satisfy the IMAP flag-keyword syntax
	  <xref target="RFC3501"/>.</t>
	  <t>The initial assignments for the registry are as follows:
	  <figure>
	    <artwork>
1. Name: $MDNSent
   Description: Indicator that no MDN needs to be sent for the message.
   Owner/Change Controller: Alexey Melnikov &lt;Alexey.Melnikov@isode.com&gt;
   Reference: RFC 3503

2. Name: $Forwarded
   Description: Indicator that the message has been resent
                to another email address, embedded within or
                attached to a new message.
   Owner/Change Controller: Stephen H. Maes &lt;stephane.maes@oracle.com&gt;
                            Alexey Melnikov &lt;Alexey.Melnikov@isode.com&gt;
   Reference: RFC 4550

3. Name: $DECAF
   Description: Indicator that an encrypted message contains
                attachments within its encrypted content.
   Owner/Change Controller: Ned Freed &lt;ned.freed@sun.com&gt;
                            Dan Newman &lt;dan.newman@sun.com&gt;
   Reference: &rfc.number;
            </artwork>
	  </figure></t>
	</list></t>
    </section>

    <section anchor="Security" title="Security Considerations">

        <t>Use of the $DECAF flag exposes information about the
        content of an encrypted message.  Namely, when the $DECAF flag
        is stored, knowledge that the encrypted message contains one or
        more attachments becomes known to anyone with access to the
        mailbox regardless of whether or not they can decrypt the
        message itself.  When the $DECAF flag is not stored, somewhat
        less information is revealed: it may not be stored because no
        conforming MUA has yet received and decrypted the message, or
        it may not be stored because the message indeed contains no
        attachments within its encrypted content.</t>

    </section>

    <section anchor="Syntax" title="Formal Syntax">

      <t>The following syntax specification uses the augmented
      Backus-Naur Form (BNF) notation as specified in <xref
      target="RFC5234"/>.  Non-terminals referenced, but not defined
      below, are as defined by <xref target="RFC3501"/>.</t>

      <t>Except as noted otherwise, all alphabetic characters are case
      insensitive.  The use of upper or lower case characters to
      define token strings is for editorial clarity only.  Implementations
      MUST accept these strings in a case insensitive fashion.
      <figure>
	<artwork>
<![CDATA[
flag-keyword   = "$DECAF" / other_keywords

other-keywords = atom
]]>
	</artwork>
      </figure></t>
    </section>

</middle>

<back>
    <references title="Normative References">
	&RFC2086;
	&RFC2119;
	&RFC3501;
	&RFC5234;
	&RFC5226;
    </references>
    <references title="Informative References">
	&RFC3503;
    </references>

</back>

</rfc>
