blob: 4ff2dedb669eb762b9b838ae9db60df8e36c2a38 [file] [log] [blame]
Fred Drake3a0351c1998-04-04 07:23:21 +00001\section{Standard Module \module{mailbox}}
Fred Drakec9dc5151998-01-13 19:01:57 +00002\label{module-mailbox}
Guido van Rossum39a23cc1997-06-02 21:04:41 +00003\stmodindex{mailbox}
4
Guido van Rossum39a23cc1997-06-02 21:04:41 +00005
6This module defines a number of classes that allow easy and uniform
Fred Drake2e495c91998-03-14 06:48:33 +00007access to mail messages in a (\UNIX{}) mailbox.
Guido van Rossum39a23cc1997-06-02 21:04:41 +00008
Fred Drake2e495c91998-03-14 06:48:33 +00009\begin{classdesc}{UnixMailbox}{fp}
Fred Drakec9dc5151998-01-13 19:01:57 +000010Access a classic \UNIX{}-style mailbox, where all messages are contained
Fred Drake6e99adb1998-02-13 22:17:21 +000011in a single file and separated by ``From name time'' lines.
12The file object \var{fp} points to the mailbox file.
Fred Drake2e495c91998-03-14 06:48:33 +000013\end{classdesc}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000014
Fred Drake2e495c91998-03-14 06:48:33 +000015\begin{classdesc}{MmdfMailbox}{fp}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000016Access an MMDF-style mailbox, where all messages are contained
17in a single file and separated by lines consisting of 4 control-A
Fred Drake6e99adb1998-02-13 22:17:21 +000018characters. The file object \var{fp} points to the mailbox file.
Fred Drake2e495c91998-03-14 06:48:33 +000019\end{classdesc}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000020
Fred Drake2e495c91998-03-14 06:48:33 +000021\begin{classdesc}{MHMailbox}{dirname}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000022Access an MH mailbox, a directory with each message in a separate
Fred Drake6e99adb1998-02-13 22:17:21 +000023file with a numeric name.
24The name of the mailbox directory is passed in \var{dirname}.
Fred Drake2e495c91998-03-14 06:48:33 +000025\end{classdesc}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000026
27\subsection{Mailbox Objects}
Fred Drake2e495c91998-03-14 06:48:33 +000028\label{mailbox-objects}
Guido van Rossum39a23cc1997-06-02 21:04:41 +000029
30All implementations of Mailbox objects have one externally visible
31method:
32
Fred Drake182bd2d1998-04-02 18:50:21 +000033\begin{methoddesc}[mailbox]{next}{}
Fred Drake2e495c91998-03-14 06:48:33 +000034Return the next message in the mailbox, as a \class{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.
Fred Drake182bd2d1998-04-02 18:50:21 +000039\end{methoddesc}