Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3a1668

Browse files
author
Piers Lauder
committed
apply patch item #416254
1 parent 15e5d53 commit a3a1668

1 file changed

Lines changed: 48 additions & 3 deletions

File tree

Doc/lib/libimaplib.tex

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ \subsection{IMAP4 Objects \label{imap4-objects}}
156156
of message part envelope and data.
157157
\end{methoddesc}
158158

159+
\begin{methoddesc}{getacl}{mailbox}
160+
Get the \samp{ACL}s for \var{mailbox}.
161+
The method is non-standard, but is supported by the \samp{Cyrus} server.
162+
\end{methoddesc}
163+
159164
\begin{methoddesc}{list}{\optional{directory\optional{, pattern}}}
160165
List mailbox names in \var{directory} matching
161166
\var{pattern}. \var{directory} defaults to the top-level mail
@@ -185,6 +190,8 @@ \subsection{IMAP4 Objects \label{imap4-objects}}
185190

186191
\begin{methoddesc}{open}{host, port}
187192
Opens socket to \var{port} at \var{host}.
193+
The connection objects established by this method
194+
will be used in the \code{read}, \code{readline}, and \code{shutdown} methods.
188195
You may override this method.
189196
\end{methoddesc}
190197

@@ -193,6 +200,16 @@ \subsection{IMAP4 Objects \label{imap4-objects}}
193200
Returned data is a tuple of message part envelope and data.
194201
\end{methoddesc}
195202

203+
\begin{methoddesc}{read}{size}
204+
Reads \var{size} bytes from the remote server.
205+
You may override this method.
206+
\end{methoddesc}
207+
208+
\begin{methoddesc}{readline}{}
209+
Reads one line from the remote server.
210+
You may override this method.
211+
\end{methoddesc}
212+
196213
\begin{methoddesc}{recent}{}
197214
Prompt server for an update. Returned data is \code{None} if no new
198215
messages, else value of \samp{RECENT} response.
@@ -233,8 +250,36 @@ \subsection{IMAP4 Objects \label{imap4-objects}}
233250
to the mailbox are not allowed.
234251
\end{methoddesc}
235252

253+
\begin{methoddesc}{setacl}{mailbox, who, what}
254+
Set an \samp{ACL} for \var{mailbox}.
255+
The method is non-standard, but is supported by the \samp{Cyrus} server.
256+
\end{methoddesc}
257+
258+
\begin{methoddesc}{shutdown}{}
259+
Close connection established in \code{open}.
260+
You may override this method.
261+
\end{methoddesc}
262+
236263
\begin{methoddesc}{socket}{}
237-
Returns socket instance used to connect to server.
264+
Returns socket instance used to connect to server.
265+
\end{methoddesc}
266+
267+
\begin{methoddesc}{sort}{sort_criteria, charset, search_criterium\optional{, ...}}
268+
The \code{sort} command is a variant of \code{search} with sorting semantics for
269+
the results. Returned data contains a space
270+
separated list of matching message numbers.
271+
272+
Sort has two arguments before the \var{search_criterium}
273+
argument(s); a parenthesized list of \var{sort_criteria}, and the searching \var{charset}.
274+
Note that unlike \code{search}, the searching \var{charset} argument is mandatory.
275+
There is also a \code{uid sort} command which corresponds to \code{sort} the way
276+
that \code{uid search} corresponds to \code{search}.
277+
The \code{sort} command first searches the mailbox for messages that
278+
match the given searching criteria using the charset argument for
279+
the interpretation of strings in the searching criteria. It then
280+
returns the numbers of matching messages.
281+
282+
This is an \samp{IMAP4rev1} extension command.
238283
\end{methoddesc}
239284

240285
\begin{methoddesc}{status}{mailbox, names}
@@ -287,13 +332,13 @@ \subsection{IMAP4 Example \label{imap4-example}}
287332
mailbox and retrieves and prints all messages:
288333

289334
\begin{verbatim}
290-
import getpass, imaplib, string
335+
import getpass, imaplib
291336
292337
M = imaplib.IMAP4()
293338
M.login(getpass.getuser(), getpass.getpass())
294339
M.select()
295340
typ, data = M.search(None, 'ALL')
296-
for num in string.split(data[0]):
341+
for num in data[0].split():
297342
typ, data = M.fetch(num, '(RFC822)')
298343
print 'Message %s\n%s\n' % (num, data[0][1])
299344
M.logout()

0 commit comments

Comments
 (0)