summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libmailbox.tex
blob: 082c061d6073773f4b3f2314f4d166cc2910bb47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
\section{\module{mailbox} ---
         Read various mailbox formats}

\declaremodule{standard}{mailbox}
\modulesynopsis{Read various mailbox formats.}


This module defines a number of classes that allow easy and uniform
access to mail messages in a (\UNIX{}) mailbox.

\begin{classdesc}{UnixMailbox}{fp}
Access a classic \UNIX{}-style mailbox, where all messages are contained
in a single file and separated by ``From name time'' lines.
The file object \var{fp} points to the mailbox file.
\end{classdesc}

\begin{classdesc}{MmdfMailbox}{fp}
Access an MMDF-style mailbox, where all messages are contained
in a single file and separated by lines consisting of 4 control-A
characters.  The file object \var{fp} points to the mailbox file.
\end{classdesc}

\begin{classdesc}{MHMailbox}{dirname}
Access an MH mailbox, a directory with each message in a separate
file with a numeric name.
The name of the mailbox directory is passed in \var{dirname}.
\end{classdesc}

\begin{classdesc}{Maildir}{dirname}
Access a Qmail mail directory.  All new and current mail for the
mailbox specified by \var{dirname} is made available.
\end{classdesc}

\begin{classdesc}{BabylMailbox}{fp}
Access a Babyl mailbox, which is similar to an MMDF mailbox.  Mail
messages start with a line containing only \code{'*** EOOH ***'} and
end with a line containing only \code{'\e{}037\e{}014'}.
\end{classdesc}


\subsection{Mailbox Objects \label{mailbox-objects}}

All implementations of Mailbox objects have one externally visible
method:

\begin{methoddesc}[mailbox]{next}{}
Return the next message in the mailbox, as a \class{rfc822.Message}
object (see the \refmodule{rfc822} module).  Depending on the mailbox
implementation the \var{fp} attribute of this object may be a true
file object or a class instance simulating a file object, taking care
of things like message boundaries if multiple mail messages are
contained in a single file, etc.  If no more messages are available,
this method returns \code{None}.
\end{methoddesc}