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

Skip to content

Commit 5ac9795

Browse files
Corrections and additions to the documentation for POP3 and IMAP library
support, based on my fetchmail experience.
1 parent eec72a7 commit 5ac9795

2 files changed

Lines changed: 31 additions & 9 deletions

File tree

Doc/lib/libimaplib.tex

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ \section{\module{imaplib} ---
88

99
% Based on HTML documentation by Piers Lauder <[email protected]>;
1010
% converted by Fred L. Drake, Jr. <[email protected]>.
11+
% Revised by ESR, January 2000.
1112

1213
\indexii{IMAP4}{protocol}
1314

1415
This module defines a class, \class{IMAP4}, which encapsulates a
15-
connection to an IMAP4 server and implements the IMAP4rev1 client
16-
protocol as defined in \rfc{2060}. It is backward compatible with
17-
IMAP4 (\rfc{1730}) servers, but note that the \samp{STATUS} command is
18-
not supported in IMAP4.
16+
connection to an IMAP4 server and implements a large subset of the
17+
IMAP4rev1 client protocol as defined in \rfc{2060}. It is backward
18+
compatible with IMAP4 (\rfc{1730}) servers, but note that the
19+
\samp{STATUS} command is not supported in IMAP4.
1920

2021
A single class is provided by the \module{imaplib} module:
2122

@@ -71,8 +72,10 @@ \section{\module{imaplib} ---
7172
\end{funcdesc}
7273

7374

74-
Note that IMAP4 message numbers change as the mailbox changes, so it
75-
is highly advisable to use UIDs instead, with the UID command.
75+
Note that IMAP4 message numbers change as the mailbox changes; in
76+
particular, after an \samp{EXPUNGE} command performs deletions the
77+
remaining messages are renumbered. So it is highly advisable to use
78+
UIDs instead, with the UID command.
7679

7780
At the end of the module, there is a test section that contains a more
7881
extensive example of usage.

Doc/lib/libpoplib.tex

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ \section{\module{poplib} ---
88
%Even though I put it into LaTeX, I cannot really claim that I wrote
99
%it since I just stole most of it from the poplib.py source code and
1010
%the imaplib ``chapter''.
11+
%Revised by ESR, January 2000
1112

1213
\indexii{POP3}{protocol}
1314

@@ -16,6 +17,12 @@ \section{\module{poplib} ---
1617
\rfc{1725}. The \class{POP3} class supports both the minimal and
1718
optional command sets.
1819

20+
Note that POP3, though widely supported, is obsolescent. The
21+
implementation quality of POP3 servers varies widely, and too many are
22+
quite poor. If your mailserver supports IMAP, you would be better off
23+
using the \refmodule{IMAP} class, as IMAP servers tend to be better
24+
implemented.
25+
1926
A single class is provided by the \module{poplib} module:
2027

2128
\begin{classdesc}{POP3}{host\optional{, port}}
@@ -75,12 +82,15 @@ \subsection{POP3 Objects \label{pop3-objects}}
7582
\end{methoddesc}
7683

7784
\begin{methoddesc}{retr}{which}
78-
Retrieve whole message number \var{which}. Result is in form
79-
\code{(\var{response}, ['line', ...], \var{octets})}.
85+
Retrieve whole message number \var{which}, and set its seen flag.
86+
Result is in form \code{(\var{response}, ['line', ...], \var{octets})}.
8087
\end{methoddesc}
8188

8289
\begin{methoddesc}{dele}{which}
83-
Delete message number \var{which}.
90+
Flag message number \var{which} for deletion. On most servers
91+
deletions are not actually performed until QUIT (the major exception is
92+
Eudora QPOP, which deliberately violates the RFCs by doing pending
93+
deletes on any disconnect).
8494
\end{methoddesc}
8595

8696
\begin{methoddesc}{rset}{}
@@ -99,6 +109,12 @@ \subsection{POP3 Objects \label{pop3-objects}}
99109
Retrieves the message header plus \var{howmuch} lines of the message
100110
after the header of message number \var{which}. Result is in form
101111
\code{(\var{response}, ['line', ...], \var{octets})}.
112+
113+
The POP3 TOP command this method uses, unlike the RETR command,
114+
doesn't set the message's seen flag; unfortunately, TOP is poorly
115+
specified in the RFCs and is frequently broken in off-brand servers.
116+
Test this method by hand against the POP3 servers you will use before
117+
trusting it.
102118
\end{methoddesc}
103119

104120
\begin{methoddesc}{uidl}{\optional{which}}
@@ -109,6 +125,9 @@ \subsection{POP3 Objects \label{pop3-objects}}
109125
\var{octets})}.
110126
\end{methoddesc}
111127

128+
\begin{seealso}
129+
\seemodule{imap}{The standard Python IMAP module.}
130+
\end{seealso}
112131

113132
\subsection{POP3 Example \label{pop3-example}}
114133

0 commit comments

Comments
 (0)