<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc editing="no"?>

<rfc ipr="full2026" docName="draft-ietf-impp-cpim-msgfmt-09"
     number="XXXX" category="std" >
  <front>
    <title abbrev="CPIM Message Format">
      Common Presence and Instant Messaging: Message Format
      </title>
    <author initials="G." surname="Klyne" fullname="Graham Klyne">
      <organization abbrev="Nine by Nine">Nine by Nine</organization>
      <address>
        <postal></postal>
        <email>GK-IETF@ninebynine.org</email>
        <uri>http://www.ninebynine.net/</uri>
      </address>
    </author>
    <author initials="D." surname="Atkins" fullname="Derek Atkins">
      <organization abbrev="IHTFP Consulting">IHTFP Consulting</organization>
      <address>
        <postal>
          <street>6 Farragut Ave</street>
          <city>Somerville</city>
          <region>MA</region>
          <code>02144</code>
          <country>USA</country>
        </postal>
        <phone>+1 617 623 3745</phone>
        <email>derek@ihtfp.com, warlord@alum.mit.edu</email>
      </address>
    </author>
    <date day="21" month="November" year="2003"/>
    <area>Application</area>
    <keyword>message format</keyword>
    <keyword>instant messaging</keyword>
    <keyword>presence</keyword>
    <keyword>IMPP</keyword>
    <abstract>
      <t>This memo defines the MIME content type 'Message/CPIM', 
        a message format for protocols that conform to the 
        Common Profile for Instant Messaging (CPIM) specification.
        </t>
    </abstract>
<!--
    <note title="Discussion of this document">
      <t>Please send comments to:  &lt;impp@iastate.edu&gt;.
        To subscribe:  send a message with the body 'subscribe' 
        to &lt;impp-request@iastate.edu&gt;.  
        The mailing list archive is at 
        &lt;http://www.imppwg.org&gt;.
        </t>
    </note>
-->
  </front>

<middle>

<section anchor="sec-Introduction" title="Introduction">

<t>This memo defines the MIME content type 'Message/CPIM', a message
  format for protocols that conform to the Common Profile for Instant
  Messaging (CPIM) specification.
  This is a common message format for CPIM-compliant messaging protocols
  <xref target="I-D.ietf-impp-im"/>.
  </t>

<t>While being prepared for CPIM, this format is quite general and may
  be reused by other applications with similar requirements.
  Application specifications that adopt this as a base format should
  address the questions raised in section 6 of this document.
  </t>

  <section anchor="sec-Motivation" title="Motivation">

  <t>The Common Profile for Instant Messaging (CPIM) 
    <xref target="I-D.ietf-impp-im"/> specification defines a 
    number of operations to be supported and criteria to be
    satisfied for interworking between diverse instant messaging
    protocols.
    The intent is to allow a variety of different protocols
    interworking through gateways to support cross-protocol
    messaging that meets the requirements of RFC 2779 
    <xref target="RFC2779"/>.
    </t>

  <t>To adequately meet the security requirements of RFC 2779, a
    common message format is needed so that end-to-end signatures
    and encryption may be applied. This document describes a
    common canonical message format that must be used by any 
    CPIM-compliant message transfer protocol, whereby
    signatures are calculated for end-to-end security.
    </t>

  <t>The design of this message format is intended to enable security
    to be applied, while itself remaining agnostic about 
    the specific security mechanisms that may be appropriate for
    a given application.  For CPIM instant messaging and presence,
    specific security protocols are specified by the 
    CPIM instant messaging <xref target='I-D.ietf-impp-im' /> 
    and CPIM presence <xref target='I-D.ietf-impp-pres' /> 
    specifications.
    </t>

  <t>Also note that the message format described here is not itself
    a MIME data format, although it may be contained within a MIME
    object, and may contain MIME objects.
    See <xref target='sec-message-structure' /> for more details.
    </t>

  </section>

  <section anchor="sec-Background" title="Background">

  <t>RFC 2779 requires that an instant message can carry a MIME payload
    <xref target="RFC2045"/><xref target="RFC2046"/>;
    thus some level of support for MIME will be a common 
    element of any CPIM compliant protocol.  Therefore it seems 
    reasonable that a common message format should use a RFC2822/MIME-like
    syntax <xref target="RFC2822" /> , 
    as protocol implementations must already contain code to parse this.
    </t>

<?rfc needLines="5"?>

  <t>Unfortunately, using pure RFC2822/MIME can be problematic:
    <list style="symbols">
      <t>Irregular lexical structure -- RFC2822/MIME allows a number of optional 
        encodings and multiple ways to encode a particular value.
        For example, RFC2822/MIME comments may be encoded in multiple ways.  
        For security purposes, a single encoding method must be defined as a 
        basis for computing message digest values.  Protocols that 
        transmit data in a different format would otherwise lose 
        information needed to verify a signature.
        </t>
      <t>Weak internationalization -- RFC2822/MIME requires header
        values to use 7-bit ASCII, which is problematic for
        encoding international character sets.  Mechanisms for
        language tagging in RFC2822/MIME headers 
        <xref target="RFC2231"/> are awkward to use and have
        limited applicability.
        </t>
      <t>Mutability -- addition, modification or removal of header
        information.  Because it is not explicitly forbidden, many
        applications that process MIME content (e.g. MIME
        gateways) rebuild or restructure messages in transit.
        This obliterates most attempts at achieving security (e.g.
        signatures), leaving receiving applications unable to
        verify the data received.
        </t>
      <t>Message and payload separation -- there is not a clear
        syntactic distinction between message metadata and message
        content.
        </t>
      <t>Limited extensibility. (X-headers are problematic
        because they may not be standardized; this leads to
        situations where a header starts out as experimental but
        then finds widespread application, resulting in a common
        usage that cannot be standardized.)
        </t>
      <t>No support for structured information 
        (text string values only).
        </t>
      <t>Some processors impose line length limitations.
        </t>
      </list>
    </t>

  <t>The message format defined by this memo overcomes some of
    these difficulties by having a simplified syntax that is 
    generally compatible with the format accepted by RFC2822/MIME
    parsers and having a stricter syntax.  
    It also defines mechanisms to support some desired features
    not covered by the RFC2822/MIME format specifications.
    </t>

  </section>

<?rfc needLines="10"?>

  <section anchor="sec-Goals" title="Goals">

  <t>This specification aims to satisfy the following goals:
    <list style='symbols'>
      <t>a securable end-to-end format for a message (a canonical 
        message format to serve as a basis for signature calculation, 
        rather than specifed security mechanisms).
        </t>
      <t>independence of any specific application
        </t>
      <t>capability of conveying a range of different address types
        </t>
      <t>assumption of an 8-bit clean message-transfer protocol
        </t>
      <t>evolvable:  extensible by multiple parties
        </t>
      <t>a clear separation of message metadata from message content
        </t>
      <t>a simple, regular, easily parsed syntax
        </t>
      <t>a compact, low-overhead format for simple messages
        </t>
      </list>
    </t>

  </section>

  <section anchor="sec-Terminology" title="Terminology and Conventions">

  <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 <xref target="RFC2119"/>.
    </t>

  <t>
    <list style="empty">
      <t>NOTE:  Comments like this provide additional nonessential 
        information about the rationale behind this document.  
        Such information is not needed for building a conformant 
        implementation, but may help those who wish to understand 
        the design in greater depth.
        </t>
      </list>
    </t>

  </section>

</section>


<section anchor="sec-message-structure" title="Overall Message Structure">

<t>The CPIM message format encapsulates arbitrary MIME message 
  content, together with message- and content-related metadata.  This 
  can optionally be signed or encrypted using MIME security 
  multiparts in conjunction with an appropriate security scheme.
  </t>

<t>A Message/CPIM object is a two-part entity, where the first part 
  contains the message metadata and the second part is the message 
  content.  The two parts are separated from the enclosing MIME header
  fields and also from each other by blank lines. 
  The message metadata header information obeys more stringent 
  syntax rules than the MIME message content headers that may be 
  carried within the message.
  </t>

<?rfc needLines="7"?>

<figure>
  <preamble>A complete message looks something like this:
    </preamble>
<artwork>
   m: Content-type: Message/CPIM
   s:
   h: (message-metadata-headers)
   s:
   e: (encapsulated MIME message-body)
</artwork>
  </figure>

<figure>
  <preamble>The end of the message body is defined by the framing mechanism
    of the protocol used.  The tags 'm:', 's:', 'h:', 'e:', and 'x:' are 
    not part of the message format and are used here to indicate the 
    different parts of the message, thus:
    </preamble>
<artwork>
   m:  MIME headers for the overall message
   s:  a blank separator line
   h:  message headers
   e:  encapsulated MIME object containing the message content
   x:  MIME security multipart message wrapper
</artwork>
  </figure>

  <section anchor="sec-MIME-headers" title="Message/CPIM MIME Headers">

  <t>The message MIME headers identify the message as a CPIM-formatted 
    message.
    </t>

  <figure>
    <preamble>The only required MIME header is:
      </preamble>
<artwork>
   Content-type: Message/CPIM
</artwork>
    <postamble>
      </postamble>
  </figure>

  <t>Other MIME headers may be used as appropriate for the message 
  transfer environment.
    </t>

  </section>

  <section anchor='sec-Message-headers' title='Message Headers'>

<t>Message headers carry information relevant to the end-to-end 
  transfer of the message from sender to receiver.  Message headers 
  MUST NOT be modified, reformatted or reordered in transit, but in 
  some circumstances they MAY be examined by a CPIM message transfer 
  protocol.
  </t>

<t>The message headers serve a similar purpose to RFC 2822 message 
  headers in email <xref target="RFC2822" />, and have a similar 
  but restricted allowable syntax.
  </t>

<figure>
  <preamble>The basic header syntax is:
    </preamble>
<artwork>
   Key: Value
</artwork>
  <postamble>where "Key" is a header name 
    and "Value" is the corresponding header value.
    </postamble>
  </figure>

<?rfc needLines="5"?>

  <t>The following considerations apply:
    <list style='symbols'>
      <t>The entire header MUST be contained on a single line.  
        The line terminator is not considered part of the header value.
        </t>
      <t>Only one header per line.  
        Multiple headers MUST NOT be included on a single line.
        </t>
      <t>Processors SHOULD NOT impose any line-length limitations.
        </t>
      <t>There MUST NOT be any whitespace at the beginning or end of a line.
        </t>
      <t>UTF-8 character encoding <xref target='RFC3629' />
        MUST be used throughout.
        </t>
      <t>The character sequence CR,LF (13,10) 
        MUST be used to terminate each line.
        </t>
      <t>The header name contains only US-ASCII characters 
        (see <xref target="sec-Header-names" /> and 
        <xref target="sec-Collected-syntax" /> for the specific syntax).
        </t>
      <t>The header MUST NOT contain any control characters
        (0-31). If a header value needs to represent control
        characters then the escape mechanism described below 
        MUST be used.
        </t>
      <t>There MUST be a single space character (32) following the
        header name and colon.
        </t>
      <t>Multiple headers using the same key (header name) are
        allowed. (Specific header semantics may dictate only one
        occurrence of any particular header.)
        </t>
      <t>Header names MUST match exactly 
        (i.e. "From:" and "from:" are different headers).
        </t>
      <t>If a header name is not recognized or not understood, 
        the header should be ignored.  
        But see also the "Require:" header 
        (<xref target='sec-header-Require' />).
        </t>
      <t>Interpretation (e.g. equivalence) of header values is
        dependent on the particular header definition.  Message
        processors MUST preserve all octets of all headers
        (both name and value) exactly.
        </t>
      <t>Message processors MUST NOT change the order of message
        headers.
        </t>
      </list>
    </t>

    <figure>
      <preamble>Examples:
        </preamble>
<artwork>
   To: Pooh Bear &lt;im:pooh@100akerwood.com&gt;
   From: &lt;im:piglet@100akerwood.com&gt;
   DateTime: 2001-02-02T10:48:54-05:00
</artwork>
      </figure>

    </section>

  <section anchor='sec-Char-escape' title='Character Escape Mechanism'>

  <t>This mechanism MUST be used to code control characters in a header, 
    having Unicode code points in the range U+0000 to U+001f or U+007f.  
    (Rather than invent something completely new, the escape mechanism
    has been adopted from that used by the Java programming language.)
    </t>

  <t>Note that the escape mechanism is applied to a UCS-2 character, NOT 
    to the octets of its UTF-8 coding.  Mapping from/to UTF-8 coding is 
    performed without regard for escape sequences or character coding.  
    (The header syntax is defined so that octets corresponding to 
    control characters other than CR and LF do not appear in the 
    output.)
    </t>

  <figure>
    <preamble>An arbitrary UCS-2 character is escaped using the form:
      </preamble>
<artwork>
   \uxxxx
</artwork>
    </figure>

  <figure>
    <preamble>where:
      </preamble>
<artwork>
   \     is U+005c (backslash)
   u     is U+0075 (lower case letter U)
   xxxx  is a sequence of exactly four hexadecimal digits
         (0-9, a-f or A-F) or
         (U+0030-U+0039, U+0041-U+0046, or U+0061-0066)
</artwork>
    <postamble>The hexadecimal number 'xxxx' is the UCS code-point value 
      of the escaped character.
      </postamble>
    </figure>

  <figure>
    <preamble>Further, the following special sequences introduced by "\" are used:
      </preamble>
<artwork>
   \\    for \ (backslash, U+005c)
   \"    for " (double quote, U+0022)
   \'    for ' (single quote, U+0027)
   \b    for backspace (U+0008)
   \t    for tab (U+0009)
   \n    for linefeed (U+000a)
   \r    for carriage return (U+000d)
</artwork>
    </figure>

    <section anchor='sec-Escape-use' title='Escape Mechanism Usage'>

    <t>When generating messages conformant with this specification:
      <list style='symbols'>
        <t>The special sequences listed above MUST be used to encode any 
          occurrence of the following characters that appear anywhere in 
          a header:
          backslash (U+005c),
          backspace (U+0008),
          tab (U+0009),
          linefeed (U+000a) or
          carriage return (U+000d).
          </t>
        <t>The special sequence \" MUST be used for any occurrence of a
          double quote (U+0022) that appears within a string delimited by 
          double quotes.
          </t>
        <t>The special sequence \' MUST be used for any occurrence of a
          single quote (U+0027) that appears within a string delimited by 
          single quotes.
          </t>
        <t>Single- or double-quote characters that delimit a 
          string value MUST NOT be escaped.
          </t>
        <t>The general escape sequence \uxxxx MUST be used for any other 
          control character (U+0000 to U+0007, U+000b to U+000c, U+000e to 
          U+001f or u+007f) that appears anywhere in a header.
          </t>
        <t>All other characters MUST NOT be represented using an escape sequence.
          </t>
        </list>
      </t>

    <t>When processing a message based on this specification, 
      the escape sequence usage described above MUST be recognized.
      </t>

    <t>Further, any other occurrence of an escape sequence described above 
      SHOULD be recognized and treated as an occurrence of the corresponding 
      Unicode character.
      </t>

    <t>Any backslash ('\') character SHOULD be interpreted as
      introducing an escape sequence.  
      Any unrecognized escape sequence SHOULD be treated as an 
      instance of the character following the backslash character.
      An isolated backslash that is the last character of a header 
      SHOULD be ignored.
      </t>

      </section>

    </section>

  <section anchor='sec-Message-content' title='Message Content'>

  <t>The final section of a Message/CPIM is the MIME-encapsulated 
    message content, which follows standard MIME formatting rules 
    <xref target='RFC2045' /><xref target='RFC2046' />.
    </t>

  <t>The MIME content headers MUST include at least a Content-Type 
    header.  The content may be any MIME type.
    </t>

<?rfc needLines="6"?>

  <figure>
    <preamble>Example:
      </preamble>
<artwork>
   e: Content-Type: text/plain; charset=utf-8
   e: Content-ID: &lt;1234567890@foo.com&gt;
   e: 
   e: This is my encapsulated text message content
</artwork>
    </figure>

    </section>

  </section>


<section anchor='sec-header-syntax' title='Message Header Syntax'>

<t>A header contains two parts, a name and a value, separated by a 
  colon character (':') and single space (32).
  It is terminated by the sequence CR,LF (13,10).
  </t>

<t>Headers use UTF-8 character encoding thoughout, per RFC 3629 
  <xref target='RFC3629' />.
  </t>

<t>
  <list style="empty">
    <t>NOTE:  in the descriptions that follow, header field names 
      and other specified text values MUST be used exactly as
      given, using exactly the indicated upper- and lower- case
      letters. In this respect, the ABNF usage differs from RFC 2234.
      <xref target='RFC2234' />.
      </t>
    </list>
  </t>

  <section anchor='sec-Header-names' title='Header Names'>

  <t>The header name is a sequence of US-ASCII characters, 
    excluding control, SPACE or separator characters.  
    Use of the character "." in a header name is reserved for a 
    namespace prefix separator.
    </t>

  <figure>
    <preamble>Separator characters are:
      </preamble>
<artwork>
   SEPARATORS   = "(" / ")" / "&lt;" / "&gt;" / "@" 
                / "," / ";" / ":" / "\" / DQUOTE
                / "/" / "[" / "]" / "?" / "=" 
                / "{" / "}" / SP
</artwork>
    </figure>

  <t>
    <list style="empty">
      <t>NOTE:  The range of allowed characters was determined by 
        examination of HTTP and RFC 2822 header name formats and 
        choosing the more restricted.  The intent is to allow CPIM 
        headers to follow a syntax that is compatible with the 
        allowed syntax for both RFC 2822 <xref target='RFC2822' />
        and HTTP <xref target='RFC2616' /> 
        (including HTTP-derived protocols such as SIP
        <xref target='RFC3261' />).
        </t>
      </list>
    </t>

  </section>

<?rfc needLines="10"?>

  <section anchor='sec-Header-Value' title='Header Value'>

  <t>A header value has a structure defined by the corresponding header 
    specification.  Implementations that use a particular header must 
    adhere to the format and usage rules thus defined when creating or 
    processing a message containing that header.
    </t>

  <t>The other general constraints on header formats MUST also be 
    followed (one line, UTF-8 character encoding, no control 
    characters, etc.)
    </t>

    </section>

  <section anchor='sec-Language-tagging' title='Language tagging'>

  <t>Full internationalization of a protocol requires that a 
    language can be indicated for any human-readable text 
    <xref target='RFC2130' /><xref target='RFC2277' />.
    </t>

  <t>A message header may indicate a language for its value 
    by including ';lang=tag' after the header name 
    and colon, where 'tag' is a language identifying 
    token per RFC 3066 <xref target='RFC3066' />.
    </t>

  <figure>
    <preamble>Example:
      </preamble>
<artwork>
   Subject:;lang=fr Objet de message
</artwork>
    <postamble>
      </postamble>
    </figure>

  <t>If the language parameter is not applied a header, any 
    human-readable text is assumed to use the language identified 
    as 'i-default' <xref target='RFC2277' />.
    </t>

  </section>

  <section anchor='sec-Namespaces' 
           title='Namespaces for Header Name Extensibility'>

  <t>
    <list style="empty">
      <t>NOTE:  This section defines a framework for header 
        extensibility whose use is optional.  If no header 
        extensions are allowed by an application then these 
        structures may never be used.
        </t>
      </list>
    </t>

  <t>An application that uses this message format is expected to define 
    the set of headers that are required and allowed for that 
    application.  This section defines a header extensibility framework 
    that can be used with any application.
    </t>

  <t>The extensibility framework is based on that provided for 
    XML <xref target='W3C.xml' /> by XML namespaces 
    <xref target='W3C.xml-names' />.  
    All headers are associated with a "namespace", which is in 
    turn associated with a globally unique URI.
    </t>

  <t>Within a particular message instance, header names are 
    associated with a particular namespace through the presence or 
    absence of a namespace prefix, which is a leading part of the 
    header name followed by a period ("."); e.g.
    </t>

  <figure>
<artwork>
   prefix.header-name: header-value
</artwork>
    <postamble>
      Here, 'prefix' is the header name prefix, 'header-name' is the 
      header name within the namespace associated with 'prefix', 
      and 'header-value' is the value for this header.
      </postamble>
    </figure>

  <figure>
<artwork>
   header-name: header-value
</artwork>
    <postamble>
      In this case, the header name prefix is absent, and the 
      given 'header-name' is associated with a default namespace.
      </postamble>
    </figure>

  <t>The Message/CPIM media type registration designates a default
    namespace for any headers that are not more explicitly
    associated with any namespace.
    In most cases, this default namespace is all that is needed.
    </t>

  <t>A namespace is identified by a URI.  In this usage, the URI is used 
    simply as a globally unique identifier, and there is no requirement 
    that it can be used for any other purpose.  Any legal globally 
    unique URI MAY be used to identify a namespace.  (By "globally 
    unique", we mean constructed according to some set of rules so that 
    it is reasonable to expect that nobody else will use the same URI 
    for a different purpose.)  A URI used as an identifier MUST be a 
    full absolute-URI, per RFC 2396 <xref target='RFC2396' />.  
    (Relative URIs and URI-references containing fragment identifiers 
    MUST NOT be used for this purpose.)
    </t>

  <t>Within a specific message, an 'NS' header is used to declare a 
    namespace prefix and associate it with a URI that identifies a 
    namespace.  Following that declaration, within the scope of that 
    message, the combination of namespace prefix and header name 
    indicates a globally unique identifier for the header (consisting 
    of the namespace URI and header name).
    </t>

  <figure>
    <preamble>For example:
      </preamble>
<artwork>
   NS: MyFeatures &lt;mid:MessageFeatures@id.foo.com&gt;
   MyFeatures.WackyMessageOption: Use-silly-font
</artwork>
    <postamble>
      This defines a namespace prefix 'MyFeatures' associated with the 
      namespace identifier 'mid:MessageFeatures@id.foo.com'.  
      Subsequently, the prefix indicates that the WackyMessageOption 
      header name referenced is associated with the identified namespace.
      </postamble>
    </figure>

  <t>A namespace prefix declaration MUST precede any use of
    that prefix.
    </t>

<?rfc needLines="8"?>

  <figure>
    <preamble>
      With the exception of any application-specific predefined
      namespace prefixes (see <xref target='sec-Applications' />), 
      a namespace prefix is strictly local to the message in which it
      occurs.
      The actual prefix used has no global significance.
      This means that the headers:
      </preamble>
<artwork>
   xxx.name: value
   yyy.name: value
</artwork>
    <postamble>
      in two different messages may have exactly the same effect if 
      namespace prefixes 'xxx' and 'yyy' are associated with the same 
      namespace URI.
      Thus the following have exactly the same meaning:
      </postamble>
    </figure>

  <figure>
<artwork>
   NS: acme &lt;http://id.acme.widgets/wily-headers/&gt;
   acme.runner-trap: set
</artwork>
    <postamble>and
      </postamble>
    </figure>

  <figure>
<artwork>
   NS: widget &lt;http://id.acme.widgets/wily-headers/&gt;
   widget.runner-trap: set
</artwork>
    </figure>

  <figure>
    <preamble>A 'NS' header without a header prefix name specifies 
      a default namespace for subsequent headers;  
      that is a namespace that is associated with header names not 
      having a prefix.  
      For example:
      </preamble>
<artwork>
   NS: &lt;http://id.acme.widgets/wily-headers/&gt;
   runner-trap: set
</artwork>
    <postamble>
      has the same meaning as the previous examples.
      </postamble>
    </figure>

  <t>This framework allows different implementers to create extension 
    headers without the worry of header name duplication;  
    each defines headers within their own namespace.
    </t>

  </section>

  <section anchor='sec-Mandatory' title='Mandatory-to-Recognize Features'>

  <t>Sometimes it is necessary for the sender of a message to insist 
    that some functionality is understood by the recipient.  By using 
    the mandatory-to-recognize indicator, a sender is notifying the 
    recipient that it MUST understand the named header or feature in 
    order to properly understand the message.
    </t>

  <figure>
    <preamble>
      A header or feature is indicated as being mandatory-to-recognize
      by a 'Require:' header.  For example:
      </preamble>
<artwork>
   Require: MyFeatures.VitalMessageOption
   MyFeatures.VitalMessageOption: Confirmation-requested
</artwork>
    </figure>

  <t>Multiple required header names may be listed in a single 
    'Require' header, separated by commas.
    </t>

  <t>
    <list style="empty">
      <t>NOTE:  Indiscriminate use of 'Require:' headers could 
        harm interoperability.  It is suggested that any 
        implementer who defines required headers also publish 
        the header specifications so other implementations can 
        successfully interoperate.
        </t>
      </list>
    </t>

  <figure>
    <preamble>
      The 'Require:' header MAY also be used to indicate that some
      non-header semantics must be implemented by the recipient,
      even when it does not appear as a header.  For example:
      </preamble>
<artwork>
   Require: Locale.MustRenderKanji
</artwork>
    <postamble>
      might be used to indicate that message content includes
      characters from the Kanji repertoire, which must be rendered
      for proper understanding of the message.  In this case, the
      header name is just a token (using header name syntax and
      namespace association) that indicates some desired
      behaviour.
      </postamble>
    </figure>

  </section>

  <section anchor='sec-Collected-syntax' 
           title='Collected Message Header Syntax'>

  <t>The following description of message header syntax uses ABNF,
    per RFC 2234 <xref target='RFC2234' />. 
    Most of this syntax can be interpreted as defining UCS
    character sequences or UTF-8 octet sequences.  Alternate
    productions at the end allow for either interpretation.
    </t>

  <t>
    <list style="empty">
      <t>NOTE:  Specified text values MUST be used as given, 
        using exactly the indicated upper- and lower-case letters. 
        In this respect, the ABNF usage here differs from RFC 2234
        <xref target='RFC2234' />.
        </t>
      </list>
    </t>

  <figure>
    <preamble>Collected syntax:
      </preamble>
    <artwork><![CDATA[
Header       = Header-name ":" *( ";" Parameter ) SP
               Header-value
               CRLF

Header-name  = [ Name-prefix "." ] Name
Name-prefix  = Name

Parameter    = Lang-param / Ext-param
Lang-param   = "lang=" Language-tag
Ext-param    = Param-name "=" Param-value
Param-name   = Name
Param-value  = Token / Number / String

Header-value = *HEADERCHAR

Name         = 1*NAMECHAR
Token        = 1*TOKENCHAR
Number       = 1*DIGIT
String       = DQUOTE *( Str-char / Escape ) DQUOTE
Str-char     = %x20-21 / %x23-5B / %x5D-7E / UCS-high
Escape       = "\" ( "u" 4(HEXDIG)    ; UCS codepoint
                   / "b"              ; Backspace
                   / "t"              ; Tab
                   / "n"              ; Linefeed
                   / "r"              ; Return
                   / DQUOTE           ; Double quote
                   / "'"              ; Single quote
                   / "\" )            ; Backslash

Formal-name  = 1*( Token SP ) / String
URI          = <defined as absolute-URI by RFC 2396>
Language-tag = <defined by RFC 3066>

             ; Any UCS character except CTLs, or escape
HEADERCHAR   = UCS-no-CTL / Escape

             ; Any US-ASCII char except ".", CTLs or SEPARATORS:
NAMECHAR     = %x21 / %x23-27 / %x2a-2b / %x2d 
             / %x5e-60 / %x7c / %x7e
             / ALPHA / DIGIT

             ; Any UCS char except CTLs or SEPARATORS:
TOKENCHAR    = NAMECHAR / "." / UCS-high

SEPARATORS   = "(" / ")" / "<" / ">" / "@"    ; 28/29/3c/3e/40
             / "," / ";" / ":" / "\" / DQUOTE ; 2c/3b/3a/5c/22
             / "/" / "[" / "]" / "?" / "="    ; 2f/5b/5d/3f/3d
             / "{" / "}" / SP                 ; 7b/7d/20
CTL          = <Defined by RFC 2234 -- %x0-%x1f, %x7f>
CRLF         = <Defined by RFC 2234 -- CR, LF>
SP           = <defined by RFC 2234 -- %x20>
DIGIT        = <defined by RFC 2234 -- '0'-'9'>
HEXDIG       = <defined by RFC 2234 -- '0'-'9', 'A'-'F', 'a'-'f'>
ALPHA        = <defined by RFC 2234 -- 'A'-'Z', 'a'-'z'>
DQUOTE       = <defined by RFC 2234 -- %x22>
]]>
</artwork>
    <postamble>
      </postamble>
    </figure>

  <figure>
    <preamble>
      To interpret the syntax in a general UCS character
      environment, use the following productions:
      </preamble>
<artwork>
UCS-no-CTL   = %x20-7e / UCS-high
UCS-high     = %x80-ffffffff
</artwork>
    </figure>

  <figure>
    <preamble>
      To interpret the syntax as defining UTF-8 coded octet
      sequences, use the following productions:
      </preamble>
<artwork>
UCS-no-CTL   = UTF8-no-CTL
UCS-high     = UTF8-multi
UTF8-no-CTL  = %x20-7e / UTF8-multi
UTF8-multi   = %xC0-DF %x80-BF
             / %xE0-EF %x80-BF %x80-BF
             / %xF0-F7 %x80-BF %x80-BF %x80-BF
             / %xF8-FB %x80-BF %x80-BF %x80-BF %x80-BF
             / %xFC-FD %x80-BF %x80-BF %x80-BF %x80-BF %x80-BF
</artwork>
    </figure>

  </section>

</section>


<section anchor='sec-Header-definitions' title='Header Definitions'>

  <t>This specification defines a core set of headers that are 
    available for use by applications:  an application
    specification must indicate the headers that may be used,
    those that must be recognized and those that must appear in
    any message (see <xref target='sec-Applications' />).
    </t>

<?rfc needLines="7"?>

  <t>The header definitions that follow fall into two categories:
    <list style='hanging'>
      <t hangText='a)'>
        those that are part of the CPIM format extensibility 
        framework, and
        </t>
      <t hangText='b)'>
        those that have been based on similar headers in RFC 2822
        <xref target='RFC2822' />, 
        specified here with corresponding semantics.
        </t>
      </list>
    </t>

  <t>Header names and syntax are described without a namespace
    qualification, and the associated namespace URI is listed as
    part of the header specification.  Any of the namespace
    associations already mentioned (implied default namespace,
    explicit default namespace or implied namespace prefix or
    explicit namespace prefix declaration) may be used to identify
    the namespace.
    </t>

  <t>all headers defined here are associated with the namespace
    uri &lt;urn:ietf:params:cpim-headers:&gt;, which is defined
    according to <xref target='RFC3553' />.
    </t>

  <t>
    <list style="empty">
      <t>NOTE:  Header names and other text MUST be used as given, 
        using exactly the indicated upper- and lower-case letters.
        In this respect, the ABNF usage here differs from RFC 2234
        <xref target='RFC2234' />.
        </t>
      </list>
    </t>


  <section anchor='sec-header-From' title="The 'From' Header">

  <t>Indicates the sender of a message.
    <list style='hanging'>
      <t hangText='Header name:'>From
        </t>
      <t hangText='Namespace URI:'>
        <vspace blankLines='0' />
        &lt;urn:ietf:params:cpim-headers:&gt;
        </t>
      <t hangText='Syntax:'>
        <vspace blankLines='0' />
        (see also <xref target='sec-Collected-syntax' />)
        <figure>
<artwork>
   From-header = "From" ": " [ Formal-name ] "&lt;" URI "&gt;"
                     ; "From" is case-sensitive
</artwork>
          </figure>
        </t>
      <t hangText='Description:'>
        <vspace blankLines='0' />
        Indicates the sender or originator of a message.
        <vspace blankLines='1' />
        If present, the 'Formal-name' identifies the person or "real world" name for 
        the originator.
        <vspace blankLines='1' />
        The URI indicates an address for the originator.
        </t>
      </list>
    </t>

  <figure>
    <preamble>Examples:
      </preamble>
<artwork>
   From: Winnie the Pooh &lt;im:pooh@100akerwood.com&gt;

   From: &lt;im:tigger@100akerwood.com&gt;
</artwork>
    </figure>

  </section>

  <section anchor='sec-header-To' title="The 'To' Header">

  <t>Specifies an intended recipient of a message.
    <list style='hanging'>
      <t hangText='Header name:'>To
        </t>
      <t hangText='Namespace URI:'>
        <vspace blankLines='0' />
        &lt;urn:ietf:params:cpim-headers:&gt;
        </t>
      <t hangText='Syntax:'>
        <vspace blankLines='0' />
        (see also <xref target='sec-Collected-syntax' />)
        <figure>
<artwork>
   To-header = "To" ": " [ Formal-name ] "&lt;" URI "&gt;"
                     ; "To" is case-sensitive
</artwork>
          </figure>
        </t>
      <t hangText='Description:'>
        <vspace blankLines='0' />
        Indicates the recipient of a message.
        <vspace blankLines='1' />
        If present, the 'Formal-name' identifies the person or
        "real world" name for the recipient.
        <vspace blankLines='1' />
        The URI indicates an address for the recipient.
        <vspace blankLines='1' />
        Multiple recipients may be indicated by including multiple
        'To' headers.
        </t>
      </list>
    </t>

  <figure>
    <preamble>Examples:
      </preamble>
<artwork>
   To: Winnie the Pooh &lt;im:pooh@100akerwood.com&gt;

   To: &lt;im:tigger@100akerwood.com&gt;
</artwork>
    </figure>

  </section>

  <section anchor='sec-header-cc' title="The 'cc' Header">

  <t>Specifies a non-primary recipient ("courtesy copy") 
    for a message.
    <list style='hanging'>
      <t hangText='Header name:'>cc
        </t>
      <t hangText='Namespace URI:'>
        <vspace blankLines='0' />
        &lt;urn:ietf:params:cpim-headers:&gt;
        </t>
      <t hangText='Syntax:'>
        <vspace blankLines='0' />
        (see also <xref target='sec-Collected-syntax' />)
        <figure>
<artwork>
   Cc-header   = "cc" ": " [ Formal-name ] "&lt;" URI "&gt;"
                     ; "cc" is case-sensitive
</artwork>
          </figure>
        </t>
      <t hangText='Description:'>
        <vspace blankLines='0' />
        Indicates a courtesy copy recipient of a message.
        <vspace blankLines='1' />
        If present, the 'Formal-name' identifies the
        person or "real world" name for the recipient.
        <vspace blankLines='1' />
        The URI indicates an address for the recipient.
        <vspace blankLines='1' />
        Multiple courtesy copy recipients may be indicated by
        including multiple 'cc' headers.
        </t>
      </list>
    </t>

  <figure>
    <preamble>Examples:
      </preamble>
<artwork>
   cc: Winnie the Pooh &lt;im:pooh@100akerwood.com&gt;

   cc: &lt;im:tigger@100akerwood.com&gt;
</artwork>
    </figure>

  </section>

  <section anchor='sec-header-DateTime' title="The 'DateTime' Header">

  <t>Specifies the date and time a message was sent.

    <list style='hanging'>
      <t hangText='Header name:'>DateTime
        </t>
      <t hangText='Namespace URI:'>
        <vspace blankLines='0' />
        &lt;urn:ietf:params:cpim-headers:&gt;
        </t>
      <t hangText='Syntax:'>
        <vspace blankLines='0' />
        (see also <xref target='sec-Collected-syntax' />)
        <figure>
<artwork>
   DateTime-header = "DateTime" ": " date-time
                     ; "DateTime" is case-sensitive
</artwork>
          </figure>(where
        the syntax of 'date-time' is a profile of ISO8601
        <xref target='ISO.8601.1988' />
        defined in "Date and Time on the Internet" 
        <xref target='RFC3339' />)
        </t>
      <t hangText='Description:'>
        <vspace blankLines='0' />
        The 'DateTime' header supplies the date and time
        at which the sender sent the message.
        <vspace blankLines='1' />
        One purpose of the this header is to provide for
        protection against a replay attack, by allowing the
        recipient to know when the message was intended to be
        sent.  The value of the date header is the senders's 
        current time when the message was transmitted, using ISO
        8601 <xref target='ISO.8601.1988' /> date and time format 
        as profiled in "Date and Time on the Internet: Timestamps" 
        <xref target='RFC3339' />.
        </t>
      </list>
    </t>

  <figure>
    <preamble>Example:
      </preamble>
<artwork>
   DateTime: 2001-02-01T12:16:49-05:00
</artwork>
    </figure>

  </section>

  <section anchor='sec-header-Subject' title="The 'Subject' Header">

  <t>Contains a description of the topic of the message.
    <list style='hanging'>
      <t hangText='Header name:'>Subject
        </t>
      <t hangText='Namespace URI:'>
        <vspace blankLines='0' />
        &lt;urn:ietf:params:cpim-headers:&gt;
        </t>
      <t hangText='Syntax:'>
        <vspace blankLines='0' />
        (see also <xref target='sec-Collected-syntax' />)
        <figure>
<artwork>
   Subject-header = "Subject" ":" [ ";" Lang-param ] SP *HEADERCHAR
                     ; "Subject" is case-sensitive
</artwork>
          </figure>
        </t>
      <t hangText='Description:'>
        <vspace blankLines='0' />
        The 'Subject' header supplies the sender's description of
        the topic or content of the message.
        <vspace blankLines='1' />
        The sending agent should specify the language parameter if
        it has any reasonable knowledge of the language used by
        the sender to indicate the message subject.
        </t>
      </list>
    </t>

  <figure>
    <preamble>Example:
      </preamble>
<artwork>
   Subject:;lang=en Eeyore's feeling very depressed today
</artwork>
    </figure>

  </section>

  <section anchor='sec-header-NS' title="The 'NS' Header">

  <t>Declare a local namespace prefix.
    <list style='hanging'>
      <t hangText='Header name:'>NS
        </t>
      <t hangText='Namespace URI:'>
        <vspace blankLines='0' />
        &lt;urn:ietf:params:cpim-headers:&gt;
        </t>
      <t hangText='Syntax:'>
        <vspace blankLines='0' />
        (see also <xref target='sec-Collected-syntax' />)
        <figure>
<artwork>
   NS-header = "NS" ": " [ Name-prefix ] "&lt;" URI "&gt;"
                     ; "NS" is case-sensitive
</artwork>
          </figure>
        </t>
      <t hangText='Description:'>
        <vspace blankLines='0' />
        Declares a namespace prefix that may be used in subsequent
        header names.  
        See <xref target='sec-Namespaces' /> for more details.
        </t>
      </list>
    </t>

  <figure>
    <preamble>Example:
      </preamble>
<artwork>
   NS: MyAlias &lt;mid:MessageFeatures@id.foo.com&gt;
   MyAlias.MyHeader: private-extension-data
</artwork>
    </figure>

  </section>

  <section anchor='sec-header-Require' title="The 'Require' Header">

  <t>Specify a header or feature that must be implemented by the
    receiver for correct message processing.
    <list style='hanging'>
      <t hangText='Header name:'>Require
        </t>
      <t hangText='Namespace URI:'>
        <vspace blankLines='0' />
        &lt;urn:ietf:params:cpim-headers:&gt;
        </t>
      <t hangText='Syntax:'>
        <vspace blankLines='0' />
        (see also <xref target='sec-Collected-syntax' />)
        <figure>
<artwork>
   Require-header = "Require" ": " Header-name *( "," Header-name )
                     ; "Require" is case-sensitive
</artwork>
          </figure>
        </t>
      <t hangText='Description:'>
        <vspace blankLines='0' />
        Indicates a header or feature that must be implemented or
        understood by the receiver for correct message processing.
        See section 3.5 for more details.
        <vspace blankLines='1' />
        Note that the required header or feature does not have to 
        be used in the message,
        but for brevity it is recommended that an implementation does
        not issue the 'Required' header for unused features.
        </t>
      </list>
    </t>

  <figure>
    <preamble>Example:
      </preamble>
<artwork>
   Require: MyAlias.VitalHeader
</artwork>
  </figure>

  </section>

</section>

  <section anchor='sec-Examples' title='Examples'>

  <figure>
    <preamble>
      The examples in the following sections use the per-line tags 
      below to indicate different parts of the overall message format:
      </preamble>
<artwork>
   m:  MIME headers for the overall message
   s:  a blank separator line
   h:  message headers
   e:  encapsulated MIME object containing the message content
   x:  MIME security multipart message wrapper
</artwork>
    </figure>

  <t>The following examples also assume
    &lt;urn:ietf:params:cpim-headers:&gt; is the implied default
    namespace for the application.
    </t>

  <section anchor='sec-example-1' title='An Example Message/CPIM Message'>

  <figure>
    <preamble>
      The following example shows a Message/CPIM message:
      </preamble>
<artwork><![CDATA[
m: Content-type: Message/CPIM
s:
h: From: MR SANDERS <im:piglet@100akerwood.com>
h: To: Depressed Donkey <im:eeyore@100akerwood.com>
h: DateTime: 2000-12-13T13:40:00-08:00
h: Subject: the weather will be fine today
h: Subject:;lang=fr beau temps prevu pour aujourd'hui
h: NS: MyFeatures <mid:MessageFeatures@id.foo.com>
h: Require: MyFeatures.VitalMessageOption
h: MyFeatures.VitalMessageOption: Confirmation-requested
h: MyFeatures.WackyMessageOption: Use-silly-font
s:
e: Content-type: text/xml; charset=utf-8
e: Content-ID: <1234567890@foo.com>
e:
e: <body>
e: Here is the text of my message.
e: </body>
]]></artwork>
    <postamble>
      </postamble>
    </figure>

  </section>

  <section anchor='sec-example-2' 
           title='An Example Esing MIME multipart/signed'>

  <t>In order to secure a Message/CPIM, an application or
    implementation may use RFC 1847 <xref target='RFC1847' />,
    and some appropriate security protocols 
    (e.g. S/MIME <xref target='RFC2633' /> 
    or openPGP <xref target='RFC2440' />),
    and cryptographic scheme.
    </t>

  <figure>
    <preamble>
      Using S/MIME <xref target='RFC2633' /> and pkcs7, 
      the above message would look like this:
      </preamble>
<artwork><![CDATA[
x: Content-Type: multipart/signed; boundary=next;
                 micalg=sha1;
                 protocol=application/pkcs7-signature
x:
x: --next
m: Content-Type: Message/CPIM
s:
h: From: MR SANDERS <im:piglet@100akerwood.com>
h: To: Dopey Donkey <im:eeyore@100akerwood.com>
h: DateTime: 2000-12-13T13:40:00-08:00
h: Subject: the weather will be fine today
h: Subject:;lang=fr beau temps prevu pour aujourd'hui
h: NS: MyFeatures <mid:MessageFeatures@id.foo.com>
h: Require: MyFeatures.VitalMessageOption
h: MyFeatures.VitalMessageOption: Confirmation-requested
h: MyFeatures.WackyMessageOption: Use-silly-font
s:
e: Content-type: text/xml; charset=utf-8
e: Content-ID: <1234567890@foo.com>
e:
e: <body>
e: Here is the text of my message.
e: </body>
x: --next
x: Content-Type: application/pkcs7-signature
x:
x: (signature stuff)
    :
x: --next--
]]></artwork>
    <postamble>
      </postamble>
    </figure>

  </section>

</section>

<section anchor='sec-Applications' 
         title='Application Design Considerations'>

  <t>As defined, the 'Message/CPIM' content type uses a default
    namespace URI 'urn:ietf:params-cpim-headers:', and does not
    define any other implicit namespace prefixes. Applications
    that have different requirements should define and register a
    different MIME media type, specify the required default
    namespace URI and define any implied namespace prefixes as
    part of the media type specification.
    </t>

<?rfc needLines="5"?>

  <t>Applications using this specification must also specify:
    <list style='symbols'>
      <t>all headers that must be recognized by implementations 
        of the application
        </t>
      <t>any headers that must be present in all messages created 
        by that application.
        </t>
      <t>any headers that may appear more than once in a message, 
        and how they are to be interpreted (e.g. how to interpret 
        multiple 'subject:' headers with different language 
        parameter values).
        </t>
      <t>Security mechanisms and crytography schemes
        to be used with the application, including any
        mandatory-to-implement security provisions.
        </t>
      </list>
    </t>

  <t>The goal of providing a definitive message format to which
    security mechanisms can be applied places some constraints
    on the design of applications that use this message format:
    <list style='symbols'>
      <t>Within a network of message transfer agents, an intermediate
        gateway MUST NOT change the Message/CPIM content in any way.
        This implies that headers cannot be changed or reordered,
        transfer encoding cannot be changed, languages cannot be
        changed, etc.
        </t>
      <t>Because Message/CPIM messages are immutable, any transfer
        agent that wants to modify the message should create a new
        Message/CPIM message with the modified header and with
        the original message as its content.  (This approach is
        similar to real-world bill-of-lading handling, where each
        person in the chain attaches a new sheet to the message.  
        Then anyone can validate the original message and see what has
        changed and who changed it by following the trail of
        amendments.  Another metaphor is including the old message in
        a new envelope.)
        </t>
      </list>
    </t>

  <t>In chosing security mechanisms for an applications, 
    the following IAB survey documents may be helpful:
    <list style='symbols'>
      <t>Security Mechanisms for the Internet
        <xref target='I-D.iab-secmech' />
        </t>
      <t>A Survey of Authentication Mechanisms
        <xref target='I-D.iab-auth-mech' />.
        </t>
      </list>
    </t>

</section>

  <section anchor='sec-IANA-considerations' title='IANA Considerations'>

  <t>This memo calls for two new IANA registrations:
    <list style='symbols'>
      <t>A new MIME content-type value, Message/CPIM, 
        per RFC 2048 <xref target='RFC2048' />.
        The registration template can be found in 
        <xref target='sec-MIME-type' /> below.
        </t>
      <t>A new IANA URN sub-namespace, 
        urn:ietf:params:cpim-headers:, per RFC 3553
        <xref target='RFC3553' />.
        The registration template can be found in
        <xref target='sec-urn-ietf-param' /> below.
        </t>
      </list>
    </t>

  <section anchor='sec-MIME-type' 
           title='Registration for Message/CPIM Content Type'>

  <t>
    <list style='hanging'>
      <t hangText='To:'>
        ietf-types@iana.org
        </t>
      <t hangText='Subject:'>
        Registration of MIME media type Message/CPIM
        </t>
      <t hangText='MIME media type name:'>
        message
        </t>
      <t hangText='MIME subtype name:'>
        CPIM
        </t>
      <t hangText='Required parameters:'>
        (None)
        </t>
      <t hangText='Optional parameters:'>
        (None)
        </t>
      <t hangText='Encoding considerations:'>
        <vspace blankLines='0' />
        Intended to be used in 8-bit clean environments, with non-
        transformative encoding (8-bit or binary, according to the
        content contained within the message;  the CPIM message
        headers can be handled in an 8-bit text environment).
        <vspace blankLines='1' />
        This content type could be used with a 7-bit transfer
        environment if appropriate transfer encoding is used. NOTE
        that for this purpose, enclosed MIME content MUST BE
        treated as opaque data and encoded accordingly. Any
        encoding must be reversed before any enclosed MIME content
        can be accessed.
        </t>
      <t hangText='Security considerations:'>
        <vspace blankLines='0' />
        The content may contain signed data, so any transfer
        encoding MUST BE exactly reversed before the content is
        processed.
        <vspace blankLines='1' />
        See also the security considerations for email messages
        (RFC 2822 <xref target='RFC2822' />).
        </t>
      <t hangText='Interoperability considerations:'>
        <vspace blankLines='0' />
        This content format is intended to be used to exchange
        possibly-secured messages between different instant
        messaging protocols. Very strict adherence to the message
        format (including whitespace usage) may be needed to
        achieve interoperability.
        </t>
      <t hangText='Published specification:'>RFC &rfc.number;
        </t>
      <t hangText='Applications which use this media type:'>
        Instant messaging
        </t>
      <t hangText='Additional information:'>
        <vspace blankLines='0' />
        The default namespace URI associated with this content-type
        is 'urn:ietf:params:cpim-headers:'.
        (See RFC &rfc.number; for further details.)
        <vspace blankLines='1' />
        See also the Common Profile for Instant Messaging (CPIM) 
        <xref target='I-D.ietf-impp-im' />.
        </t>
      <t hangText='Person & email address to contact for further information:'>
        <vspace blankLines='0' />
        G. Klyne, &lt;GK-IETF@ninebynine.org&gt;
        </t>
      <t hangText='Intended usage:'>
        LIMITED USE
        </t>
      <t hangText='Author/Change controller:'>
        IETF
        </t>
      </list>
    </t>

  </section>

  <section anchor='sec-urn-ietf-param' 
           title='Registration for urn:ietf:params:cpim-headers'>

  <t>
    <list style='hanging'>
      <t hangText='Registry name:'>
        cpim-headers
        </t>
      <t hangText='Specification:'>
        <vspace blankLines='0' />
        RFC &rfc.number;.
        Additional values may be defined by standards track 
        RFCs that update or obsolete RFC &rfc.number;.
        </t>
      <t hangText='Repository:'>
        <vspace blankLines='0' />
        http://www.iana.org/assignments/params/YYYY 
        [[[to be defined]]]
        </t>
      <t hangText='Index value:'>
        <vspace blankLines='0' />
        The index value is a CPIM message header name,
        which may consist of a sequence from a restricted set
        of US-ASCII characters, as defined above.
        </t>
      <t hangText='URN Formation:'>
        <vspace blankLines='0' />
        The URI for a header is formed from its name by:
        <list style='hanging'>
          <t hangText='a)'>
            replacing any non-URN characters (as defined by RFC
            2141 <xref target='RFC2141' />) with the corresponding '%hh' 
            escape sequence (per RFC 2396 <xref target='RFC2396' />);
            and 
            </t>
          <t hangText='b)'>
            prepending the resulting string with 
            'urn:ietf:params:cpim-headers:'.
            </t>
          </list>
        Thus, the URI corresponding to the CPIM message header
        'From:' would be 'urn:ietf:params:cpim-headers:From'.
        The URI corresponding to the (putative) CPIM message 
        header 'Top&amp;Tail' would be 
        'urn:ietf:params:cpim-headers:Top%26Tail'.
        </t>
      </list>
    </t>

  </section>

</section>


<section anchor='sec-Internationalization-cons' 
         title='Internationalization Considerations'>

<t>Message headers use UTF-8 character encoding throughout; 
  hence, they can convey the full UCS-4 
  (Unicode <xref target="ref-Unicode" />, 
  ISO/IEC 10646 <xref target="ISO.10646-1.1993" />)
  character repertoire.
  </t>

<t>Language tagging is provided for message headers using the 
  "Language" parameter.
  </t>

<t>Message content is any MIME-encapsulated content, 
  and normal MIME content internationalization considerations
  apply.
  </t>

</section>


<section anchor='sec-Security-cons' title='Security Considerations'>

<t>The Message/CPIM format is designed with security in mind.
  In particular it is designed to be used with MIME security
  multiparts for signatures and encryption.  To this end,
  Message/CPIM messages must be considered immutable once
  created.
  </t>

<t>Because Message/CPIM messages are binary messages (due to
  UTF-8 encoding), if they are transmitted across 
  non-8-bit-clean transports then the transfer agent must tunnel the
  entire message. Changing the message data encoding is not an option.
  This implies that the Message/CPIM must be encapsulated by the 
  message transfer system and unencapsulated at the receiving end of 
  the tunnel.
  </t>

<t>The resulting message must not have data loss due to the
  encoding and unencoding of the message.  For example, an
  application may choose to apply the MIME base64 
  content-transfer-encoding to the Message/CPIM object 
  to meet this requirement.
  </t>

</section>

<section anchor='sec-Acknowledgements' title='Acknowledgements'>

<t>The authors thank the following for their helpful comments:
  Harald Alvestrand, Walter Houser, Leslie Daigle, Mark Day,
  Brian Raymor. 
  </t>

</section>

</middle>

<back>

<references title='Normative References'>

<?rfc include="reference.RFC.2026.xml"?>
<?rfc include="reference.RFC.2045.xml"?>
<?rfc include="reference.RFC.2046.xml"?>
<?rfc include="reference.RFC.2048.xml"?>
<?rfc include="reference.RFC.2119.xml"?>
<?rfc include="reference.RFC.2141.xml"?>
<?rfc include="reference.RFC.2234.xml"?>
<?rfc include="reference.RFC.2277.xml"?>
<?rfc include="reference.RFC.2396.xml"?>
<?rfc include="reference.RFC.2822.xml"?>
<?rfc include="reference.RFC.3066.xml"?>
<?rfc include="reference.RFC.3339.xml"?>
<?rfc include="reference.RFC.3553.xml"?>
<?rfc include="reference.RFC.3629.xml"?>

</references>

<references title='Informative References'>

<?rfc include="reference.RFC.1847.xml"?>
<?rfc include="reference.RFC.2130.xml"?>
<?rfc include="reference.RFC.2231.xml"?>
<?rfc include="reference.RFC.2440.xml"?>  <!-- openPGP msg fmt -->
<?rfc include="reference.RFC.2616.xml"?>
<?rfc include="reference.RFC.2633.xml"?>  <!-- S/MIME v3 CMS -->
<?rfc include="reference.RFC.2779.xml"?>
<!-- Charset registration:
<?rfc include="reference.RFC.2978.xml"?>  
-->
<?rfc include="reference.RFC.3261.xml"?>  
<?rfc include="reference.W3C.xml.xml"?>
<?rfc include="reference.W3C.xml-names.xml"?>
<?rfc include="reference.ISO.8601.1988.xml"?>
<?rfc include="reference.ISO.10646-1.1993.xml"?>
<?rfc include="reference.I-D.ietf-impp-im.xml"?>
<?rfc include="reference.I-D.ietf-impp-pres.xml"?>
<?rfc include="reference.I-D.iab-secmech.xml"?>
<?rfc include="reference.I-D.iab-auth-mech.xml"?>

  <reference anchor="ref-Unicode" 
             target="http://www.unicode.org/unicode/standard/versions/enumeratedversions.html#Unicode_4_0_0">
    <front>
      <title>The Unicode Standard, Version 4.0</title>
      <author>
        <organization>The Unicode Consortium</organization>
      </author>
      <date month="April" year="2003"/>
    </front>
    <seriesInfo name="Addison-Wesley, Boston, MA." value="ISBN 0-321-18578-1"/>
  </reference>

</references>

<section title="Revision history">

  <t>[[[RFC editor:  please remove this section on final publication]]]</t>

  <t>
    <list style='hanging'>
      <t hangText='09b 21-Nov-2003'>
        Fold in changes from diff file provided by RFC Editor.
        Add (informative) references for Unicode and ISO/IEC 10646.
        Fix up text of note about the 'Required' header.
        Add forward reference in <xref target='sec-Message-headers' />
        to header name syntax sections.
        Updated citations of RFC 2279 to RFC 3629.
        Removed reference to RFC 2278.
        Added citation of ISO8601 in description of DateTime header.
        Added some ?RFC needLines...? directives to avoid break-up of
        examples, etc.
        </t>
      <t hangText='09a 28-Oct-2003'>
        Document source converted to XML2RFC format;  
        this has a number of effects on layout.
        References renumbered due to the change to XML2RFC.
        Changed reference to RFC 3553 (IETF URN Sub-namespace 
        for Registered Protocol Parameters).
        Reference current work-in-progress draft-ietf-impp-im 
        rather than the very much older draft-ietf-impp-cpim.
        Add reference to draft-ietf-impp-pres.
        Add normative reference to RFC2026.
        Added note that applications must define appropriate
        mechanisms as required to secure message content.
        Changed syntax to use DQUOTE rather than &lt;"&gt;.
        Add additional warning about case sensitive use of ABNF.
        Add some comments emphasizing that security details need
        to be part of the application design.
        Add some security-related informative references.
        Editorial rework of overall message structure description
        at start of section 2.
        </t>
      <t hangText='08a 09-Jan-2003'>
        Change author affiliation and email details. Update
        document and expiry dates, for re-realease of I-D post-
        last-call. 
        Separate normative and informative references.
        </t>
      <t hangText='07b 16-Oct-2002'>
        Change author affiliation details.
        Update document and expiry dates, for re-realease of I-D.
        Update date-time reference to RFC3339.
        </t>
      <t hangText='07a 28-Aug-2002'>
        Fix description of 'require' header in section 4.7.
        </t>
      <t hangText='06a 20-Feb-2002'>
        Fix definition in section 3.6 of NAMECHAR characters to
        include apostrophe 0x27 (following RFC 2822). Fix error in
        sect 3.1 definition of SEPARATORS.
        </t>
      <t hangText='05b 31-Dec-2001'>
        Various editorial changes in response to last-call
        comments: more consistent reference to RFC2822/MIME
        message format; slightly expanded comment on problems with
        X-headers; softened wording about use of Java escape
        mechanism to make it clearer that Java is not a normative
        reference here; revised phrasing of first paragraph of
        section 3; correct other typos.
        </t>
      <t hangText='05a 06-Nov-2001'>
        Fix typos.
        Complete change of 'Date:' header to 'DateTime:'.
        Updated author affiliations.
        Fix up multipart/signed example.
        </t>
      <t hangText='04a 05-Nov-2001'>
        Add registration templates for Message/CPIM content type,
        and urn:ietf:params:cpim-headers: URN space. 
        Update namespace identifier.
        Revised application design considerations to indicate that
        a default namespace URI and any implicit prefixes are to
        be specified by the MIME media type specification. 
        Noted variation of ABNF usage from RFC 2234 (exact case
        only). Add reference to URN syntax (RFC 2141).
        </t>
      <t hangText='03a 13-Jun-2001'>
        Tighten up application of escape sequences.
        </t>
      <t hangText='02a 30-May-2001'>
        Updated reference to date/time draft.  Editorial changes.
        </t>
      <t hangText='01b 30-Mar-2001'>
        State explicitly that unrecognized header names 
        should be ignored.  Remove text about 
        (non)significance of header order:  simply say 
        that order must be preserved.
        </t>
      <t hangText='01a 29-Mar-2001'>
        Incorporate review comments.  State (simply) that 
        this is a canonical end-to-end format for the 
        purpose of signature calculation.  Defined escape 
        mechanism for control characters.  Header name 
        parameters placed after the ":".  Changed name of 
        Date: header to DateTime:.  Revised syntax to 
        separate character-level syntax from UTF-8 octet-
        level syntax.
        </t>
      <t hangText='00c 07-Feb-2001'>
        Folded in some review comments.  Fix up some 
        syntax problems.  Other small editorial changes.  
        Add some references.
        </t>
      <t hangText='00b 06-Feb-2001'>
        Editorial review.  Reworked namespace framework 
        description.  Deferred specification of mandatory 
        headers to the application specification, allowing 
        this document to be less application-dependent.  
        Expanded references.  Replaced some text with ABNF 
        syntax descriptions.  Reordered some major 
        sections.
        </t>
      <t hangText='00a 01-Feb-2001'>
        Memo initially created.
        </t>
      </list>
    </t>

</section>

<section title="TODO">

  <t>[[[RFC editor:  please remove this section on final publication]]]</t>

  <t>
    <list style='symbols'>
      <t>Update references to other CPIM documents
        <xref target="I-D.ietf-impp-im"/>
        <xref target='I-D.ietf-impp-pres' />.
        </t>
      <t>Remove revision history and TODO list
        </t>
      <t>Finalize RFC number and attributes on &lt;rfc ... &gt; element.
        </t>
      <t>Replace XXXX, YYYY with appropriate values.
        </t>
      <t>Finalize location of repository for members of urn:ietf:params:cpim-headers 
        sub-namespace.
        </t>
      <t>Finalize publication date.
        </t>
      </list>
    </t>

</section>

</back>

</rfc>
