docs/unix-phil

diff unix-phil.ms @ 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
line diff
     1.1 --- a/unix-phil.ms	Thu Mar 25 18:41:01 2010 +0100
     1.2 +++ b/unix-phil.ms	Thu Mar 25 22:18:55 2010 +0100
     1.3 @@ -808,42 +808,16 @@
     1.4  .NH 2
     1.5  Data storage
     1.6  .LP
     1.7 -\s-1MH\s0's mail storage is (only little more than) a directory tree
     1.8 -where mail folders are directories and mail messages are text files.
     1.9 -Working with \s-1MH\s0's toolchest is much like working
    1.10 -with Unix' toolchest:
    1.11 -\f(CWscan\fP is like \f(CWls\fP,
    1.12 -\f(CWshow\fP is like \f(CWcat\fP,
    1.13 -\f(CWfolder\fP is like \f(CWcd\fP/\f(CWpwd\fP,
    1.14 -\f(CWrefile\fP is like \f(CWmv\fP,
    1.15 -and \f(CWrmm\fP is like \f(CWrm\fP.
    1.16 +\s-1MH\s0's mail storage is a directory tree under the user's
    1.17 +\s-1MH\s0 directory (usually \f(CW$HOME/Mail\fP),
    1.18 +where mail folders are directories and mail messages are text files
    1.19 +within them.
    1.20 +Each mail folder contains a file \f(CW.mh_sequences\fP which lists
    1.21 +the public message sequences of that folder, for instance new messages.
    1.22 +Mail messages are text files located in a mail folder.
    1.23 +The files contain the messages as they were received.
    1.24 +They are numbered in ascending order in each folder.
    1.25  .PP
    1.26 -The context of tools in Unix is mainly the current working directory,
    1.27 -the user identification, and the environment variables.
    1.28 -\s-1MH\s0 extends this context by two more items:
    1.29 -.IP \(bu
    1.30 -The current mail folder, which is similar to the current working directory.
    1.31 -For mail folders, \f(CWfolder\fP provides the corresponding functionality
    1.32 -of \f(CWpwd\fP and \f(CWcd\fP for directories.
    1.33 -.IP \(bu
    1.34 -The current message, relative to the current mail folder,
    1.35 -which enables commands like \f(CWnext\fP and \f(CWprev\fP.
    1.36 -.LP
    1.37 -In contrast to Unix' context, which is chained to the shell session,
    1.38 -\s-1MH\s0's context is meant to be chained to a mail account.
    1.39 -But actually, the current message is a property of the mail folder,
    1.40 -which appears to be a legacy.
    1.41 -This will cause problems when multiple users work
    1.42 -in one mail folder simultaneously.
    1.43 -.PP
    1.44 -.I "Data storage.
    1.45 -How \s-1MH\s0 stores data was already mentioned.
    1.46 -Mail folders are directories (which contain a file
    1.47 -\&\f(CW.mh_sequences\fP) under the user's \s-1MH\s0 directory
    1.48 -(usually \f(CW$HOME/Mail\fP).
    1.49 -Mail messages are text files located in mail folders.
    1.50 -The files contain the messages as they were received.
    1.51 -The messages are numbered in ascending order in each folder.
    1.52  This mailbox format is called ``\s-1MH\s0'' after the \s-1MUA\s0.
    1.53  Alternatives are \fImbox\fP and \fImaildir\fP.
    1.54  In the mbox format all messages are stored within one file.
    1.55 @@ -859,12 +833,38 @@
    1.56  each message is a self-standing item, by definition.
    1.57  Also, the problem of concurrent access to one mailbox is
    1.58  reduced to the problem of concurrent access to one message.
    1.59 -However, the issue of the shared parts of the context,
    1.60 -as mentioned above, remains.
    1.61  Maildir is generally similar to \s-1MH\s0's format,
    1.62  but modified towards guaranteed reliability.
    1.63  This involves some complexity, unfortunately.
    1.64 -
    1.65 +.PP
    1.66 +Working with \s-1MH\s0's toolchest on mailboxes is much like
    1.67 +working with Unix' toolchest on directory trees:
    1.68 +\f(CWscan\fP is like \f(CWls\fP,
    1.69 +\f(CWshow\fP is like \f(CWcat\fP,
    1.70 +\f(CWfolder\fP is like \f(CWcd\fP and \f(CWpwd\fP,
    1.71 +\f(CWrefile\fP is like \f(CWmv\fP,
    1.72 +and \f(CWrmm\fP is like \f(CWrm\fP.
    1.73 +.PP
    1.74 +The context of tools in Unix consists mainly the current working directory,
    1.75 +the user identification, and the environment variables.
    1.76 +\s-1MH\s0 extends this context by two more items:
    1.77 +.IP \(bu
    1.78 +The current mail folder, which is similar to the current working directory.
    1.79 +For mail folders, \f(CWfolder\fP provides the corresponding functionality
    1.80 +of \f(CWcd\fP and \f(CWpwd\fP for directories.
    1.81 +.IP \(bu
    1.82 +Sequences, which are named sets of messages in a mail folder.
    1.83 +The current message, relative to a mail folder, is a special sequence.
    1.84 +It enables commands like \f(CWnext\fP and \f(CWprev\fP.
    1.85 +.LP
    1.86 +In contrast to Unix' context, which is chained to the shell session,
    1.87 +\s-1MH\s0's context is independent.
    1.88 +Usually there is one context for each user, but a user can have many
    1.89 +contexts.
    1.90 +Public sequences are an exception, as they belong to the mail folder.
    1.91 +.[
    1.92 +%O mh-profile(5) and mh-sequence(5)
    1.93 +.]
    1.94  
    1.95  .NH 2
    1.96  Discussion of the design
    1.97 @@ -908,8 +908,15 @@
    1.98  functionality with little work.
    1.99  
   1.100  .PP
   1.101 -.B "Store data in flat text files" .
   1.102 -FIXME
   1.103 +.B "Store data in flat text files
   1.104 +is followed by \s-1MH\s0.
   1.105 +This is not surprising, because email messages are already plain text.
   1.106 +\s-1MH\s0 stores the messages as it receives them,
   1.107 +thus any other tool that works on RFC 2822 mail messages can operate
   1.108 +on the messages in an \s-1MH\s0 mailbox.
   1.109 +All other files \s-1MH\s0 uses are plain text too.
   1.110 +It is therefore possible and encouraged to use the text processing
   1.111 +tools of Unix' toolchest to extend \s-1MH\s0's toolchest.
   1.112  
   1.113  .PP
   1.114  .B "Avoid captive user interfaces" .