summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libpoplib.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/lib/libpoplib.tex')
-rw-r--r--Doc/lib/libpoplib.tex42
1 files changed, 23 insertions, 19 deletions
diff --git a/Doc/lib/libpoplib.tex b/Doc/lib/libpoplib.tex
index 25570ae..7b2c4a1 100644
--- a/Doc/lib/libpoplib.tex
+++ b/Doc/lib/libpoplib.tex
@@ -23,15 +23,18 @@ servers that use SSL as an underlying protocol layer.
Note that POP3, though widely supported, is obsolescent. The
implementation quality of POP3 servers varies widely, and too many are
quite poor. If your mailserver supports IMAP, you would be better off
-using the \code{\refmodule{imaplib}.\class{IMAP4}} class, as IMAP
+using the \class{\refmodule{imaplib}.IMAP4} class, as IMAP
servers tend to be better implemented.
A single class is provided by the \module{poplib} module:
-\begin{classdesc}{POP3}{host\optional{, port}}
+\begin{classdesc}{POP3}{host\optional{, port\optional{, timeout}}}
This class implements the actual POP3 protocol. The connection is
created when the instance is initialized.
If \var{port} is omitted, the standard POP3 port (110) is used.
+The optional \var{timeout} parameter specifies a timeout in seconds for the
+connection attempt (if not specified, or passed as None, the global default
+timeout setting will be used).
\end{classdesc}
\begin{classdesc}{POP3_SSL}{host\optional{, port\optional{, keyfile\optional{, certfile}}}}
@@ -47,8 +50,9 @@ certificate chain file for the SSL connection.
One exception is defined as an attribute of the \module{poplib} module:
\begin{excdesc}{error_proto}
-Exception raised on any errors. The reason for the exception is
-passed to the constructor as a string.
+Exception raised on any errors from this module (errors from
+\module{socket} module are not caught). The reason for the exception
+is passed to the constructor as a string.
\end{excdesc}
\begin{seealso}
@@ -70,7 +74,7 @@ in lower-case; most return the response text sent by the server.
An \class{POP3} instance has the following methods:
-\begin{methoddesc}{set_debuglevel}{level}
+\begin{methoddesc}[POP3]{set_debuglevel}{level}
Set the instance's debugging level. This controls the amount of
debugging output printed. The default, \code{0}, produces no
debugging output. A value of \code{1} produces a moderate amount of
@@ -79,64 +83,64 @@ debugging output, generally a single line per request. A value of
logging each line sent and received on the control connection.
\end{methoddesc}
-\begin{methoddesc}{getwelcome}{}
+\begin{methoddesc}[POP3]{getwelcome}{}
Returns the greeting string sent by the POP3 server.
\end{methoddesc}
-\begin{methoddesc}{user}{username}
+\begin{methoddesc}[POP3]{user}{username}
Send user command, response should indicate that a password is required.
\end{methoddesc}
-\begin{methoddesc}{pass_}{password}
+\begin{methoddesc}[POP3]{pass_}{password}
Send password, response includes message count and mailbox size.
Note: the mailbox on the server is locked until \method{quit()} is
called.
\end{methoddesc}
-\begin{methoddesc}{apop}{user, secret}
+\begin{methoddesc}[POP3]{apop}{user, secret}
Use the more secure APOP authentication to log into the POP3 server.
\end{methoddesc}
-\begin{methoddesc}{rpop}{user}
+\begin{methoddesc}[POP3]{rpop}{user}
Use RPOP authentication (similar to UNIX r-commands) to log into POP3 server.
\end{methoddesc}
-\begin{methoddesc}{stat}{}
+\begin{methoddesc}[POP3]{stat}{}
Get mailbox status. The result is a tuple of 2 integers:
\code{(\var{message count}, \var{mailbox size})}.
\end{methoddesc}
-\begin{methoddesc}{list}{\optional{which}}
+\begin{methoddesc}[POP3]{list}{\optional{which}}
Request message list, result is in the form
\code{(\var{response}, ['mesg_num octets', ...], \var{octets})}.
If \var{which} is set, it is the message to list.
\end{methoddesc}
-\begin{methoddesc}{retr}{which}
+\begin{methoddesc}[POP3]{retr}{which}
Retrieve whole message number \var{which}, and set its seen flag.
Result is in form \code{(\var{response}, ['line', ...], \var{octets})}.
\end{methoddesc}
-\begin{methoddesc}{dele}{which}
+\begin{methoddesc}[POP3]{dele}{which}
Flag message number \var{which} for deletion. On most servers
deletions are not actually performed until QUIT (the major exception is
Eudora QPOP, which deliberately violates the RFCs by doing pending
deletes on any disconnect).
\end{methoddesc}
-\begin{methoddesc}{rset}{}
+\begin{methoddesc}[POP3]{rset}{}
Remove any deletion marks for the mailbox.
\end{methoddesc}
-\begin{methoddesc}{noop}{}
+\begin{methoddesc}[POP3]{noop}{}
Do nothing. Might be used as a keep-alive.
\end{methoddesc}
-\begin{methoddesc}{quit}{}
+\begin{methoddesc}[POP3]{quit}{}
Signoff: commit changes, unlock mailbox, drop connection.
\end{methoddesc}
-\begin{methoddesc}{top}{which, howmuch}
+\begin{methoddesc}[POP3]{top}{which, howmuch}
Retrieves the message header plus \var{howmuch} lines of the message
after the header of message number \var{which}. Result is in form
\code{(\var{response}, ['line', ...], \var{octets})}.
@@ -148,7 +152,7 @@ Test this method by hand against the POP3 servers you will use before
trusting it.
\end{methoddesc}
-\begin{methoddesc}{uidl}{\optional{which}}
+\begin{methoddesc}[POP3]{uidl}{\optional{which}}
Return message digest (unique id) list.
If \var{which} is specified, result contains the unique id for that
message in the form \code{'\var{response}\ \var{mesgnum}\ \var{uid}},