<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"/> <title>Reading message attributes</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 A. Simple Mail Access Protocol, Version 1"/> <link rel="prev" href="smapusingfolders.html" title="Using Folders"/> <link rel="next" href="smapmessagecontents.html" title="Reading message contents"/> <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 attributes</th> </tr> <tr> <td width="20%" align="left" rowspan="1" colspan="1"> <a accesskey="p" href="smapusingfolders.html" shape="rect">Prev</a> </td> <th width="60%" align="center" rowspan="1" colspan="1"> Appendix A. Simple Mail Access Protocol, Version 1</th> <td width="20%" align="right" rowspan="1" colspan="1">  <a accesskey="n" href="smapmessagecontents.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="attributes" shape="rect" name="attributes"> </a>Reading message attributes</h3> </div> </div> </div> <div class="literallayout"> <p><br clear="none"/> C: FETCH 4 6-7 FLAGS SIZE<br clear="none"/> S: * FETCH 4 FLAGS=SEEN,REPLIED SIZE=8341<br clear="none"/> S: * FETCH 6 FLAGS= SIZE=13862<br clear="none"/> S: * FETCH 7 FLAGS=SEEN SIZE=11802<br clear="none"/> S: +OK Ok<br clear="none"/></p> </div> <p><code class="literal">FETCH</code> is a versatile command that retrieves message contents or attributes. <code class="literal">FETCH</code> is followed by whitespace-delimited words that enumerate message numbers whose attributes or contents the server should retrieve. The list of message numbers if followed by the list of attributes (or specific message content) to retrieve. When requesting more than one attribute, and/or attributes from more than one message, the server's response may list the messages and attributes in any order. The server may also list all requested attributes for each message in one <code class="literal">* FETCH</code> reply, or use a separate <code class="literal">* FETCH</code> reply for each attribute. The following response is also a valid reply in the previous example:</p> <div class="literallayout"> <p><br clear="none"/> C: FETCH 4 6-7 FLAGS SIZE<br clear="none"/> S: * FETCH 7 SIZE=11802<br clear="none"/> S: * FETCH 6 SIZE=13862<br clear="none"/> S: * FETCH 4 SIZE=8341<br clear="none"/> S: * FETCH 4 FLAGS=SEEN,REPLIED<br clear="none"/> S: * FETCH 6 FLAGS=<br clear="none"/> S: * FETCH 7 FLAGS=SEEN<br clear="none"/> S: +OK Ok<br clear="none"/></p> </div> <p>The first word in each <code class="literal">* FETCH</code> <a class="link" href="smapsyntax.html#singleline" title="Single line replies" shape="rect">single line reply</a> is the message number, the remaining whitespace-delimited words specify the requested attributes. Each requested attribute is returned as a single, whitespace-delimited word in the <code class="literal">* FETCH</code> reply. For future expansion, both servers and clients should ignore attributes they do not recognize.</p> <p>The following attributes are defined at this time:</p> <div class="variablelist"> <dl> <dt><span class="term"><code class="literal">UID</code></span></dt> <dd> <p>Request the message's unique identifier. The server assigns a unique identifier word to each message in a folder. The client should not attempt to interpret the unique identifier in any way, and treat it as an opaque text string. The only known property of the unique identifier is that no two messages in the same folder will ever have the same unique identifier. Example:</p> <div class="literallayout"> <p><br clear="none"/> C: FETCH 9-10 UID<br clear="none"/> S: * FETCH 9 UID=1043320248/3456<br clear="none"/> S: * FETCH 10 UID=1043320248/3461<br clear="none"/> S: +OK FETCH completed<br clear="none"/></p> </div> </dd> <dt><span class="term"><code class="literal">FLAGS</code></span></dt> <dd> <p>Each message has one or more message state flags. The following flags are currently defined:</p> <div class="variablelist"> <dl> <dt><span class="term"><code class="literal">DELETED</code></span></dt> <dd> <p>This message is marked for deletion.</p> </dd> <dt><span class="term"><code class="literal">REPLIED</code></span></dt> <dd> <p>This message has been replied to.</p> </dd> <dt><span class="term"><code class="literal">SEEN</code></span></dt> <dd> <p>The message's contents were previous read by <code class="literal">FETCH CONTENTS</code> at least once. The server automatically sets this flag after processing a <code class="literal">FETCH CONTENTS</code> command, but it can also be set or cleared manually by the <a class="link" href="store.html" title="Modifying message attributes" shape="rect"><code class="literal">STORE</code> command</a>.</p> </dd> <dt><span class="term"><code class="literal">DRAFT</code></span></dt> <dd> <p>This is a draft message.</p> </dd> <dt><span class="term"><code class="literal">MARKED</code></span></dt> <dd> <p>This messge is “<span class="quote">marked</span>”. “<span class="quote">MARKED</span>” is a generic flag that applications may use for their own purposes. The <a class="link" href="search.html" title="Searching messages" shape="rect"><code class="literal">SEARCH</code> command</a> also uses this flag.</p> </dd> </dl> </div> <p>The server responds to a <code class="literal">* FETCH</code> by returning “<span class="quote">FLAGS=<em class="replaceable"><code>list</code></em></span>”, where <em class="replaceable"><code>list</code></em> is a comma-separated list of flags that are set for this message. A message without any flags set results in an empty <em class="replaceable"><code>list</code></em>, or the absence of the “<span class="quote">FLAGS=<em class="replaceable"><code>list</code></em></span>” response altogether.</p> </dd> <dt><span class="term"><code class="literal">KEYWORDS</code></span></dt> <dd> <p>The <code class="literal">KEYWORDS</code> attribute is available when <code class="literal">KEYWORDS</code> is listed as an SMAP1 capability (see “<span class="quote"><a class="link" href="conn.html" title="SMAP connection negotiation" shape="rect">SMAP connection negotiation</a></span>”). Each message may have one or more arbitrary tags associated with it. The SMAP1 server associates no special meaning to any keyword, except to note that it's there. The SMAP1 client is free to name keywords in any useful manner. The name of each keyword may contain any UTF-8 character except for a comma, or a control character.</p> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <h3 class="title">Note</h3> <p>Certain punctuation characters should be avoided if interoperability with IMAP is desired. IMAP prohibits certain characters from appearing in keywords, namely: spaces, parenthesis, quotes, and the following characters: <span class="keycap"><strong>{</strong></span>, <span class="keycap"><strong>%</strong></span>, <span class="keycap"><strong>*</strong></span>, <span class="keycap"><strong>\</strong></span>, <span class="keycap"><strong>]</strong></span>. Do not use these characters if IMAP interoperability is desired.</p> </div> </dd> <dt><span class="term"><code class="literal">SIZE</code></span></dt> <dd> <p>The server's <code class="literal">* FETCH</code> reply contains “<span class="quote">SIZE=<em class="replaceable"><code>bytecount</code></em></span>”, where <em class="replaceable"><code>bytecount</code></em> gives the estimated size of the message. This may not necessarily be an exact byte count. SMAP servers are permitted to provide a ballpark estimate of the message's size, if an exact byte count is unavailable.</p> </dd> <dt><span class="term"><code class="literal">INTERNALDATE</code></span></dt> <dd> <p>The server's <code class="literal">* FETCH</code> reply contains “<span class="quote">INTERNALDATE=<em class="replaceable"><code>rfcdate</code></em></span>”, where <em class="replaceable"><code>rfcdate</code></em> gives the date and time the message was added to the folder. Note that this is not necessarily the contents of the message's <code class="literal">Date:</code> header. <em class="replaceable"><code>rfcdate</code></em> uses the same <a class="ulink" href="http://www.rfc-editor.org/rfc/rfc2822.txt" target="_top" shape="rect">RFC 2822</a> date/time format as the <code class="literal">Date:</code> header. Example:</p> <div class="literallayout"> <p><br clear="none"/> C: FETCH 4 INTERNALDATE<br clear="none"/> S: * FETCH 4 "INTERNALDATE=Tue, 21 Jan 2003 20:57:48 -0500"<br clear="none"/> S: +OK Ok<br clear="none"/></p> </div> </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="smapusingfolders.html" shape="rect">Prev</a> </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">  <a accesskey="n" href="smapmessagecontents.html" shape="rect">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top" rowspan="1" colspan="1">Using Folders </td> <td width="20%" align="center" rowspan="1" colspan="1"> <a accesskey="h" href="index.html" shape="rect">Home</a> | <a accesskey="t" href="bk01-toc.html" shape="rect">ToC</a></td> <td width="40%" align="right" valign="top" rowspan="1" colspan="1"> Reading message contents</td> </tr> </table> </div> </body> </html>