@@ -65,8 +65,21 @@ \section{\module{imaplib} ---
6565\end {funcdesc }
6666
6767
68- \subsection {IMAP4 Objects }
69- \label {imap4-objects }
68+ Note that IMAP4 message numbers change as the mailbox changes, so it
69+ is highly advisable to use UIDs instead, with the UID command.
70+
71+ At the end of the module, there is a test section that contains a more
72+ extensive example of usage.
73+
74+ \begin {seealso }
75+ \seetext {Documents describing the protocol, and sources and binaries
76+ for servers implementing it, can all be found at the University of
77+ Washington's \emph {IMAP Information Center }
78+ (\url {http://www.cac.washington.edu/imap/}).}
79+ \end {seealso }
80+
81+
82+ \subsection {IMAP4 Objects \label {imap4-objects } }
7083
7184All IMAP4rev1 commands are represented by methods of the same name,
7285either upper-case or lower-case.
@@ -212,33 +225,20 @@ \subsection{IMAP4 Objects}
212225\end {memberdesc }
213226
214227
215- \subsection {IMAP4 Example }
216- \label {imap4-example }
228+ \subsection {IMAP4 Example \label {imap4-example } }
217229
218230Here is a minimal example (without error checking) that opens a
219231mailbox and retrieves and prints all messages:
220232
221233\begin {verbatim }
222234import getpass, imaplib, string
235+
223236M = imaplib.IMAP4()
224- M.LOGIN (getpass.getuser(), getpass.getpass())
225- M.SELECT ()
226- typ, data = M.SEARCH (None, 'ALL')
237+ M.login (getpass.getuser(), getpass.getpass())
238+ M.select ()
239+ typ, data = M.search (None, 'ALL')
227240for num in string.split(data[0]):
228- typ, data = M.FETCH (num, '(RFC822)')
241+ typ, data = M.fetch (num, '(RFC822)')
229242 print 'Message %s\n%s\n' % (num, data[0][1])
230- M.LOGOUT ()
243+ M.logout ()
231244\end {verbatim }
232-
233- Note that IMAP4 message numbers change as the mailbox changes, so it
234- is highly advisable to use UIDs instead, with the UID command.
235-
236- At the end of the module, there is a test section that contains a more
237- extensive example of usage.
238-
239- \begin {seealso }
240- \seetext {Documents describing the protocol, and sources and binaries
241- for servers implementing it, can all be found at the University of
242- Washington's \emph {IMAP Information Center }
243- (\url {http://www.cac.washington.edu/imap/}).}
244- \end {seealso }
0 commit comments