Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / html / python / lib / imap4-objects.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index' />
<link rel="first" href="lib.html" title='Python Library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="imap4-example.html" />
<link rel="prev" href="module-imaplib.html" />
<link rel="parent" href="module-imaplib.html" />
<link rel="next" href="imap4-example.html" />
<meta name='aesop' content='information' />
<title>11.10.1 IMAP4 Objects </title>
</head>
<body>
<DIV CLASS="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="11.10 imaplib "
href="module-imaplib.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="11.10 imaplib "
href="module-imaplib.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="11.10.2 IMAP4 Example"
href="imap4-example.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-imaplib.html">11.10 imaplib </A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-imaplib.html">11.10 imaplib </A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="imap4-example.html">11.10.2 IMAP4 Example</A>
</div>
<hr /></div>
</DIV>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION00131010000000000000000"></A><A NAME="imap4-objects"></A>
<BR>
11.10.1 IMAP4 Objects
</H2>
<P>
All IMAP4rev1 commands are represented by methods of the same name,
either upper-case or lower-case.
<P>
All arguments to commands are converted to strings, except for
"<tt class="samp">AUTHENTICATE</tt>", and the last argument to "<tt class="samp">APPEND</tt>" which is
passed as an IMAP4 literal. If necessary (the string contains IMAP4
protocol-sensitive characters and isn't enclosed with either
parentheses or double quotes) each string is quoted. However, the
<var>password</var> argument to the "<tt class="samp">LOGIN</tt>" command is always quoted.
If you want to avoid having an argument string quoted
(eg: the <var>flags</var> argument to "<tt class="samp">STORE</tt>") then enclose the string in
parentheses (eg: <code>r'(&#92;Deleted)'</code>).
<P>
Each command returns a tuple: <code>(<var>type</var>, [<var>data</var>,
...])</code> where <var>type</var> is usually <code>'OK'</code> or <code>'NO'</code>,
and <var>data</var> is either the text from the command response, or
mandated results from the command. Each <var>data</var>
is either a string, or a tuple. If a tuple, then the first part
is the header of the response, and the second part contains
the data (ie: 'literal' value).
<P>
The <var>message_set</var> options to commands below is a string specifying one
or more messages to be acted upon. It may be a simple message number
(<code>'1'</code>), a range of message numbers (<code>'2:4'</code>), or a group of
non-contiguous ranges separated by commas (<code>'1:3,6:9'</code>). A range
can contain an asterisk to indicate an infinite upper bound
(<code>'3:*'</code>).
<P>
An <tt class="class">IMAP4</tt> instance has the following methods:
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3405' xml:id='l2h-3405' class="method">append</tt></b>(</nobr></td>
<td><var>mailbox, flags, date_time, message</var>)</td></tr></table></dt>
<dd>
Append <var>message</var> to named mailbox.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3406' xml:id='l2h-3406' class="method">authenticate</tt></b>(</nobr></td>
<td><var>mechanism, authobject</var>)</td></tr></table></dt>
<dd>
Authenticate command -- requires response processing.
<P>
<var>mechanism</var> specifies which authentication mechanism is to be
used - it should appear in the instance variable <code>capabilities</code>
in the form <code>AUTH=mechanism</code>.
<P>
<var>authobject</var> must be a callable object:
<P>
<div class="verbatim"><pre>
data = authobject(response)
</pre></div>
<P>
It will be called to process server continuation responses.
It should return <code>data</code> that will be encoded and sent to server.
It should return <code>None</code> if the client abort response "<tt class="samp">*</tt>" should
be sent instead.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3407' xml:id='l2h-3407' class="method">check</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Checkpoint mailbox on server.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3408' xml:id='l2h-3408' class="method">close</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Close currently selected mailbox. Deleted messages are removed from
writable mailbox. This is the recommended command before
"<tt class="samp">LOGOUT</tt>".
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3409' xml:id='l2h-3409' class="method">copy</tt></b>(</nobr></td>
<td><var>message_set, new_mailbox</var>)</td></tr></table></dt>
<dd>
Copy <var>message_set</var> messages onto end of <var>new_mailbox</var>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3410' xml:id='l2h-3410' class="method">create</tt></b>(</nobr></td>
<td><var>mailbox</var>)</td></tr></table></dt>
<dd>
Create new mailbox named <var>mailbox</var>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3411' xml:id='l2h-3411' class="method">delete</tt></b>(</nobr></td>
<td><var>mailbox</var>)</td></tr></table></dt>
<dd>
Delete old mailbox named <var>mailbox</var>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3412' xml:id='l2h-3412' class="method">deleteacl</tt></b>(</nobr></td>
<td><var>mailbox, who</var>)</td></tr></table></dt>
<dd>
Delete the ACLs (remove any rights) set for who on mailbox.
<span class="versionnote">New in version 2.4.</span>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3413' xml:id='l2h-3413' class="method">expunge</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Permanently remove deleted items from selected mailbox. Generates an
"<tt class="samp">EXPUNGE</tt>" response for each deleted message. Returned data
contains a list of "<tt class="samp">EXPUNGE</tt>" message numbers in order
received.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3414' xml:id='l2h-3414' class="method">fetch</tt></b>(</nobr></td>
<td><var>message_set, message_parts</var>)</td></tr></table></dt>
<dd>
Fetch (parts of) messages. <var>message_parts</var> should be
a string of message part names enclosed within parentheses,
eg: "<tt class="samp">"(UID BODY[TEXT])"</tt>". Returned data are tuples
of message part envelope and data.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3415' xml:id='l2h-3415' class="method">getacl</tt></b>(</nobr></td>
<td><var>mailbox</var>)</td></tr></table></dt>
<dd>
Get the "<tt class="samp">ACL</tt>"s for <var>mailbox</var>.
The method is non-standard, but is supported by the "<tt class="samp">Cyrus</tt>" server.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3416' xml:id='l2h-3416' class="method">getquota</tt></b>(</nobr></td>
<td><var>root</var>)</td></tr></table></dt>
<dd>
Get the "<tt class="samp">quota</tt>" <var>root</var>'s resource usage and limits.
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
<span class="versionnote">New in version 2.3.</span>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3417' xml:id='l2h-3417' class="method">getquotaroot</tt></b>(</nobr></td>
<td><var>mailbox</var>)</td></tr></table></dt>
<dd>
Get the list of "<tt class="samp">quota</tt>" "<tt class="samp">roots</tt>" for the named <var>mailbox</var>.
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
<span class="versionnote">New in version 2.3.</span>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3418' xml:id='l2h-3418' class="method">list</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>directory</var><big>[</big><var>, pattern</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
List mailbox names in <var>directory</var> matching
<var>pattern</var>. <var>directory</var> defaults to the top-level mail
folder, and <var>pattern</var> defaults to match anything. Returned data
contains a list of "<tt class="samp">LIST</tt>" responses.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3419' xml:id='l2h-3419' class="method">login</tt></b>(</nobr></td>
<td><var>user, password</var>)</td></tr></table></dt>
<dd>
Identify the client using a plaintext password.
The <var>password</var> will be quoted.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3420' xml:id='l2h-3420' class="method">login_cram_md5</tt></b>(</nobr></td>
<td><var>user, password</var>)</td></tr></table></dt>
<dd>
Force use of "<tt class="samp">CRAM-MD5</tt>" authentication when identifying the
client to protect the password. Will only work if the server
"<tt class="samp">CAPABILITY</tt>" response includes the phrase "<tt class="samp">AUTH=CRAM-MD5</tt>".
<span class="versionnote">New in version 2.3.</span>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3421' xml:id='l2h-3421' class="method">logout</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Shutdown connection to server. Returns server "<tt class="samp">BYE</tt>" response.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3422' xml:id='l2h-3422' class="method">lsub</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>directory</var><big>[</big><var>, pattern</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
List subscribed mailbox names in directory matching pattern.
<var>directory</var> defaults to the top level directory and
<var>pattern</var> defaults to match any mailbox.
Returned data are tuples of message part envelope and data.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3423' xml:id='l2h-3423' class="method">myrights</tt></b>(</nobr></td>
<td><var>mailbox</var>)</td></tr></table></dt>
<dd>
Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).
<span class="versionnote">New in version 2.4.</span>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3424' xml:id='l2h-3424' class="method">namespace</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns IMAP namespaces as defined in RFC2342.
<span class="versionnote">New in version 2.3.</span>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3425' xml:id='l2h-3425' class="method">noop</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Send "<tt class="samp">NOOP</tt>" to server.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3426' xml:id='l2h-3426' class="method">open</tt></b>(</nobr></td>
<td><var>host, port</var>)</td></tr></table></dt>
<dd>
Opens socket to <var>port</var> at <var>host</var>.
The connection objects established by this method
will be used in the <code>read</code>, <code>readline</code>, <code>send</code>, and
<code>shutdown</code> methods.
You may override this method.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3427' xml:id='l2h-3427' class="method">partial</tt></b>(</nobr></td>
<td><var>message_num, message_part, start, length</var>)</td></tr></table></dt>
<dd>
Fetch truncated part of a message.
Returned data is a tuple of message part envelope and data.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3428' xml:id='l2h-3428' class="method">proxyauth</tt></b>(</nobr></td>
<td><var>user</var>)</td></tr></table></dt>
<dd>
Assume authentication as <var>user</var>.
Allows an authorised administrator to proxy into any user's mailbox.
<span class="versionnote">New in version 2.3.</span>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3429' xml:id='l2h-3429' class="method">read</tt></b>(</nobr></td>
<td><var>size</var>)</td></tr></table></dt>
<dd>
Reads <var>size</var> bytes from the remote server.
You may override this method.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3430' xml:id='l2h-3430' class="method">readline</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Reads one line from the remote server.
You may override this method.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3431' xml:id='l2h-3431' class="method">recent</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Prompt server for an update. Returned data is <code>None</code> if no new
messages, else value of "<tt class="samp">RECENT</tt>" response.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3432' xml:id='l2h-3432' class="method">rename</tt></b>(</nobr></td>
<td><var>oldmailbox, newmailbox</var>)</td></tr></table></dt>
<dd>
Rename mailbox named <var>oldmailbox</var> to <var>newmailbox</var>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3433' xml:id='l2h-3433' class="method">response</tt></b>(</nobr></td>
<td><var>code</var>)</td></tr></table></dt>
<dd>
Return data for response <var>code</var> if received, or
<code>None</code>. Returns the given code, instead of the usual type.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3434' xml:id='l2h-3434' class="method">search</tt></b>(</nobr></td>
<td><var>charset, criterion</var><big>[</big><var>, ...</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Search mailbox for matching messages. <var>charset</var> may be
<code>None</code>, in which case no "<tt class="samp">CHARSET</tt>" will be specified in the
request to the server. The IMAP protocol requires that at least one
criterion be specified; an exception will be raised when the server
returns an error.
<P>
Example:
<P>
<div class="verbatim"><pre>
# M is a connected IMAP4 instance...
typ, msgnums = M.search(None, 'FROM', '"LDJ"')
# or:
typ, msgnums = M.search(None, '(FROM "LDJ")')
</pre></div>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3435' xml:id='l2h-3435' class="method">select</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>mailbox</var><big>[</big><var>, readonly</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Select a mailbox. Returned data is the count of messages in
<var>mailbox</var> ("<tt class="samp">EXISTS</tt>" response). The default <var>mailbox</var>
is <code>'INBOX'</code>. If the <var>readonly</var> flag is set, modifications
to the mailbox are not allowed.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3436' xml:id='l2h-3436' class="method">send</tt></b>(</nobr></td>
<td><var>data</var>)</td></tr></table></dt>
<dd>
Sends <code>data</code> to the remote server.
You may override this method.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3437' xml:id='l2h-3437' class="method">setacl</tt></b>(</nobr></td>
<td><var>mailbox, who, what</var>)</td></tr></table></dt>
<dd>
Set an "<tt class="samp">ACL</tt>" for <var>mailbox</var>.
The method is non-standard, but is supported by the "<tt class="samp">Cyrus</tt>" server.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3438' xml:id='l2h-3438' class="method">setquota</tt></b>(</nobr></td>
<td><var>root, limits</var>)</td></tr></table></dt>
<dd>
Set the "<tt class="samp">quota</tt>" <var>root</var>'s resource <var>limits</var>.
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
<span class="versionnote">New in version 2.3.</span>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3439' xml:id='l2h-3439' class="method">shutdown</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Close connection established in <code>open</code>.
You may override this method.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3440' xml:id='l2h-3440' class="method">socket</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns socket instance used to connect to server.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3441' xml:id='l2h-3441' class="method">sort</tt></b>(</nobr></td>
<td><var>sort_criteria, charset, search_criterion</var><big>[</big><var>, ...</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
The <code>sort</code> command is a variant of <code>search</code> with sorting
semantics for the results. Returned data contains a space separated
list of matching message numbers.
<P>
Sort has two arguments before the <var>search_criterion</var>
argument(s); a parenthesized list of <var>sort_criteria</var>, and the
searching <var>charset</var>. Note that unlike <code>search</code>, the
searching <var>charset</var> argument is mandatory. There is also a
<code>uid sort</code> command which corresponds to <code>sort</code> the way
that <code>uid search</code> corresponds to <code>search</code>. The
<code>sort</code> command first searches the mailbox for messages that
match the given searching criteria using the charset argument for
the interpretation of strings in the searching criteria. It then
returns the numbers of matching messages.
<P>
This is an "<tt class="samp">IMAP4rev1</tt>" extension command.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3442' xml:id='l2h-3442' class="method">status</tt></b>(</nobr></td>
<td><var>mailbox, names</var>)</td></tr></table></dt>
<dd>
Request named status conditions for <var>mailbox</var>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3443' xml:id='l2h-3443' class="method">store</tt></b>(</nobr></td>
<td><var>message_set, command, flag_list</var>)</td></tr></table></dt>
<dd>
Alters flag dispositions for messages in mailbox. <var>command</var> is
specified by section 6.4.6 of <a class="rfc" id='rfcref-90259' xml:id='rfcref-90259'
href="http://www.faqs.org/rfcs/rfc2060.html">RFC 2060</a> as being one of "FLAGS", "+FLAGS",
or "-FLAGS", optionally with a suffix of ".SILENT".
<P>
For example, to set the delete flag on all messages:
<P>
<div class="verbatim"><pre>
typ, data = M.search(None, 'ALL')
for num in data[0].split():
M.store(num, '+FLAGS', '\\Deleted')
M.expunge()
</pre></div>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3444' xml:id='l2h-3444' class="method">subscribe</tt></b>(</nobr></td>
<td><var>mailbox</var>)</td></tr></table></dt>
<dd>
Subscribe to new mailbox.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3445' xml:id='l2h-3445' class="method">thread</tt></b>(</nobr></td>
<td><var>threading_algorithm, charset,
search_criterion</var><big>[</big><var>, ...</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
The <code>thread</code> command is a variant of <code>search</code> with
threading semantics for the results. Returned data contains a space
separated list of thread members.
<P>
Thread members consist of zero or more messages numbers, delimited
by spaces, indicating successive parent and child.
<P>
Thread has two arguments before the <var>search_criterion</var>
argument(s); a <var>threading_algorithm</var>, and the searching
<var>charset</var>. Note that unlike <code>search</code>, the searching
<var>charset</var> argument is mandatory. There is also a <code>uid
thread</code> command which corresponds to <code>thread</code> the way that
<code>uid search</code> corresponds to <code>search</code>. The <code>thread</code>
command first searches the mailbox for messages that match the given
searching criteria using the charset argument for the interpretation
of strings in the searching criteria. It then returns the matching
messages threaded according to the specified threading algorithm.
<P>
This is an "<tt class="samp">IMAP4rev1</tt>" extension command.
<span class="versionnote">New in version 2.4.</span>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3446' xml:id='l2h-3446' class="method">uid</tt></b>(</nobr></td>
<td><var>command, arg</var><big>[</big><var>, ...</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Execute command args with messages identified by UID, rather than
message number. Returns response appropriate to command. At least
one argument must be supplied; if none are provided, the server will
return an error and an exception will be raised.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3447' xml:id='l2h-3447' class="method">unsubscribe</tt></b>(</nobr></td>
<td><var>mailbox</var>)</td></tr></table></dt>
<dd>
Unsubscribe from old mailbox.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3448' xml:id='l2h-3448' class="method">xatom</tt></b>(</nobr></td>
<td><var>name</var><big>[</big><var>, arg</var><big>[</big><var>, ...</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Allow simple extension commands notified by server in
"<tt class="samp">CAPABILITY</tt>" response.
</dl>
<P>
Instances of <tt class="class">IMAP4_SSL</tt> have just one additional method:
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-3449' xml:id='l2h-3449' class="method">ssl</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns SSLObject instance used for the secure connection with the server.
</dl>
<P>
The following attributes are defined on instances of <tt class="class">IMAP4</tt>:
<P>
<dl><dt><b><tt id='l2h-3450' xml:id='l2h-3450' class="member">PROTOCOL_VERSION</tt></b></dt>
<dd>
The most recent supported protocol in the
"<tt class="samp">CAPABILITY</tt>" response from the server.
</dl>
<P>
<dl><dt><b><tt id='l2h-3451' xml:id='l2h-3451' class="member">debug</tt></b></dt>
<dd>
Integer value to control debugging output. The initialize value is
taken from the module variable <code>Debug</code>. Values greater than
three trace each command.
</dl>
<P>
<DIV CLASS="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="11.10 imaplib "
href="module-imaplib.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="11.10 imaplib "
href="module-imaplib.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="11.10.2 IMAP4 Example"
href="imap4-example.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-imaplib.html">11.10 imaplib </A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-imaplib.html">11.10 imaplib </A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="imap4-example.html">11.10.2 IMAP4 Example</A>
</div>
</div>
<hr />
<span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>