<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
        <!ENTITY rfc2088 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2088.xml'>
        <!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
        <!ENTITY rfc3501 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3501.xml'>
        <!ENTITY rfc3502 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3502.xml'>
        <!ENTITY rfc3516 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3516.xml'>
        <!ENTITY rfc4466 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4466.xml'>
        <!ENTITY rfc4469 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4469.xml'>
		<!ENTITY rfc5161 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5161.xml'>
]>

<!--///The IPR might need sorting out-->

<rfc category="std" ipr="pre5378Trust200902" docName="draft-melnikov-imap-64bit-00.txt"
	 updates="3501, 4466, 2088">
	<?xml-stylesheet href="rfc5162_files/rfc2629.htm" type="text/xsl"?>
        <?rfc strict="yes" ?>
        <?rfc toc="yes" ?>
	<?rfc symrefs="yes" ?>
	<?rfc sortrefs="yes"?>
	<?rfc iprnotified="no" ?>
	<?rfc strict="yes" ?>
	<?rfc comments="yes" ?>
	<?rfc inline="yes" ?>
	<?rfc compact="yes"?>
	<?rfc subcompact="no"?>
	<front>
		<title>64bit body part and message sizes in IMAP4</title>

    <author initials="A." surname="Melnikov" fullname="Alexey Melnikov">
			<organization>Isode Ltd</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>UK</country>
				</postal>
				<email>Alexey.Melnikov@isode.com</email>
			</address>
		</author>
    <author initials="J." surname="SrimushnamBoovaraghamoorthy" fullname="Jayantheesh SrimushnamBoovaraghamoorthy">
      <organization>Samsung Electronics America</organization>
      <address>
        <postal>
          <street>685 US Highway 202/206</street>
          <city>Bridgewater</city>
          <region>New Jersey</region>
          <code>08807</code>
          <country>USA</country>
        </postal>
        <email>jayantheesh.sb@gmail.com</email>
      </address>
    </author>
    
    <date year="2016"/>
    
    <keyword>IMAP</keyword>
    <keyword>64bit</keyword>

    <abstract>
	<t>
		This document defines an IMAPv4rev1 extension that extends the existing
		IMAPv4rev1 32 Bit message and body part sizes to 63 bit.
    </t>
    </abstract>
	</front>
	<middle>
		
	<section title="Introduction">
    <t>
		IMAP <xref target="RFC3501"/> only allows body parts or message sizes which are 32 bit.
		This document introduces an IMAP extension that allows for message and body part sizes to be 63 bit.
      <!--63bit was chosen instead of 64bit in order to make Java developer life easier.-->
    </t>

    <t>
		The client wishing to use this extension MUST issue ENABLE 64BIT. Refer <xref target="RFC5161"/>
		for the usage of ENABLE command.
    </t>
	</section>

    
	<section title="Requirements Notation">
	<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="RFC2119"/>.
	</t>
	<t>
		In examples, "C:" and "S:" indicate lines sent by
		the client and server respectively. If a single "C:" or "S:"
		label applies to multiple lines, then the line breaks between
		those lines are for editorial clarity only and are not part
		of the actual protocol exchange.
	</t>
	</section>
	
	<section title="64bit Extension">
	<t>
		An IMAP server that supports the 64bit extension advertises
		this by including the name 64BIT in its capability list in the
		authenticated state.  The server may also advertise this extension
		before the user has logged in.
    <!--///The following might be obvious, so maybe it should be deleted:-->
    If this capability is omitted, no
		information is conveyed about the server's status of supporting this
		extension.
	</t>
	<t>
		IMAP server should respond with BAD response for the 64bit message
		size messages sent by the IMAP client unless it issues "ENABLE 64BIT"
		in the current connection.
	</t>
	</section>
	
	<section title="IMAP Protocol Changes">
	<t>
		TBD.
	</t>
	</section>

	<section title="Examples">
	<t>
		C: t1 CAPABILITY<vspace />
		S: * CAPABILITY IMAP4rev1 ID 64BIT<vspace />
		S: t1 OK foo<vspace />
		C: t2 ENABLE 64BIT<vspace />
		S: * ENABLED 64BIT<vspace />
		S: t2 OK foo<vspace />
	</t>
	</section>

    <section title="Formal Syntax">
	<t>
		The following syntax specification uses the Augmented Backus-Naur 
		Form (ABNF) notation as specified in <xref target="ABNF"/>.
	</t>
      
	<t>
		Non-terminals referenced but not defined below are as defined by 
		<xref target="RFC3501"/>.
	</t>
	<t>
		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.
	</t>
<figure>
<artwork>
               <![CDATA[
  body-extension  =/ number64
             ; Alexey: I am not sure if this change is absolutely needed!

  body-fld-lines  = number64

  body-fld-octets = number64

  fetch-att       =/ "BODY" section ["<" number64 "." nz-number64 ">"] /
                     "BODY.PEEK" section ["<" number64 "." nz-number64 ">"]

  literal         = "{" number64 ["+"] "}" CRLF *CHAR8
                    ; number64 represents the number of CHAR8s.
                    ; NOTE: "+" can only present when LITERAL+/LITERAL-
                    ; is also advertised

  literal8        = "~{" number64 ["+"] "}" CRLF *OCTET
                    ;; Updating RFC 4466 version.
                    ;; A string that might contain NULs.
                    ;; <number> represents the number of OCTETs
                    ;; in the response string.
                    ;; The "+" is only allowed when both LITERAL+/LITERAL-
                    ;; and BINARY extensions are supported by the server
                    ;; [RFC2088] - needs to be updated on LITERAL-
                    ;; publication

  msg-att-static  =/ "RFC822.SIZE" SP number64

  search-key      =/ "LARGER" SP number64 / "SMALLER" SP number64

  number64    = 1*DIGIT
                ; Unsigned 63-bit integer	 		
                ; (0 <= n <= 9,223,372,036,854,775,807)

  nz-number64 = digit-nz *DIGIT
                ; Unsigned 63-bit integer	 		
                ; (0 < n <= 9,223,372,036,854,775,807)
                         

  CHAR8   = <defined in RFC 3501>
]]></artwork>
</figure>
	</section>
    
	<section title="Security Considerations">
    <t>
		TBD.
    </t>  
	<t>
		This document doesn't raise any other security concerns not already raised
		by <xref target="RFC3501"/>.
	</t>
	</section>

	<section title="IANA Considerations">
	<t>
		IANA is asked to add "64BIT" to the IMAP Capabilities
		registry, using this document as its reference.
	</t>
    </section>

    <section title="Acknowledgments">
      <t>TBD.</t>
	</section>
	</middle>
	<back>
		<references title="Normative References">

      <reference anchor="ABNF">
<front>
<title>Augmented BNF for Syntax Specifications: ABNF</title>
<author initials="D." surname="Crocker" fullname="D. Crocker">
<organization/></author>
<author initials="P." surname="Overell" fullname="P. Overell">
<organization/></author>
<date year="2008" month="January"/>
<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. [STANDARDS TRACK]</t></abstract></front>

<seriesInfo name="STD" value="68"/>

<seriesInfo name="RFC" value="5234"/>
<format type="TXT" octets="26359" target="ftp://ftp.isi.edu/in-notes/rfc5234.txt"/>
			</reference>

      &rfc2088;
      &rfc2119;
      &rfc3501;
      &rfc3516;
      &rfc4466;
      &rfc5161;
	</references>

<!--
		<references title="Informative References">

    </references>
-->

  </back>
</rfc>