Fred Drake | 295da24 | 1998-08-10 19:42:37 +0000 | [diff] [blame] | 1 | \section{\module{mailbox} --- |
Fred Drake | 199b79c | 1999-02-20 05:04:59 +0000 | [diff] [blame] | 2 | Read various mailbox formats} |
| 3 | |
Fred Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame] | 4 | \declaremodule{standard}{mailbox} |
Fred Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame] | 5 | \modulesynopsis{Read various mailbox formats.} |
| 6 | |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 7 | |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 8 | This module defines a number of classes that allow easy and uniform |
Fred Drake | 2e495c9 | 1998-03-14 06:48:33 +0000 | [diff] [blame] | 9 | access to mail messages in a (\UNIX{}) mailbox. |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 10 | |
Fred Drake | 2e495c9 | 1998-03-14 06:48:33 +0000 | [diff] [blame] | 11 | \begin{classdesc}{UnixMailbox}{fp} |
Fred Drake | c9dc515 | 1998-01-13 19:01:57 +0000 | [diff] [blame] | 12 | Access a classic \UNIX{}-style mailbox, where all messages are contained |
Fred Drake | 6e99adb | 1998-02-13 22:17:21 +0000 | [diff] [blame] | 13 | in a single file and separated by ``From name time'' lines. |
| 14 | The file object \var{fp} points to the mailbox file. |
Fred Drake | 2e495c9 | 1998-03-14 06:48:33 +0000 | [diff] [blame] | 15 | \end{classdesc} |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 16 | |
Fred Drake | 2e495c9 | 1998-03-14 06:48:33 +0000 | [diff] [blame] | 17 | \begin{classdesc}{MmdfMailbox}{fp} |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 18 | Access an MMDF-style mailbox, where all messages are contained |
| 19 | in a single file and separated by lines consisting of 4 control-A |
Fred Drake | 6e99adb | 1998-02-13 22:17:21 +0000 | [diff] [blame] | 20 | characters. The file object \var{fp} points to the mailbox file. |
Fred Drake | 2e495c9 | 1998-03-14 06:48:33 +0000 | [diff] [blame] | 21 | \end{classdesc} |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 22 | |
Fred Drake | 2e495c9 | 1998-03-14 06:48:33 +0000 | [diff] [blame] | 23 | \begin{classdesc}{MHMailbox}{dirname} |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 24 | Access an MH mailbox, a directory with each message in a separate |
Fred Drake | 6e99adb | 1998-02-13 22:17:21 +0000 | [diff] [blame] | 25 | file with a numeric name. |
| 26 | The name of the mailbox directory is passed in \var{dirname}. |
Fred Drake | 2e495c9 | 1998-03-14 06:48:33 +0000 | [diff] [blame] | 27 | \end{classdesc} |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 28 | |
Fred Drake | 199b79c | 1999-02-20 05:04:59 +0000 | [diff] [blame] | 29 | \begin{classdesc}{Maildir}{dirname} |
| 30 | Access a Qmail mail directory. All new and current mail for the |
| 31 | mailbox specified by \var{dirname} is made available. |
| 32 | \end{classdesc} |
| 33 | |
| 34 | \begin{classdesc}{BabylMailbox}{fp} |
| 35 | Access a Babyl mailbox, which is similar to an MMDF mailbox. Mail |
Fred Drake | 180b68b | 1999-02-22 13:45:09 +0000 | [diff] [blame] | 36 | messages start with a line containing only \code{'*** EOOH ***'} and |
Fred Drake | fab41f1 | 1999-02-22 14:26:16 +0000 | [diff] [blame^] | 37 | end with a line containing only \code{'\e{}037\e{}014'}. |
Fred Drake | 199b79c | 1999-02-20 05:04:59 +0000 | [diff] [blame] | 38 | \end{classdesc} |
| 39 | |
| 40 | |
| 41 | \subsection{Mailbox Objects \label{mailbox-objects}} |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 42 | |
| 43 | All implementations of Mailbox objects have one externally visible |
| 44 | method: |
| 45 | |
Fred Drake | 182bd2d | 1998-04-02 18:50:21 +0000 | [diff] [blame] | 46 | \begin{methoddesc}[mailbox]{next}{} |
Fred Drake | 2e495c9 | 1998-03-14 06:48:33 +0000 | [diff] [blame] | 47 | Return the next message in the mailbox, as a \class{rfc822.Message} object. |
Guido van Rossum | 39a23cc | 1997-06-02 21:04:41 +0000 | [diff] [blame] | 48 | Depending on the mailbox implementation the \var{fp} attribute of this |
Guido van Rossum | e229d86 | 1997-08-18 15:14:26 +0000 | [diff] [blame] | 49 | object may be a true file object or a class instance simulating a file object, |
| 50 | 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] | 51 | contained in a single file, etc. |
Fred Drake | 182bd2d | 1998-04-02 18:50:21 +0000 | [diff] [blame] | 52 | \end{methoddesc} |