changeset 34:0b2cf026d93d

rework of MH's data storage section
author meillo@marmaro.de
date Thu, 25 Mar 2010 22:18:55 +0100
parents 0bd43c4ad9f8
children f11406a85319
files unix-phil.ms
diffstat 1 files changed, 47 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/unix-phil.ms	Thu Mar 25 18:41:01 2010 +0100
+++ b/unix-phil.ms	Thu Mar 25 22:18:55 2010 +0100
@@ -808,42 +808,16 @@
 .NH 2
 Data storage
 .LP
-\s-1MH\s0's mail storage is (only little more than) a directory tree
-where mail folders are directories and mail messages are text files.
-Working with \s-1MH\s0's toolchest is much like working
-with Unix' toolchest:
-\f(CWscan\fP is like \f(CWls\fP,
-\f(CWshow\fP is like \f(CWcat\fP,
-\f(CWfolder\fP is like \f(CWcd\fP/\f(CWpwd\fP,
-\f(CWrefile\fP is like \f(CWmv\fP,
-and \f(CWrmm\fP is like \f(CWrm\fP.
+\s-1MH\s0's mail storage is a directory tree under the user's
+\s-1MH\s0 directory (usually \f(CW$HOME/Mail\fP),
+where mail folders are directories and mail messages are text files
+within them.
+Each mail folder contains a file \f(CW.mh_sequences\fP which lists
+the public message sequences of that folder, for instance new messages.
+Mail messages are text files located in a mail folder.
+The files contain the messages as they were received.
+They are numbered in ascending order in each folder.
 .PP
-The context of tools in Unix is mainly the current working directory,
-the user identification, and the environment variables.
-\s-1MH\s0 extends this context by two more items:
-.IP \(bu
-The current mail folder, which is similar to the current working directory.
-For mail folders, \f(CWfolder\fP provides the corresponding functionality
-of \f(CWpwd\fP and \f(CWcd\fP for directories.
-.IP \(bu
-The current message, relative to the current mail folder,
-which enables commands like \f(CWnext\fP and \f(CWprev\fP.
-.LP
-In contrast to Unix' context, which is chained to the shell session,
-\s-1MH\s0's context is meant to be chained to a mail account.
-But actually, the current message is a property of the mail folder,
-which appears to be a legacy.
-This will cause problems when multiple users work
-in one mail folder simultaneously.
-.PP
-.I "Data storage.
-How \s-1MH\s0 stores data was already mentioned.
-Mail folders are directories (which contain a file
-\&\f(CW.mh_sequences\fP) under the user's \s-1MH\s0 directory
-(usually \f(CW$HOME/Mail\fP).
-Mail messages are text files located in mail folders.
-The files contain the messages as they were received.
-The messages are numbered in ascending order in each folder.
 This mailbox format is called ``\s-1MH\s0'' after the \s-1MUA\s0.
 Alternatives are \fImbox\fP and \fImaildir\fP.
 In the mbox format all messages are stored within one file.
@@ -859,12 +833,38 @@
 each message is a self-standing item, by definition.
 Also, the problem of concurrent access to one mailbox is
 reduced to the problem of concurrent access to one message.
-However, the issue of the shared parts of the context,
-as mentioned above, remains.
 Maildir is generally similar to \s-1MH\s0's format,
 but modified towards guaranteed reliability.
 This involves some complexity, unfortunately.
-
+.PP
+Working with \s-1MH\s0's toolchest on mailboxes is much like
+working with Unix' toolchest on directory trees:
+\f(CWscan\fP is like \f(CWls\fP,
+\f(CWshow\fP is like \f(CWcat\fP,
+\f(CWfolder\fP is like \f(CWcd\fP and \f(CWpwd\fP,
+\f(CWrefile\fP is like \f(CWmv\fP,
+and \f(CWrmm\fP is like \f(CWrm\fP.
+.PP
+The context of tools in Unix consists mainly the current working directory,
+the user identification, and the environment variables.
+\s-1MH\s0 extends this context by two more items:
+.IP \(bu
+The current mail folder, which is similar to the current working directory.
+For mail folders, \f(CWfolder\fP provides the corresponding functionality
+of \f(CWcd\fP and \f(CWpwd\fP for directories.
+.IP \(bu
+Sequences, which are named sets of messages in a mail folder.
+The current message, relative to a mail folder, is a special sequence.
+It enables commands like \f(CWnext\fP and \f(CWprev\fP.
+.LP
+In contrast to Unix' context, which is chained to the shell session,
+\s-1MH\s0's context is independent.
+Usually there is one context for each user, but a user can have many
+contexts.
+Public sequences are an exception, as they belong to the mail folder.
+.[
+%O mh-profile(5) and mh-sequence(5)
+.]
 
 .NH 2
 Discussion of the design
@@ -908,8 +908,15 @@
 functionality with little work.
 
 .PP
-.B "Store data in flat text files" .
-FIXME
+.B "Store data in flat text files
+is followed by \s-1MH\s0.
+This is not surprising, because email messages are already plain text.
+\s-1MH\s0 stores the messages as it receives them,
+thus any other tool that works on RFC 2822 mail messages can operate
+on the messages in an \s-1MH\s0 mailbox.
+All other files \s-1MH\s0 uses are plain text too.
+It is therefore possible and encouraged to use the text processing
+tools of Unix' toolchest to extend \s-1MH\s0's toolchest.
 
 .PP
 .B "Avoid captive user interfaces" .