<?xml version="1.0" encoding="utf-8"?>
<?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 rfc3501 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3501.xml'>
<!ENTITY rfc4314 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4314.xml'>
<!ENTITY rfc5234 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5234.xml'>
<!ENTITY rfc5258 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5258.xml'>
<!ENTITY rfc5819 PUBLIC ''
'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5819.xml'>
]>

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc strict="yes"?>
<rfc category="std" ipr='trust200902'
     docName='draft-ietf-extra-imap-list-myrights-00'>
  <front>
    <title abbrev="IMAP LIST-MYRIGHTS">IMAP4 Extension for Returning
    MYRIGHTS Information in Extended LIST</title>

    <author initials="K." surname="Murchison" fullname="Kenneth Murchison">
      <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>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 />

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

    <keyword>IMAP4</keyword>
    <keyword>LIST</keyword>
    <keyword>MYRIGHTS</keyword>
    <abstract>
      <t>This document defines an extension to the to IMAP LIST
      command that allows the client to request the set of rights that
      the logged-in user has been granted on mailboxes, along with other
      information typically returned by the LIST command.</t>
    </abstract>

  </front>

  <middle>
    <section title='Introduction'>
      <t>IMAP clients typically fetch the set of rights granted on
      mailboxes so they can expose the allowed functionality to the
      logged-in user.  In order to do that, the client is 
      forced to issue a LIST or LSUB command to list all available
      mailboxes, followed by a MYRIGHTS command for each mailbox
      found.  This document defines an extension to the to IMAP LIST
      command that is identified by the capability string
      "LIST-MYRIGHTS".  The LIST-MYRIGHTS extension allows the client
      to request the set of rights that the logged-in user has been
      granted on mailboxes, along with other information typically
      returned by the LIST command.</t>
    </section>

    <section title='Conventions Used in This Document'>
      <t>In examples, "C:" indicates lines sent by a client that is connected
      to a server.  "S:" indicates lines sent by the server to the
      client.</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 <xref target='RFC2119' />.</t>

    </section>  <!-- Intro -->
    
    <section title='MYRIGHTS Return Option to LIST Command'
             anchor="myrights">
      <t><xref target='RFC4314'/> defines the MYRIGHTS command which is
      used by an IMAP client to determine the set of rights that the
      logged-in user has been granted on a given mailbox.  Frequently,
      a client will have to look up the rights for some or all of
      the mailboxes returned by the LIST command.  Doing so in
      multiple MYRIGHTS commands wastes bandwidth and can degrade
      performance if the client does not pipeline the requests.</t>

      <t>This document extends the LIST command with a new return option,
      "MYRIGHTS", which allows the client to request all of the
      desired information in a single command.  For each listable
      mailbox matching the list pattern and selection options, the
      server MUST return an untagged LIST response followed by an
      untagged MYRIGHTS response containing the set of rights granted
      to the logged-in user.</t>

      <t>If the server is unable to look up the set of rights for a
      given mailbox, it MAY drop the corresponding MYRIGHTS reply.  In
      such a situation, the LIST command would still return a tagged
      OK reply.</t>
    </section>  <!-- MYRIGHTS -->

    <section title='Examples'>

      <figure>
	<preamble>
	  In this example the "bar" mailbox doesn't exist, so it has
          no MYRIGHTS reply.
	</preamble>
        <artwork><![CDATA[
C: A01 LIST "" % RETURN (MYRIGHTS)
S: * LIST () "."  "INBOX"
S: * MYRIGHTS "INBOX" lrswipkxtecdan
S: * LIST () "." "foo"
S: * MYRIGHTS "foo" lrs
S: * LIST (\NonExistent) "." "bar"
S: A01 OK List completed.
]]></artwork>
      </figure>

      <figure>
	<preamble>
	  In this example the LIST reply for the "foo" mailbox is
          returned because it has matching children, but no MYRIGHTS
          reply is returned because "foo" itself doesn't match the
          selection criteria.
	</preamble>
        <artwork><![CDATA[
C: A02 LIST (SUBSCRIBED RECURSIVEMATCH) "" % RETURN (MYRIGHTS)
S: * LIST (\Subscribed) "."  "INBOX"
S: * MYRIGHTS "INBOX" lrswipkxtecdan
S: * LIST () "." "foo" (CHILDINFO ("SUBSCRIBED"))
S: A02 OK List completed.
]]></artwork>
      </figure>

    </section>

    <section title='Formal Syntax'>
      <t>The following syntax specification uses the augmented Backus-Naur
      Form (BNF) as described in <xref target='RFC5234' />.  Terms not
      defined here are taken from <xref target='RFC5258' />. </t>

      <figure><artwork><![CDATA[
return-option =/ "MYRIGHTS"
]]></artwork></figure>
    </section>

    <section title='Security Considerations' anchor='security'>
      <t>This specification does not introduce any additional security
      concerns beyond those described in <xref target="RFC5258" />.</t>
    </section>

    <section title='Privacy Considerations' anchor='privacy'>
      <t>This specification does not introduce any additional privacy
      concerns beyond those described in <xref target="RFC4314" />.</t>
    </section>

    <section title='IANA Considerations'>
      <section title='Registration of IMAP capability LIST-MYRIGHTS'>
        <t>This document defines the "LIST-MYRIGHTS" IMAP capability
        to be added to the registry defined in Section 12 of <xref
        target='RFC3501' />.</t>
      </section>

      <section title="Registration of LIST-EXTENDED option MYRIGHTS">
	<t>This section registers the "MYRIGHTS" option to be added to the
        registry defined in Section 9 of <xref
        target='RFC5258' />.
	<list style='hanging'>
	  <t hangText="LIST-EXTENDED option name:">
	    MYRIGHTS
	  </t>
	  <t hangText="LIST-EXTENDED option type:">
	    RETURN
	  </t>
	  <t hangText="LIST-EXTENDED option description:">
	    Causes the LIST command to return MYRIGHTS responses in
            addition to LIST responses.
	  </t>
	  <t hangText="Published specification:">
	    RFC XXXX, <xref target="myrights" />
	  </t>
	  <t hangText="Security considerations:">
	    RFC XXXX, <xref target="security" />
	  </t>
	  <t hangText="Intended usage:">
	    COMMON
	  </t>
	  <t hangText="Person and email address to contact for further
                       information:">
	    Kenneth Murchison &lt;murch@andrew.cmu.edu&gt;
	  </t>
	  <t hangText="Owner/Change controller:">
	    IESG &lt;iesg@ietf.org&gt;
	  </t>
	</list>
	</t>
      </section>
    </section> <!-- IANA -->

    <section title='Acknowledgments'>
      <t>This document is based largely on <xref target='RFC5819'/>.
      The author would like to thank the authors of that document for
      providing both inspiration and some borrowed text for this
      document.</t>
<!--
      <t>The author would also like to thank the following individuals for
      contributing their ideas and support for writing this
      specification: Cyrus Daboo.</t>
-->
    </section>

  </middle>

  <back>
    <references title='Normative References'>
      &rfc2119;
      &rfc3501;
      &rfc4314;
      &rfc5234;
      &rfc5258;
    </references>

    <references title='Informative References'>
      &rfc5819;
    </references>

    <section title="Change History (To be removed by RFC Editor before
    publication)">
      <t>Changes from draft-murchison-imap-list-myrights-01:
      <list style='symbols'>
        <t>Renamed document to be a work product of the EXTRA WG.</t>

        <t>Updated authors' addresses.</t>
      </list>
      </t>

      <t>Changes from draft-murchison-imap-list-myrights-00:
      <list style='symbols'>
        <t>Augmented Introduction with mention of "LIST-MYRIGHTS"
        capability string.</t>

        <t>Minor editorial changes.</t>
      </list>
      </t>
    </section>

  </back>
</rfc>
