Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 1 | \section{Standard Module \sectcode{mailbox}} |
Fred Drake | c9dc515 | 1998-01-13 19:01:57 +0000 | [diff] [blame] | 2 | \label{module-mailbox} |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 3 | \stmodindex{mailbox} |
| 4 | |
| 5 | \renewcommand{\indexsubitem}{(in module mailbox)} |
| 6 | |
| 7 | This module defines a number of classes that allow easy and uniform |
| 8 | access to mail messages in a (unix) mailbox. |
| 9 | |
| 10 | \begin{funcdesc}{UnixMailbox}{fp} |
Fred Drake | c9dc515 | 1998-01-13 19:01:57 +0000 | [diff] [blame] | 11 | Access a classic \UNIX{}-style mailbox, where all messages are contained |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 12 | in a single file and separated by ``From name time'' lines. \var{Fp} |
| 13 | is the file object pointing to the mailbox file. |
| 14 | \end{funcdesc} |
| 15 | |
| 16 | \begin{funcdesc}{MmdfMailbox}{fp} |
| 17 | Access an MMDF-style mailbox, where all messages are contained |
| 18 | in a single file and separated by lines consisting of 4 control-A |
| 19 | characters. \var{Fp} |
| 20 | is the file object pointing to the mailbox file. |
| 21 | \end{funcdesc} |
| 22 | |
| 23 | \begin{funcdesc}{MHMailbox}{dirname} |
| 24 | Access an MH mailbox, a directory with each message in a separate |
| 25 | file with a numeric name. \var{Dirname} |
| 26 | is the name of the mailbox directory. |
| 27 | \end{funcdesc} |
| 28 | |
| 29 | \subsection{Mailbox Objects} |
| 30 | |
| 31 | All implementations of Mailbox objects have one externally visible |
| 32 | method: |
| 33 | |
| 34 | \begin{funcdesc}{next}{} |
Guido van Rossum | e229d86 | 1997-08-18 15:14:26 +0000 | [diff] [blame] | 35 | Return the next message in the mailbox, as a \code{rfc822.Message} object. |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 36 | Depending on the mailbox implementation the \var{fp} attribute of this |
Guido van Rossum | e229d86 | 1997-08-18 15:14:26 +0000 | [diff] [blame] | 37 | object may be a true file object or a class instance simulating a file object, |
| 38 | taking care of things like message boundaries if multiple mail messages are |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 39 | contained in a single file, etc. |
| 40 | \end{funcdesc} |
Guido van Rossum | e229d86 | 1997-08-18 15:14:26 +0000 | [diff] [blame] | 41 | |