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