blob: 42bdfda54129f7a6b7d8522f8e3e85548c59636e [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
5\renewcommand{\indexsubitem}{(in module mailbox)}
6
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
Guido van Rossum39a23cc1997-06-02 21:04:41 +000012in a single file and separated by ``From name time'' lines. \var{Fp}
13is the file object pointing to the mailbox file.
14\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
19characters. \var{Fp}
20is the file object pointing to the mailbox file.
21\end{funcdesc}
22
23\begin{funcdesc}{MHMailbox}{dirname}
24Access an MH mailbox, a directory with each message in a separate
25file with a numeric name. \var{Dirname}
26is the name of the mailbox directory.
27\end{funcdesc}
28
29\subsection{Mailbox Objects}
30
31All implementations of Mailbox objects have one externally visible
32method:
33
34\begin{funcdesc}{next}{}
Guido van Rossume229d861997-08-18 15:14:26 +000035Return the next message in the mailbox, as a \code{rfc822.Message} object.
Guido van Rossum39a23cc1997-06-02 21:04:41 +000036Depending on the mailbox implementation the \var{fp} attribute of this
Guido van Rossume229d861997-08-18 15:14:26 +000037object may be a true file object or a class instance simulating a file object,
38taking care of things like message boundaries if multiple mail messages are
Guido van Rossum39a23cc1997-06-02 21:04:41 +000039contained in a single file, etc.
40\end{funcdesc}
Guido van Rossume229d861997-08-18 15:14:26 +000041