# HG changeset patch # User meillo@marmaro.de # Date 1267106794 -3600 # Node ID d8f428cee0d1988eb7c806464cc6716ba1226128 # Parent e2240a387a840272f2ef0fed98989a4295b5433f about mh (ch04) diff -r e2240a387a84 -r d8f428cee0d1 unix-phil.ms --- a/unix-phil.ms Wed Feb 24 18:05:54 2010 +0100 +++ b/unix-phil.ms Thu Feb 25 15:06:34 2010 +0100 @@ -654,7 +654,7 @@ .NH 1 -Case study: nmh +Case study: \s-1MH\s0 .LP The last chapter introduced and explained the Unix Philosophy from a general point of view. @@ -665,25 +665,68 @@ .PP This first case study is about the mail user agents \s-1MH\s0 (``mail handler'') and its descendent \fInmh\fP (``new mail handler''). +In this document, the name \s-1MH\s0 will be used for both of them. +A distinction will only be made if differences between +them are described. .NH 2 -History of \s-1MH\s0 +Historical background .LP -In 1977, Stockton Gaines and Norman Shapiro of the \s-1RAND\s0 Corporation -came up with a concept for a new electronic mail system. -Till then, \s-1RAND\s0 had used \s-1MS\s0 (``mail system''), -which was monolithic. -In 1978 and 1989, Bruce Borden implemented the concept \(en -this was the birth of \s-1MH\s0. +Electronic mail was available in Unix very early. +It is out of matter that in the beginning mail was only +transferred within one machine. +This chapter is about a mail user agent (\s-1MUA\s0), +which provides functions to read, compose, and organize mail, +but (ideally) not to transfer. +.PP +The first \s-1MUA\s0 on Unix was \f(CWmail\fP. +It was a small program that either prints the own mailbox file +or appends text to someone elses mailbox file, +depending on the command line arguments. +.[ +%O http://cm.bell-labs.com/cm/cs/who/dmr/pdfs/man12.pdf +.] +It was a program that did one job well. +This job was emailing, which then was very simple. +.PP +Later, emailing became more powerfull, and thus more complex. +The simple \f(CWmail\fP, which knew nothing of subjects, +independent handling of single messages, +and long-time storage of them, was not powerful enough anymore. +At Berkeley, Kurt Shoens wrote \fIMail\fP (with capital `M') +in 1978 to provide additional functions for emailing. +Mail was still one program, but now it was large and did +several jobs. +Its user interface is modeled after the one of ed. +It is designed for humans, but is still scriptable. +\fImailx\fP is the adaption of Berkeley Mail into System V. +.[ +%A Gunnar Ritter +%O http://heirloom.sourceforge.net/mailx_history.html +.] +Elm, pine, mutt, and today a whole bunch of graphical \s-1MUA\s0s +followed Mail's direction. +They are large, monolithic programs which include all emailing functions. +.PP +A different way took the people of \s-1RAND\s0 Corporation. +In the beginning, they also had used a monolitic mail system, +simply called \s-1MS\s0 for ``mail system''. +But in 1977, Stockton Gaines and Norman Shapiro +came up with a proposal of a new email system concept \(en +one that honors the Unix Philosophy. +The concept was implemented by Bruce Borden in 1978 and 1979. +This was the birth of \s-1MH\s0 \(en the ``mail handler''. .PP Since then, \s-1RAND\s0, the University of California at Irvine and -at Berkeley, and several others have contributet to the software. +at Berkeley, and several others have contributed to the software. However, it's core concepts remained the same. -In the 90s, the development of \s-1MH\s0 slowed down. -Richard Coleman started with \fInmh\fP, the new mail handler, -in 1997 to improve \s-1MH\s0, especially in regard of modern emailing. -Today, nmh is developed by various people on the internet. +In the 90s, when development of \s-1MH\s0 slowed down, +Richard Coleman started with \fInmh\fP, the new mail handler. +This was in 1997. +His goal was to improve \s-1MH\s0, especially in regard of +the requirements of modern email. +Today, nmh is developed by various people on the Internet. .[ %T RAND and the Information Evolution: A History in Essays and Vignettes %A Willis H. Ware @@ -702,15 +745,108 @@ .] .NH 2 -Contrasts to similar sw +Contrasts to similar software .LP -vs. Thunderbird, mutt, mailx, pine +All \s-1MUA\s0s are monolithic, except \s-1MH\s0. +This might not be completely true, +but it reflects the general situation pretty well. +.PP +While monolithic \s-1MUA\s0s gather all function in one program, +\s-1MH\s0 is a toolchest of many small tools \(en one for each job. +Following is a list of important programs of \s-1MH\s0's toolchest: +.IP \(bu +.CW inc : +incorporate new mail +.IP \(bu +.CW scan : +list messages in folder +.IP \(bu +.CW show : +show message +.IP \(bu +.CW next\fR/\fPprev : +show next/previous message +.IP \(bu +.CW folder : +change current folder +.IP \(bu +.CW refile : +refile message into folder +.IP \(bu +.CW rmm : +remove message +.IP \(bu +.CW comp : +compose a new message +.IP \(bu +.CW repl : +reply to a message +.IP \(bu +.CW forw : +forward a message +.IP \(bu +.CW send : +send a prepared message .LP -flexibility, no redundancy, use the shell +\s-1MH\s0 has no special user interface like monolithic \s-1MUA\s0s have. +The user does not leave the shell to run \s-1MH\s0, +but he uses \s-1MH\s0 within the shell. +\s-1MH\s0's mail storage is (only little more than) a directory tree +where directories are mail folders and files are mail messages. +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(CWrefile\fP is like \f(CWmv\fP, +and \f(CWrmm\fP is like \f(CWrm\fP. +.PP +The most important difference to Unix' toolchest is, +that \s-1MH\s0's tools have an own context. +The context of the Unix tools is mainly the current working directory, +the user identification, and the environment variables. +\s-1MH\s0 extends this context by two more items: +A current mail folder, similar to the current working directory, +is maintained; \f(CWfolder\fP provides the functionality +of \f(CWpwd\fP and \f(CWcd\fP for it. +A current message, relative to the current folder, is maintained. +This enables commands like \f(CWnext\fP and \f(CWprev\fP. +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. +Actually, the current message is a property of the mail folder. +This is without problem as long as a mail folder belongs to one user. +But when multiple users want to work on one mail folder simultaneously, +it will cause problems. +This is a legacy from a time when emailing was different. +.PP +Using a monolithic program with a captive user interface +means ``entering'' the program, using it, and ``leaving'' the program. +Using a toolchest like \s-1MH\s0 means running programs, +alone or in combinition with others, even from other toolchests, +without leaving the shell. .NH 2 Gains of the design .LP +\s-1MH\s0 is perfectly suited for non-interactive use. +It offers all functions directly and without captive user interfaces. +If users want a graphical user interface, anyhow, +they can have it with \fIxmh\fP or \fIexmh\fP. +These are graphical frontends for the \s-1MH\s0 toolchest. +This means, all email-related work is still done by \s-1MH\s0 tools, +but xmh issues the calls when the user clicks a button. +Providing easy-to-use user interfaces as frontends is a good +approach, because it does not limit the power of the backend itself. +The frontend will anyways only be able to make a part of the +backend's power and flexibility available. +If it is separate, then the missing parts can still be accessed +at the backend directly. +If it is integrated, then this will hardly be possible. +.PP +flexibility, no redundancy, use the shell + +.PP +easy to write: see ksh-book .NH 2 Problems