blob: 7adcf62a040e45716f70df7c448fe6645e1308b6 [file] [log] [blame]
Guido van Rossum39a23cc1997-06-02 21:04:41 +00001\section{Standard Module \sectcode{mailbox}}
Fred Drakec9dc5151998-01-13 19:01:57 +00002\label{module-mailbox}
Guido van Rossum39a23cc1997-06-02 21:04:41 +00003\stmodindex{mailbox}
4
Fred Drake19479911998-02-13 06:58:54 +00005\setindexsubitem{(in module mailbox)}
Guido van Rossum39a23cc1997-06-02 21:04:41 +00006
7This module defines a number of classes that allow easy and uniform
8access to mail messages in a (unix) mailbox.
9
10\begin{funcdesc}{UnixMailbox}{fp}
Fred Drakec9dc5151998-01-13 19:01:57 +000011Access a classic \UNIX{}-style mailbox, where all messages are contained
Fred Drake6e99adb1998-02-13 22:17:21 +000012in a single file and separated by ``From name time'' lines.
13The file object \var{fp} points to the mailbox file.
Guido van Rossum39a23cc1997-06-02 21:04:41 +000014\end{funcdesc}
15
16\begin{funcdesc}{MmdfMailbox}{fp}
17Access an MMDF-style mailbox, where all messages are contained
18in a single file and separated by lines consisting of 4 control-A
Fred Drake6e99adb1998-02-13 22:17:21 +000019characters. The file object \var{fp} points to the mailbox file.
Guido van Rossum39a23cc1997-06-02 21:04:41 +000020\end{funcdesc}
21
22\begin{funcdesc}{MHMailbox}{dirname}
23Access an MH mailbox, a directory with each message in a separate
Fred Drake6e99adb1998-02-13 22:17:21 +000024file with a numeric name.
25The name of the mailbox directory is passed in \var{dirname}.
Guido van Rossum39a23cc1997-06-02 21:04:41 +000026\end{funcdesc}
27
28\subsection{Mailbox Objects}
29
30All implementations of Mailbox objects have one externally visible
31method:
32
33\begin{funcdesc}{next}{}
Guido van Rossume229d861997-08-18 15:14:26 +000034Return the next message in the mailbox, as a \code{rfc822.Message} object.
Guido van Rossum39a23cc1997-06-02 21:04:41 +000035Depending on the mailbox implementation the \var{fp} attribute of this
Guido van Rossume229d861997-08-18 15:14:26 +000036object may be a true file object or a class instance simulating a file object,
37taking care of things like message boundaries if multiple mail messages are
Guido van Rossum39a23cc1997-06-02 21:04:41 +000038contained in a single file, etc.
39\end{funcdesc}