Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 85dff41758625c26d7c6097135c8f737 > files > 146

cone-doc-0.78-3.fc12.x86_64.rpm

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  
  <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"/>

  <title>Reading message contents</title>
  <link rel="stylesheet" href="manpage.css" type="text/css"/>
  
  <link rel="start" href="index.html" title="Cone: COnsole Newsreader And Emailer"/>
  <link rel="up" href="smap1.html" title="Appendix&#160;A.&#160;Simple Mail Access Protocol, Version 1"/>
  <link rel="prev" href="attributes.html" title="Reading message attributes"/>
  <link rel="next" href="store.html" title="Modifying message attributes"/>
  <link xmlns="" rel="icon" href="icon.gif" type="image/gif"/>
  <meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/>
  <!--

Copyright 2002 - 2007 Double Precision, Inc.  See COPYING for distribution
information.

-->
</head>

<body>
  <div class="navheader">
    <table width="100%" summary="Navigation header">
      <tr>
        <th colspan="3" align="center" rowspan="1">Reading message
        contents</th>
      </tr>

      <tr>
        <td width="20%" align="left" rowspan="1" colspan="1">
        <a accesskey="p" href="attributes.html" shape="rect">Prev</a>&#160;</td>

        <th width="60%" align="center" rowspan="1" colspan="1">
        Appendix&#160;A.&#160;Simple Mail Access Protocol, Version
        1</th>

        <td width="20%" align="right" rowspan="1" colspan="1">
        &#160;<a accesskey="n" href="store.html" shape="rect">Next</a></td>
      </tr>
    </table>
    <hr/>
  </div>

  <div class="section" lang="en" xml:lang="en">
    <div class="titlepage">
      <div>
        <div>
          <h3 class="title"><a id="smapmessagecontents" shape="rect" name="smapmessagecontents"> </a>Reading message
          contents</h3>
        </div>
      </div>
    </div>

    <div class="literallayout">
      <p><br clear="none"/>
      C:&#160;FETCH&#160;1&#160;CONTENTS=BODY<br clear="none"/>
      S:&#160;{.7160}&#160;FETCH&#160;1&#160;CONTENTS<br clear="none"/>
      S:<br clear="none"/>
      S:&#160;Hello,<br clear="none"/>
      S:<br clear="none"/>
      S:&#160;There&#160;will&#160;be&#160;a&#160;meeting&#160;tomorrow.<br clear="none"/>

      S:<br clear="none"/>
      S:<span class="emphasis"><em>...</em></span><br clear="none"/>
      S:<br clear="none"/>
      S:&#160;.<br clear="none"/>
      S:&#160;*&#160;FETCH&#160;1&#160;FLAGS=<br clear="none"/>
      S:&#160;+OK&#160;Ok<br clear="none"/></p>
    </div>

    <p>There are additional <code class="literal">FETCH</code>
    keywords that instruct the server to retrieve the actual
    message contents. These keywords, described in the following
    sections, may be requested at the same time as the attribute
    keywords specified in the previous section. The server will
    respond with both single-line replies that contain the
    attributes, and multi-line replies that contain the requested
    message content. As always, the server may send the individual
    replies in any order.</p>

    <p>The <code class="literal">CONTENTS=</code><em class="replaceable"><code>part</code></em> keyword results in a
    <a class="link" href="smapsyntax.html#singleline" title="Single line replies" shape="rect">multiple line</a> reply from
    the server, returning the requested content, specified by
    <em class="replaceable"><code>part</code></em>. The server may
    use either multiple line format (dot-stuffed, or binary) at its
    discretion. The server may use either the <code class="literal">LF</code> or the <code class="literal">CRLF</code>
    sequence to terminate lines. The server automatically sets the
    <code class="literal">SEEN</code> flag on this message, which
    SHOULD generate an additional single line <code class="literal">* FETCH</code> reply from the server.</p>

    <p>Using <code class="literal">CONTENTS.PEEK</code> instead of
    <code class="literal">CONTENTS</code> does not set the
    <code class="literal">SEEN</code> flag. The following
    documentation refers only to <code class="literal">CONTENTS</code>, but either one may be used; they are
    identical to each other in all ways except for the <code class="literal">SEEN</code> flag.</p>

    <p><em class="replaceable"><code>part</code></em> should be a
    keyword chosen from the following list:</p>

    <div class="variablelist">
      <dl>
        <dt><span class="term"><code class="literal">HEADERS(</code><em class="replaceable"><code>list</code></em><code class="literal">)</code></span></dt>

        <dd>
          <p>Returns only the header portion of the message.
          <em class="replaceable"><code>list</code></em> is a
          comma-separated list of case-insensitive header names.
          The list may be empty, in which case all the headers are
          returned; otherwise only the specified headers are
          returned, if they are present. <em class="replaceable"><code>list</code></em> may also contain the
          following keywords which are a shorthand representation
          for frequently requested headers:</p>

          <div class="variablelist">
            <dl>
              <dt><span class="term"><code class="literal">:ENVELOPE</code></span></dt>

              <dd>
                <p>This is the same as &#8220;<span class="quote">DATE,SUBJECT,FROM,SENDER,REPLY-TO,TO,CC,BCC,IN-REPLY-TO,MESSAGE-ID,REFERENCES</span>&#8221;.</p>
              </dd>

              <dt><span class="term"><code class="literal">:MIME</code></span></dt>

              <dd>
                <p>This is the same as &#8220;<span class="quote">:ENVELOPE</span>&#8221;, plus
                &#8220;<span class="quote">MIME-VERSION</span>&#8221; and all headers
                that start with &#8220;<span class="quote">CONTENT-</span>&#8221;.</p>
              </dd>
            </dl>
          </div>

          <p>In all cases, folded header lines are automatically
          unfolded by the server. All folding newline characters,
          and the leading whitespace on the continuation lines, are
          replaced by a single space character. Example:</p>

          <div class="literallayout">
            <p><br clear="none"/>
            C:&#160;FETCH&#160;1&#160;CONTENTS.PEEK=HEADERS(FROM,MIME-VERSION,CONTENT-TYPE)<br clear="none"/>

            S:&#160;{.300}&#160;FETCH&#160;1&#160;HEADERS<br clear="none"/>
            S:&#160;Mime-Version:&#160;1.0<br clear="none"/>
            S:&#160;Content-Type:&#160;text/plain;&#160;charset=iso-8859-1<br clear="none"/>

            S:&#160;From:&#160;Tom&#160;Jones&#160;&lt;tjones@example.com&gt;<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;+OK&#160;Ok<br clear="none"/></p>
          </div>

          <p>Another example:</p>

          <div class="literallayout">
            <p><br clear="none"/>
            C:&#160;FETCH&#160;1&#160;CONTENTS.PEEK=HEADERS(:ENVELOPE)<br clear="none"/>

            S:&#160;{.300}&#160;FETCH&#160;1&#160;HEADERS<br clear="none"/>
            S:&#160;From:&#160;Tom&#160;Jones&#160;&lt;tjones@example.com&gt;<br clear="none"/>

            S:&#160;To:&#160;Bob&#160;Smith&#160;&lt;bsmith@example.com&gt;<br clear="none"/>

            S:&#160;Subject:&#160;Meeting<br clear="none"/>
            S:&#160;Message-ID:&#160;&lt;802374jekdj90@example.com&gt;<br clear="none"/>

            S:&#160;Date:&#160;Mon,&#160;21&#160;Apr&#160;2002&#160;16:56:11&#160;-0400<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;+OK&#160;Ok<br clear="none"/></p>
          </div>
        </dd>

        <dt><span class="term"><code class="literal">MIME(</code><em class="replaceable"><code>list</code></em><code class="literal">)</code></span></dt>

        <dd>
          <p>Returns the header portion of all MIME sections in the
          message. <em class="replaceable"><code>list</code></em>
          is a comma-separated list of case-insensitive header
          names, as in the <code class="literal">HEADER</code>
          keyword. Example:</p>

          <div class="literallayout">
            <p><br clear="none"/>
            C:&#160;FETCH&#160;1&#160;CONTENTS.PEEK=MIME(MIME-VERSION,CONTENT-TYPE,CONTENT-TRANSFER-ENCODING)<br clear="none"/>

            S:&#160;{.80}&#160;FETCH&#160;1&#160;LINES=207&#160;SIZE=3120&#160;MIME.ID=<br clear="none"/>

            S:&#160;Mime-Version:&#160;1.0<br clear="none"/>
            S:&#160;Content-Type:&#160;multipart/mixed;&#160;boundary="0123456789ABCDEF"<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;{.40}&#160;FETCH&#160;1&#160;LINES=185&#160;SIZE=1012&#160;MIME.ID=1&#160;MIME.PARENT=<br clear="none"/>

            S:&#160;Content-Type:&#160;multipart/alternative;&#160;boundary="ABCDEF0123456789"<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;{.80}&#160;FETCH&#160;1&#160;LINES=81&#160;SIZE=208&#160;"MIME.ID=1&#160;1"&#160;MIME.PARENT=1<br clear="none"/>

            S:&#160;Content-Type:&#160;text/plain;&#160;charset=iso-8859-1<br clear="none"/>

            S:&#160;Content-Transfer-Encoding:&#160;quoted-printable<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;{.80}&#160;FETCH&#160;1&#160;LINES=42&#160;SIZE=783&#160;"MIME.ID=1&#160;2"&#160;MIME.PARENT=1<br clear="none"/>

            S:&#160;Content-Type:&#160;text/html;&#160;charset=iso-8859-1<br clear="none"/>

            S:&#160;Content-Transfer-Encoding:&#160;quoted-printable<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;{.80}&#160;FETCH&#160;1&#160;LINES=50&#160;SIZE=1257&#160;MIME.ID=2&#160;MIME.PARENT=<br clear="none"/>

            S:&#160;Content-Type:&#160;image/gif<br clear="none"/>
            S:&#160;Content-Transfer-Encoding:&#160;base64<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;{.80}&#160;FETCH&#160;1&#160;LINES=45&#160;SIZE=907&#160;MIME.ID=3&#160;MIME.PARENT=<br clear="none"/>

            S:&#160;Content-Type:&#160;message/rfc822<br clear="none"/>
            S:&#160;.<br clear="none"/>
            S:&#160;{.120}&#160;FETCH&#160;1&#160;LINES=27&#160;SIZE=452&#160;"MIME.ID=3&#160;1"&#160;MIME.PARENT=3<br clear="none"/>

            S:&#160;Mime-Version:&#160;1.0<br clear="none"/>
            S:&#160;Content-Type:&#160;text/plain;&#160;charset=iso-8859-1<br clear="none"/>

            S:&#160;Content-Transfer-Encoding:&#160;8bit<br clear="none"/>
            S:&#160;.<br clear="none"/>
            S:&#160;+OK&#160;Ok<br clear="none"/></p>
          </div>

          <p><a class="ulink" href="http://www.rfc-editor.org/rfc/rfc2045.txt" target="_top" shape="rect">RFC 2045</a>, and related documents,
          specifies the format of MIME messages. A MIME message
          contains one or more individual or multipart MIME
          sections; a multipart MIME section itself contains
          inferior individual or multipart sections, forming a
          distinct hierarchy. Consult RFCs 2045 through 2049 for
          additional information.</p>

          <p><code class="literal">MIME(</code><em class="replaceable"><code>list</code></em><code class="literal">)</code> parses the MIME structure of a
          message, and recursively returns the requested headers
          from each MIME section in the message. The server returns
          a series of <a class="link" href="smapsyntax.html#multiline" title="Multiple line replies" shape="rect">multi-line</a> replies, each reply carries
          headers from a single MIME section. The multi-line
          replies may be sent in any order, except that the headers
          for the topmost MIME section must always be sent first,
          and the headers from the other MIME sections may only be
          sent after the headers from their parent MIME section,
          and the headers from all of their preceding sibling MIME
          section (which is just a fancy way of saying that the
          server uses either the prefix or the infix traversal
          order).</p>

          <p>The server assigns a unique &#8220;<span class="quote">MIME section ID</span>&#8221; to each MIME
          section. The method the server uses to generate a MIME
          section ID is entirely up to the server, with one
          exception: the MIME section ID for the entire message
          must be an empty string. SMAP clients should treat MIME
          section ID as opaque text strings, and must not interpret
          them in any way (except for the blank mime ID referring
          to the entire message).</p>

          <p>&#8220;<span class="quote"><code class="literal">MIME.ID=</code><em class="replaceable"><code>id</code></em></span>&#8221;
          specifies the MIME section ID of the following headers.
          &#8220;<span class="quote"><code class="literal">MIME.PARENT=</code><em class="replaceable"><code>id</code></em></span>&#8221;
          specifies the MIME section ID of the parent MIME section
          (this attribute is not specified for the topmost MIME
          section, which has no parent). &#8220;<span class="quote"><code class="literal">MIME.PARENT=</code><em class="replaceable"><code>id</code></em></span>&#8221; is not
          returned for the first, topmost MIME section, and since
          its MIME section ID is always an empty string, its
          inferior MIME section will have &#8220;<span class="quote"><code class="literal">MIME.PARENT=</code></span>&#8221;, the empty
          <em class="replaceable"><code>id</code></em> referring to
          the topmost MIME section.</p>

          <p>The SMAP client uses this information to reconstruct
          the structure of the MIME message.</p>

          <p>The above example shows a MIME <code class="literal">multipart/mixed</code> message with three
          sections. The first section is a MIME <code class="literal">multipart/alternative</code> with two
          subsections: <code class="literal">text/plain</code> and
          <code class="literal">text/html</code>. The second
          section is an <code class="literal">image/gif</code>, and
          the third section is a <code class="literal">message/rfc822</code>.</p>

          <p><code class="literal">message/rfc822</code> MIME
          sections are parsed as multipart sections, with exactly
          one component section: the attached message. The above
          example shows that the attached message consists of a
          single <code class="literal">text/plain</code>
          section.</p>

          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <h3 class="title">Note</h3>

            <p>The <code class="literal">MIME.ID</code>,
            <code class="literal">MIME.PARENT</code>, <code class="literal">SIZE</code> and <code class="literal">LINES</code> values may occur in any order.
            <code class="literal">SIZE</code> gives an estimated
            size of the content portion of the MIME section, and
            <code class="literal">LINES</code> gives the
            approximate number of text lines in the content portion
            of the MIME section. These numbers are not to be taken
            as exact counts, but as ballpark estimates.</p>
          </div>
        </dd>

        <dt><span class="term"><code class="literal">HEADERS[</code><em class="replaceable"><code>id</code></em><code class="literal">](</code><em class="replaceable"><code>list</code></em><code class="literal">)</code></span></dt>

        <dd>
          <p>This is the same as <code class="literal">HEADERS(</code><em class="replaceable"><code>list</code></em><code class="literal">)</code>, except that the server returns
          headers from the MIME section specified by <em class="replaceable"><code>id</code></em>. Example:</p>

          <div class="literallayout">
            <p><br clear="none"/>
            C:&#160;FETCH&#160;1&#160;"CONTENTS.PEEK=HEADERS[1&#160;2](CONTENT-TYPE,CONTENT-TRANSFER-ENCODING)"<br clear="none"/>

            S:&#160;{.80}&#160;FETCH&#160;1&#160;HEADERS<br clear="none"/>
            S:&#160;Content-Type:&#160;text/html;&#160;charset=iso-8859-1<br clear="none"/>

            S:&#160;Content-Transfer-Encoding:&#160;quoted-printable<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;+OK&#160;Ok<br clear="none"/></p>
          </div>
        </dd>

        <dt><span class="term"><code class="literal">BODY</code></span></dt>

        <dd>
          <p>Returns the only the body portion of the message.
          Example:</p>

          <div class="literallayout">
            <p><br clear="none"/>
            C:&#160;FETCH&#160;1&#160;CONTENTS=BODY<br clear="none"/>
            S:&#160;{.80}&#160;FETCH&#160;1&#160;BODY<br clear="none"/>
            S:&#160;Mary&#160;had&#160;a&#160;little&#160;lamb,&#160;its&#160;fleece&#160;was&#160;white&#160;as&#160;snow,<br clear="none"/>

            S:&#160;and&#160;everywhere&#160;Mary&#160;went,&#160;the&#160;lamb&#160;was&#160;sure&#160;to&#160;go.<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;+OK&#160;Ok<br clear="none"/></p>
          </div>
        </dd>

        <dt><span class="term"><code class="literal">BODY[</code><em class="replaceable"><code>id</code></em><code class="literal">]</code></span></dt>

        <dd>
          <p>Returns the only the body portion of the specified
          MIME section. Example:</p>

          <div class="literallayout">
            <p><br clear="none"/>
            C:&#160;FETCH&#160;1&#160;"CONTENTS=BODY[1&#160;1]"<br clear="none"/>

            S:&#160;{.80}&#160;FETCH&#160;1&#160;BODY<br clear="none"/>
            S:&#160;Itsy-bitsy&#160;spider&#160;went&#160;up&#160;the&#160;water&#160;spout,<br clear="none"/>

            S:&#160;Down&#160;came&#160;the&#160;rain,&#160;and&#160;washed&#160;the&#160;spider&#160;out.<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;+OK&#160;Ok<br clear="none"/></p>
          </div>
        </dd>

        <dt><span class="term"><code class="literal">ALL</code></span></dt>

        <dd>
          <p>Returns both the headers and the body portion of the
          message.</p>
        </dd>

        <dt><span class="term"><code class="literal">ALL[</code><em class="replaceable"><code>id</code></em><code class="literal">]</code></span></dt>

        <dd>
          <p>Returns the headers, a blank line, then the body
          portion of the specified MIME section. Example:</p>

          <div class="literallayout">
            <p><br clear="none"/>
            C:&#160;FETCH&#160;1&#160;"CONTENTS=ALL[1&#160;1]"<br clear="none"/>

            S:&#160;{.120}&#160;FETCH&#160;1&#160;ALL<br clear="none"/>
            S:&#160;Content-Type:&#160;text/plain;&#160;charset=iso-8859-1<br clear="none"/>

            S:&#160;Content-Transfer-Encoding:&#160;7bit<br clear="none"/>
            S:<br clear="none"/>
            S:&#160;Itsy-bitsy&#160;spider&#160;went&#160;up&#160;the&#160;water&#160;spout,<br clear="none"/>

            S:&#160;Down&#160;came&#160;the&#160;rain,&#160;and&#160;washed&#160;the&#160;spider&#160;out.<br clear="none"/>

            S:&#160;.<br clear="none"/>
            S:&#160;+OK&#160;Ok<br clear="none"/></p>
          </div>

          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <h3 class="title">Note</h3>

            <p>Unlike <code class="literal">HEADERS</code>, folded
            header lines are not unfolded by <code class="literal">ALL</code>.</p>
          </div>
        </dd>

        <dt><span class="term"><code class="literal">BODY.DECODED</code></span></dt>

        <dd>
          <p>Same as <code class="literal">BODY</code> except that
          the server automatically decodes the MIME-encoded
          section, and sends the raw decoded content as a binary,
          multi-line reply. Example:</p>

          <div class="literallayout">
            <p><br clear="none"/>
            C:&#160;FETCH&#160;1&#160;CONTENTS=BODY.DECODED<br clear="none"/>

            S:&#160;{322/322}&#160;FETCH&#160;1&#160;BODY.DECODED<br clear="none"/>

            S:<br clear="none"/>
            S:&#160;<span class="emphasis"><em>[&#160;322&#160;bytes,&#160;then&#160;a&#160;blank&#160;line,&#160;follows&#160;]</em></span><br clear="none"/>

            S:&#160;+OK&#160;Ok.<br clear="none"/></p>
          </div>
        </dd>

        <dt><span class="term"><code class="literal">BODY.DECODED[</code><em class="replaceable"><code>id</code></em><code class="literal">]</code></span></dt>

        <dd>
          <p>Return the decoded contents of the indicated MIME
          section.</p>
        </dd>
      </dl>
    </div>
  </div>

  <div class="navfooter">
    <hr/>

    <table width="100%" summary="Navigation footer">
      <tr>
        <td width="40%" align="left" rowspan="1" colspan="1">
        <a accesskey="p" href="attributes.html" shape="rect">Prev</a>&#160;</td>

        <td width="20%" align="center" rowspan="1" colspan="1">
        <a accesskey="u" href="smap1.html" shape="rect">Up</a></td>

        <td width="40%" align="right" rowspan="1" colspan="1">
        &#160;<a accesskey="n" href="store.html" shape="rect">Next</a></td>
      </tr>

      <tr>
        <td width="40%" align="left" valign="top" rowspan="1" colspan="1">Reading message attributes&#160;</td>

        <td width="20%" align="center" rowspan="1" colspan="1">
        <a accesskey="h" href="index.html" shape="rect">Home</a>&#160;|&#160;<a accesskey="t" href="bk01-toc.html" shape="rect">ToC</a></td>

        <td width="40%" align="right" valign="top" rowspan="1" colspan="1">&#160;Modifying message attributes</td>
      </tr>
    </table>
  </div>
</body>
</html>