blob: 8110291fdc9d5ad98f19d88171d5ea2eeb12a88a [file] [log] [blame]
Fred Drake295da241998-08-10 19:42:37 +00001\section{\module{mailbox} ---
2 Read various mailbox formats.}
Fred Drakeb91e9341998-07-23 17:59:49 +00003\declaremodule{standard}{mailbox}
4
5\modulesynopsis{Read various mailbox formats.}
6
Guido van Rossum39a23cc1997-06-02 21:04:41 +00007
Guido van Rossum39a23cc1997-06-02 21:04:41 +00008
9This module defines a number of classes that allow easy and uniform
Fred Drake2e495c91998-03-14 06:48:33 +000010access to mail messages in a (\UNIX{}) mailbox.
Guido van Rossum39a23cc1997-06-02 21:04:41 +000011
Fred Drake2e495c91998-03-14 06:48:33 +000012\begin{classdesc}{UnixMailbox}{fp}
Fred Drakec9dc5151998-01-13 19:01:57 +000013Access a classic \UNIX{}-style mailbox, where all messages are contained
Fred Drake6e99adb1998-02-13 22:17:21 +000014in a single file and separated by ``From name time'' lines.
15The file object \var{fp} points to the mailbox file.
Fred Drake2e495c91998-03-14 06:48:33 +000016\end{classdesc}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000017
Fred Drake2e495c91998-03-14 06:48:33 +000018\begin{classdesc}{MmdfMailbox}{fp}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000019Access an MMDF-style mailbox, where all messages are contained
20in a single file and separated by lines consisting of 4 control-A
Fred Drake6e99adb1998-02-13 22:17:21 +000021characters. The file object \var{fp} points to the mailbox file.
Fred Drake2e495c91998-03-14 06:48:33 +000022\end{classdesc}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000023
Fred Drake2e495c91998-03-14 06:48:33 +000024\begin{classdesc}{MHMailbox}{dirname}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000025Access an MH mailbox, a directory with each message in a separate
Fred Drake6e99adb1998-02-13 22:17:21 +000026file with a numeric name.
27The name of the mailbox directory is passed in \var{dirname}.
Fred Drake2e495c91998-03-14 06:48:33 +000028\end{classdesc}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000029
30\subsection{Mailbox Objects}
Fred Drake2e495c91998-03-14 06:48:33 +000031\label{mailbox-objects}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000032
33All implementations of Mailbox objects have one externally visible
34method:
35
Fred Drake182bd2d1998-04-02 18:50:21 +000036\begin{methoddesc}[mailbox]{next}{}
Fred Drake2e495c91998-03-14 06:48:33 +000037Return the next message in the mailbox, as a \class{rfc822.Message} object.
Guido van Rossum39a23cc1997-06-02 21:04:41 +000038Depending on the mailbox implementation the \var{fp} attribute of this
Guido van Rossume229d861997-08-18 15:14:26 +000039object may be a true file object or a class instance simulating a file object,
40taking care of things like message boundaries if multiple mail messages are
Guido van Rossum39a23cc1997-06-02 21:04:41 +000041contained in a single file, etc.
Fred Drake182bd2d1998-04-02 18:50:21 +000042\end{methoddesc}