diff options
Diffstat (limited to 'Doc/lib/librfc822.tex')
-rw-r--r-- | Doc/lib/librfc822.tex | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/Doc/lib/librfc822.tex b/Doc/lib/librfc822.tex index 6fecced..547923d 100644 --- a/Doc/lib/librfc822.tex +++ b/Doc/lib/librfc822.tex @@ -8,10 +8,11 @@ This module defines a class, \class{Message}, which represents a collection of ``email headers'' as defined by the Internet standard \rfc{822}. It is used in various contexts, usually to read such headers from a file. This module also defines a helper class -\class{AddressList} for parsing \rfc{822} addresses. +\class{AddressList} for parsing \rfc{822} addresses. Please refer to +the RFC for information on the specific syntax of \rfc{822} headers. -Note that there's a separate module to read \UNIX{}, MH, and MMDF -style mailbox files: \refmodule{mailbox}\refstmodindex{mailbox}. +The \refmodule{mailbox}\refstmodindex{mailbox} module provides classes +to read mailboxes produced by various end-user mail programs. \begin{classdesc}{Message}{file\optional{, seekable}} A \class{Message} instance is instantiated with an input object as @@ -61,7 +62,8 @@ however, some mailers don't follow that format as specified, so \code{'Mon, 20 Nov 1995 19:12:08 -0500'}. If it succeeds in parsing the date, \function{parsedate()} returns a 9-tuple that can be passed directly to \function{time.mktime()}; otherwise \code{None} will be -returned. +returned. Note that fields 6, 7, and 8 of the result tuple are not +usable. \end{funcdesc} \begin{funcdesc}{parsedate_tz}{date} @@ -74,7 +76,8 @@ offset is the opposite of the sign of the \code{time.timezone} variable for the same timezone; the latter variable follows the \POSIX{} standard while this module follows \rfc{822}.) If the input string has no timezone, the last element of the tuple returned is -\code{None}. +\code{None}. Note that fields 6, 7, and 8 of the result tuple are not +usable. \end{funcdesc} \begin{funcdesc}{mktime_tz}{tuple} @@ -87,6 +90,12 @@ switch dates. Not enough to worry about for common use. \end{funcdesc} +\begin{seealso} + \seemodule{mailbox}{Classes to read various mailbox formats produced + by end-user mail programs.} +\end{seealso} + + \subsection{Message Objects \label{message-objects}} A \class{Message} instance has the following methods: @@ -180,7 +189,8 @@ continuation lines the named headers contain are also parsed. \begin{methoddesc}{getdate}{name} Retrieve a header using \method{getheader()} and parse it into a 9-tuple -compatible with \function{time.mktime()}. If there is no header matching +compatible with \function{time.mktime()}; note that fields 6, 7, and 8 +are not usable. If there is no header matching \var{name}, or it is unparsable, return \code{None}. Date parsing appears to be a black art, and not all mailers adhere to @@ -193,7 +203,8 @@ function may occasionally yield an incorrect result. Retrieve a header using \method{getheader()} and parse it into a 10-tuple; the first 9 elements will make a tuple compatible with \function{time.mktime()}, and the 10th is a number giving the offset -of the date's timezone from UTC. Similarly to \method{getdate()}, if +of the date's timezone from UTC. Note that fields 6, 7, and 8 +are not usable. Similarly to \method{getdate()}, if there is no header matching \var{name}, or it is unparsable, return \code{None}. \end{methoddesc} |