<?xml version="1.0"?>
<?rfc toc="yes"?><?rfc compact="yes"?><?rfc strict="yes"?><?rfc symrefs="yes"?><?rfc sortrefs="yes"?><rfc ipr="full3978" docName="draft-cridland-urlfetch-binary-00">

<front>
  <title abbrev="URLFETCH BINARY">Extended URLFETCH for binary and converted parts</title>
  <author initials="D.A." surname="Cridland" fullname="Dave Cridland">
<organization>Isode Limited</organization>
<address>
	<postal>
		<street>5 Castle Business Village</street>
		<street>36, Station Road</street>
		<city>Hampton</city>
		<region>Middlesex</region>
		<code>TW12 2BX</code>
		<country>GB</country>
	</postal>
	<email>dave.cridland@isode.com</email>
</address>
</author>
  <date day="12" month="November" year="2007"/>
  <area>Applications</area>
  <abstract>
    <t>The URLFETCH command defined as part of URLAUTH provides a mechanism for third-parties to gain access to data held within messages in a user's private store, however, this data is sent verbatim, which is not suitable for a number of applications. This memo specifies a method for obtaining data in forms suitable for non-mail applications.</t>
  </abstract>
</front>

<middle>
  <section title="Conventions used in this document">
    <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in <xref target="KEYWORDS"/>.</t>
    <t>Protocol examples are line-wrapped for clarity. Protocol strings are prefixed with C: and S: for client and server respectively, and elided data is represented by [...]. Implementors should note these notations are for editorial clarity only.</t>
  </section>

  <section title="Introduction">
    <t>Although <xref target="URLAUTH"/> provides a URLFETCH command which can be used to dereference a URL and return the body part data, it does so by returning the encoded form, without sufficient data to decode. This is suitable for use in mail applications such as <xref target="BURL"/>, where the encoded form is suitable, but not where access to the actual content is required, such as <xref target="STREAMING"/>.</t>
    <t>This memo specifies a mechanism which returns additional metadata about the part, such as its media type, as well as removing any content transfer encoding used on the body part.</t>
  </section>
  <section title="Extended URLFETCH">
      <t>This extension is available in any IMAP server implementation which includes URLAUTH=BINARY within its capability string.</t>
      <t>Such servers accept additional, per-URL, parameters to the URLFETCH command, and will provide, upon request, additional data for each URL dereferenced.</t>
    <section title="Command Parameters">
    <t>The URLFETCH command is extended by the provision of optional parameters. The extended URLFETCH command is distinct by enclosing each URL and associated parameters in a parenthesized list. The absence of any parameters, or if the URL is sent unenclosed, causes the command to behave precisely as specified in <xref target="URLAUTH"/>.</t>
    <t>Available parameters are:
    <list style="hanging">
    <t hangText="BODYPARTSTRUCTURE"><vspace/>Provides a BODYPARTSTRUCTURE in additional to the data itself. BODYPARTSTRUCTURE is defined in <xref target="CONVERT"/>.<vspace blankLines="1"/></t>
    <t hangText="BINARY"><vspace/>Remove any Content-Transfer-Encoding. In particular, this means that the data MAY contain NUL octets, and not be formed from textual lines. Data containing NUL octets MUST be transferred using the literal8 syntax defined in <xref target="BINARY"/>.<vspace blankLines="1"/></t>
    </list>
    </t>
    </section>
    <section title="Response Metadata">
    <t>In order to carry any requested metadata and provide additional information to the consumer, the URLFETCH response is similarly extended.</t>
    <t>Following the URL itself, servers will include a series of parenthesized metadata elements. Defined metadata elements are as follows:
    <list style="hanging">
    <t hangText="BODYPARTSTRUCTURE"><vspace/>The BODYPARTSTRUCTURE provides information about the data contained in the response, as it has been returned. It will reflect any conversions or decoding that have taken place.<vspace blankLines="1"/></t>
    </list></t>
    <t>Note that unlike <xref target="CONVERT"/>, BODYPARTSTRUCTURE is not appended with the part specifier, as this is implicit in the URL.</t>
    </section>
  </section>
  <section title="Formal Syntax">
    <figure>
    <preamble>This formal syntax uses ABNF as specified in <xref target="ABNF"/>, and includes productions defined in <xref target="URLAUTH"/> and <xref target="IMAP"/>.</preamble>
    <artwork type="abnf">
capability       =/ "URLAUTH=BINARY"

   ; Command parameters; see Section 3.1

urlfetch         =  "URLFETCH" 1*(SP url-fetch-arg)

url-fetch-arg    =  url-fetch-simple / url-fetch-ext

url-fetch-simple =  url-full
   ; Unextended URLFETCH.

url-fetch-ext    =  "(" url-full *(SP url-fetch-param) ")"
   ; If no url-fetch-param present, as unextended.

url-fetch-param  =  "BINARY" / "BODYPARTSTRUCTURE" / atom
   ; TODO: Should this be iana-token?

   ; Response; see Section 3.2

urlfetch-data    =  "*" SP "URLFETCH" 1*(SP url-full [url-metadata]
                    SP (nstring / literal8))
   ; MUST use nstring and MUST NOT use SP url-metadata when client
   ; issues url-fetch-simple or no url-fetch-param.

url-metadata     =  1*(SP "(" url-metadata-el ")")

url-metadata-el  =  "BODYPARTSTRUCTURE" SP body

    </artwork>
   </figure>
  </section>
  <section title="Open Issues">
  </section>
  <section title="IANA Considerations">
  <t>This document has no actions for IANA.</t>
  </section>
  <section title="Security Considerations">
  </section>
  <section title="Acknowledgements">
  <t>Comments were received on the idea, and/or this draft, from Neil Cook, Philip Guenther, and others. Whether in agreement or dissent, the comments have refined and otherwise influenced the document.</t>
  </section>
</middle>
<back>
  <references title="Normative References">
    <reference anchor="KEYWORDS">

<front>
<title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials="S." surname="Bradner" fullname="Scott Bradner">
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>sob@harvard.edu</email></address></author>
<date year="1997" month="March"/>
<area>General</area>
<keyword>keyword</keyword>
<abstract>
<t>
   In many standards track documents several words are used to signify
   the requirements in the specification.  These words are often
   capitalized.  This document defines these words as they should be
   interpreted in IETF documents.  Authors who follow these guidelines
   should incorporate this phrase near the beginning of their document:

<list>
<t>
      The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
      NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
      "OPTIONAL" in this document are to be interpreted as described in
      RFC 2119.
</t></list></t>
<t>
   Note that the force of these words is modified by the requirement
   level of the document in which they are used.
</t></abstract></front>

<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
<format type="TXT" octets="4723" target="ftp://ftp.isi.edu/in-notes/rfc2119.txt"/>
<format type="HTML" octets="17491" target="http://xml.resource.org/public/rfc/html/rfc2119.html"/>
<format type="XML" octets="5777" target="http://xml.resource.org/public/rfc/xml/rfc2119.xml"/>
</reference>
    <reference anchor="IMAP">

<front>
<title>INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1</title>
<author initials="M." surname="Crispin" fullname="M. Crispin">
<organization/></author>
<date year="2003" month="March"/>
<abstract>
<t>The Internet Message Access Protocol, Version 4rev1 (IMAP4rev1) allows a client to access and manipulate electronic mail messages on a server.  IMAP4rev1 permits manipulation of mailboxes (remote message folders) in a way that is functionally equivalent to local folders.  IMAP4rev1 also provides the capability for an offline client to resynchronize with the server.  IMAP4rev1 includes operations for creating, deleting, and renaming mailboxes, checking for new messages, permanently removing messages, setting and clearing flags, RFC 2822 and RFC 2045 parsing, searching, and selective fetching of message attributes, texts, and portions thereof.  Messages in IMAP4rev1 are accessed by the use of numbers.  These numbers are either message sequence numbers or unique identifiers.  IMAP4rev1 supports a single server.  A mechanism for accessing configuration information to support multiple IMAP4rev1 servers is discussed in RFC 2244.  IMAP4rev1 does not specify a means of posting mail; this function is handled by a mail transfer protocol such as RFC 2821. [STANDARDS TRACK]</t></abstract></front>

<seriesInfo name="RFC" value="3501"/>
<format type="TXT" octets="227640" target="ftp://ftp.isi.edu/in-notes/rfc3501.txt"/>
</reference>
    <reference anchor="CONVERT">
<front>
<title>IMAP CONVERT extension</title>

<author initials="A" surname="Melnikov" fullname="Alexey Melnikov">
    <organization/>
</author>

<author initials="P" surname="Coates" fullname="Peter Coates">
    <organization/>
</author>

<date month="October" day="8" year="2007"/>

<abstract><t>CONVERT defines extensions to IMAP allowing clients to request adaptation and/or transcoding of attachments. Clients can specify the conversion details or allow servers to decide based on knowledge of client capabilities, on user or administrator preferences or its settings. This document also extends IMAP URL schema defined in draft-ietf-lemonade-rfc2192bis-XX.txt with a specifier for a converted body part.</t></abstract>

</front>

<seriesInfo name="Internet-Draft" value="draft-ietf-lemonade-convert-12"/>
<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-lemonade-convert-12.txt"/>
</reference>
    <reference anchor="URLAUTH">

<front>
<title>Internet Message Access Protocol (IMAP) - URLAUTH Extension</title>
<author initials="M." surname="Crispin" fullname="M. Crispin">
<organization/></author>
<date year="2006" month="May"/>
<abstract>
<t>This document describes the URLAUTH extension to the Internet Message Access Protocol (IMAP) (RFC 3501) and the IMAP URL Scheme (IMAPURL) (RFC 2192). This extension provides a means by which an IMAP client can use URLs carrying authorization to access limited message data on the IMAP server.&lt;/t&gt;&lt;t&gt; An IMAP server that supports this extension indicates this with a capability name of "URLAUTH". [STANDARDS TRACK]</t></abstract></front>

<seriesInfo name="RFC" value="4467"/>
<format type="TXT" octets="36714" target="ftp://ftp.isi.edu/in-notes/rfc4467.txt"/>
</reference>
    <reference anchor="BINARY">

<front>
<title>IMAP4 Binary Content Extension</title>
<author initials="L." surname="Nerenberg" fullname="L. Nerenberg">
<organization/></author>
<date year="2003" month="April"/>
<abstract>
<t>This memo defines the Binary extension to the Internet Message Access Protocol (IMAP4).  It provides a mechanism for IMAP4 clients and servers to exchange message body data without using a MIME content-transfer- encoding. [STANDARDS TRACK]</t></abstract></front>

<seriesInfo name="RFC" value="3516"/>
<format type="TXT" octets="14598" target="ftp://ftp.isi.edu/in-notes/rfc3516.txt"/>
</reference>
    <reference anchor="ABNF">

<front>
<title abbrev="ABNF">Augmented BNF for Syntax Specifications: ABNF</title>
<author fullname="Dave Crocker" initials="D." role="editor" surname="Crocker">
<organization>Brandenburg InternetWorking</organization>
<address>
<postal>
<street>675 Spruce Dr.</street>
<city>Sunnyvale</city>
<region>CA</region>
<code>94086</code>
<country>US</country></postal>
<phone>+1.408.246.8253</phone>
<email>dcrocker@bbiw.net</email></address></author>
<author fullname="Paul Overell" initials="P." surname="Overell">
<organization>THUS plc.</organization>
<address>
<postal>
<street>1/2 Berkeley Square, </street>
<street>99 Berkeley Street</street>
<city>Glasgow</city>
<code>G3 7HR</code>
<country>UK</country></postal>
<email>paul.overell@thus.net</email></address></author>
<date year="2005" month="October"/>
<keyword>ABNF</keyword>
<keyword>Augmented</keyword>
<keyword>Backus-Naur</keyword>
<keyword>Form</keyword>
<keyword>electronic</keyword>
<keyword>mail</keyword>
<abstract>
<t>Internet technical specifications often need to define a formal	
			syntax.  Over the years, a modified version of Backus-Naur Form	
			(BNF), called Augmented BNF (ABNF), has been popular among many	
			Internet specifications.  The current specification documents ABNF.	
			It balances compactness and simplicity, with reasonable	
			representational power.  The differences between standard BNF and	
			ABNF involve naming rules, repetition, alternatives, order-	
			independence, and value ranges.  This specification also supplies	
			additional rule definitions and encoding for a core lexical analyzer	
			of the type common to several Internet specifications.
      </t></abstract></front>

<seriesInfo name="RFC" value="4234"/>
<format type="TXT" octets="26351" target="ftp://ftp.isi.edu/in-notes/rfc4234.txt"/>
<format type="HTML" octets="52334" target="http://xml.resource.org/public/rfc/html/rfc4234.html"/>
<format type="XML" octets="37285" target="http://xml.resource.org/public/rfc/xml/rfc4234.xml"/>
</reference>
  </references>
  <references title="Informative References">
    <reference anchor="STREAMING">
<front>
<title>Streaming Internet Messaging Attachments</title>

<author initials="N" surname="Cook" fullname="Neil Cook">
    <organization/>
</author>

<date month="September" day="21" year="2007"/>

<abstract><t>This document describes a method for streaming multimedia attachments received by a resource constrained and/or mobile device from an IMAP server. It allows such clients, which often have limits in storage space and bandwidth, to play video and audio e-mail content. The document describes a profile for making use of the IMAP URLAUTH extension (RFC 4467), the Network Announcement SIP Media Service (RFC 4240), and the Media Server Control Markup Language (RFC 4722). The document also defines a new IMAP METADATA entry.</t></abstract>

</front>

<seriesInfo name="Internet-Draft" value="draft-ietf-lemonade-streaming-03"/>
<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-lemonade-streaming-03.txt"/>
</reference>
    <reference anchor="BURL">

<front>
<title>Message Submission BURL Extension</title>
<author initials="C." surname="Newman" fullname="C. Newman">
<organization/></author>
<date year="2006" month="May"/>
<abstract>
<t>The submission profile of Simple Mail Transfer Protocol (SMTP) provides a standard way for an email client to submit a complete message for delivery.  This specification extends the submission profile by adding a new BURL command that can be used to fetch submission data from an Internet Message Access Protocol (IMAP) server.  This permits a mail client to inject content from an IMAP server into the SMTP infrastructure without downloading it to the client and uploading it back to the server. [STANDARDS TRACK]</t></abstract></front>

<seriesInfo name="RFC" value="4468"/>
<format type="TXT" octets="28614" target="ftp://ftp.isi.edu/in-notes/rfc4468.txt"/>
</reference>
  </references>
</back>
</rfc>
