docs/master

changeset 107:9f672d3a25f9

Renamed the chapters to speaking names.
author markus schnalke <meillo@marmaro.de>
date Sat, 23 Jun 2012 22:12:14 +0200
parents 3c4e5f0a7e7b
children dd5620bf8659
files ch01.roff ch03.roff ch04.roff discussion.roff intro.roff makefile summary.roff
diffstat 7 files changed, 2938 insertions(+), 2938 deletions(-) [+]
line diff
     1.1 --- a/ch01.roff	Sat Jun 23 22:08:17 2012 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,394 +0,0 @@
     1.4 -.RN 1
     1.5 -
     1.6 -.H0 "Introduction
     1.7 -.P
     1.8 -MH is a set of mail handling tools with a common concept, similar to
     1.9 -the Unix tool chest, which is a set of file handling tools with a common
    1.10 -concept. \fInmh\fP is the currently most popular implementation of an
    1.11 -MH-like mail handling system.
    1.12 -This thesis describes an experimental version of nmh, named \fImmh\fP.
    1.13 -.P
    1.14 -This chapter introduces MH, its history, concepts and how it is used.
    1.15 -It describes nmh's code base and community to give the reader
    1.16 -a better understanding of the state of mmh when it started off.
    1.17 -Further more, this chapter outlines the mmh project itself,
    1.18 -describing the motivation for it and its goals.
    1.19 -
    1.20 -
    1.21 -.H1 "MH \(en the Mail Handler
    1.22 -.P
    1.23 -MH is a conceptual email system design and its concrete implementation.
    1.24 -Notably, MH had started as a design proposal at RAND Corporation,
    1.25 -where the first implementation followed later.
    1.26 -In spirit, MH is similar to Unix, which
    1.27 -influenced the world more in being a set of system design concepts
    1.28 -than in being a specific software product.
    1.29 -The ideas behind Unix are summarized in the \fIUnix philosophy\fP.
    1.30 -MH follows this philosophy.
    1.31 -
    1.32 -.U2 "History
    1.33 -.P
    1.34 -In 1977 at RAND Corporation, Norman Shapiro and Stockton Gaines
    1.35 -proposed the design
    1.36 -of a new mail handling system, called ``Mail Handler'' (MH),
    1.37 -to superseed RAND's old monolithic ``Mail System'' (MS).
    1.38 -Two years later, in 1979, Bruce Borden took the proposal and implemented a
    1.39 -prototype of MH.
    1.40 -Before the prototype's existence, the concept was
    1.41 -believed to be practically unusable.
    1.42 -But the prototype proved successful and replaced MS thereafter.
    1.43 -In replacing MS, MH grew to an all-in-one mail system.
    1.44 -.P
    1.45 -In the early eighties,
    1.46 -the University of California at Irvine (UCI) started to use MH.
    1.47 -Marshall T. Rose and John L. Romine then became the driving force.
    1.48 -They took over the development and pushed MH forward.
    1.49 -RAND had put the code into the public domain by then.
    1.50 -MH was developed at UCI at the time when the Internet appeared,
    1.51 -when UCB implemented the TCP/IP stack, and when Allman wrote Sendmail.
    1.52 -MH was extended as emailing became more featured.
    1.53 -The development of MH was closely related to the development of email
    1.54 -RFCs. In the advent of MIME, MH was the first implementation of this new
    1.55 -email standard.
    1.56 -.P
    1.57 -In the nineties, the Internet had become popular and in December 1996,
    1.58 -Richard Coleman initiated the ``New Mail Handler'' (nmh) project.
    1.59 -Nmh is a fork of MH 6.8.3 and bases strongly on the
    1.60 -\fILBL changes\fP by Van Jacobson, Mike Karels and Craig Leres.
    1.61 -Colman intended to modernize MH and improve its portability and
    1.62 -MIME handling capabilities.
    1.63 -This should be done openly within the Internet community.
    1.64 -The development of MH at UCI stopped after the 6.8.4 release in
    1.65 -February 1996, soon after the development of nmh had started.
    1.66 -Today, nmh has almost completely replaced the original MH.
    1.67 -Some systems might still provide old MH, but mainly for historical reasons.
    1.68 -.P
    1.69 -In the last years, the work on nmh was mostly maintenance work.
    1.70 -However, development was revived in December 2011
    1.71 -and stayed busy since then.
    1.72 -
    1.73 -.U2 "Concepts
    1.74 -.P
    1.75 -MH consists of a set of tools, each covering a specific task of
    1.76 -email handling, like composing a message, replying to a message,
    1.77 -refiling a message to a different folder, listing the messages in a folder.
    1.78 -All of the programs operate on a common mail storage.
    1.79 -.P
    1.80 -The mail storage consists of \fImail folders\fP (directories) and
    1.81 -\fPmessages\fP (regular files).
    1.82 -Each message is stored in a separate file in the format it was
    1.83 -received (i.e. transfer format).
    1.84 -The files are named with ascending numbers in each folder.
    1.85 -The specific format of the mail storage characterizes MH in the same way
    1.86 -as the format of the file system characterizes Unix.
    1.87 -.P
    1.88 -MH tools maintain a \fIcontext\fP, which includes the current mail folder.
    1.89 -Processes in Unix have a similar context, containing the current working
    1.90 -directory, for instance. In contrast, the process context is maintained
    1.91 -by the Unix kernel automatically, whereas MH tools need to maintain the MH
    1.92 -context themselves.
    1.93 -The user can have one MH context or multiple ones; he can even share it
    1.94 -with others.
    1.95 -.P
    1.96 -Messages are named by their numeric filename, but they can have symbolic names,
    1.97 -too. These are either automatically updated
    1.98 -position names such as the next or the last message,
    1.99 -or user-settable group names for arbitrary sets of messages.
   1.100 -These names are called sequences.
   1.101 -Sequences can be bound to the containing folder or to the context.
   1.102 -.P
   1.103 -The user's \fIprofile\fP is a file that contains his MH configuration.
   1.104 -Default switches for the individual tools can be specified to
   1.105 -adjust them to the user's personal preferences.
   1.106 -Multiple versions of the same command with different
   1.107 -default values can also be created very easily.
   1.108 -Form templates for new messages or for replies are easily changeable,
   1.109 -and output is adjustable with format files.
   1.110 -Almost every part of the system can be adjusted to personal preference.
   1.111 -.P
   1.112 -The system is well scriptable and extensible.
   1.113 -New MH tools are built out of or on top of existing ones quickly.
   1.114 -Further more, MH encourages the user to tailor, extend and automate the system.
   1.115 -As the MH tool chest was modeled after the Unix tool chest, the
   1.116 -properties of the latter apply to the former as well.
   1.117 -
   1.118 -
   1.119 -.ig \"XXX
   1.120 -
   1.121 -.P
   1.122 -To ease typing, the switches can be abbreviated as much as the remaining
   1.123 -prefix remains unambiguous.
   1.124 -If in our example no other switch would start with the letter `t', then
   1.125 -.Cl "-truncate" ,
   1.126 -.Cl "-trunc" ,
   1.127 -.Cl "-tr" ,
   1.128 -and
   1.129 -.Cl "-t
   1.130 -would all be the same.
   1.131 -As a result, switches can neither be grouped (as in
   1.132 -.Cl "ls -ltr" )
   1.133 -nor can switch arguments be appended directly to the switch (as in
   1.134 -.Cl "sendmail -q30m" ).
   1.135 -.P
   1.136 -Many switches have negating counter-parts, which start with `no'.
   1.137 -For example
   1.138 -.Cl "-notruncate
   1.139 -inverts the
   1.140 -.Cl "-truncate
   1.141 -switch.
   1.142 -They exist to undo the effect of default switches in the profile.
   1.143 -If the user has chosen to change the default behavior of some tool
   1.144 -by adding a default switch to the profile,
   1.145 -he can still undo this change in behavior by specifying the inverse
   1.146 -switch on the command line.
   1.147 -
   1.148 -..
   1.149 -
   1.150 -
   1.151 -.U2 "Using MH
   1.152 -.P
   1.153 -It is strongly recommended to have a look at the MH Book,
   1.154 -which offers a thorough introduction to using MH.
   1.155 -.[ [
   1.156 -peek mh book
   1.157 -.], Part II]
   1.158 -Rose and Romine provide a deeper and more technical
   1.159 -though slightly outdated introduction in only about two dozens pages.
   1.160 -.[
   1.161 -rose romine real work
   1.162 -.]
   1.163 -.P
   1.164 -Following is an example mail handling session.
   1.165 -It uses mmh but is mostly compatible with nmh and old MH.
   1.166 -Details might vary but the look and feel is the same.
   1.167 -
   1.168 -.VF input/mh-session
   1.169 -
   1.170 -
   1.171 -.H1 "nmh: Code and Community
   1.172 -.P
   1.173 -In order to understand the condition, goals and dynamics of a project,
   1.174 -one needs to know the reasons behind them.
   1.175 -This section explains the background.
   1.176 -.P
   1.177 -MH predates the Internet; it comes from times before networking was universal,
   1.178 -it comes from times when emailing was small, short and simple.
   1.179 -Then it grew, spread and adapted to the changes email went through.
   1.180 -Its core-concepts, however, remained the same.
   1.181 -During the eighties, students at UCI actively worked on MH.
   1.182 -They added new features and optimized the code for the then popular systems.
   1.183 -All this still was in times before POSIX and ANSI C.
   1.184 -As large parts of the code stem from this time, today's nmh source code
   1.185 -still contains many ancient parts.
   1.186 -BSD-specific code and constructs tailored for hardware of that time
   1.187 -are frequent.
   1.188 -.P
   1.189 -Nmh started about a decade after the POSIX and ANSI C standards were
   1.190 -established. A more modern coding style entered the code base, but still
   1.191 -a part of the developers came from ``the old days''. The developer
   1.192 -base became more diverse, thus broadening the range of different
   1.193 -coding styles.
   1.194 -Programming practices from different decades merged in the project.
   1.195 -As several peers added code, the system became more a conglomeration
   1.196 -of single tools rather than a homogeneous of-one-cast mail system.
   1.197 -Still, the existing basic concepts held it together.
   1.198 -They were mostly untouched throughout the years.
   1.199 -.P
   1.200 -Despite the separation of the tool chest approach at the surface
   1.201 -\(en a collection of small, separate programs \(en
   1.202 -on the source code level, it is much more interweaved.
   1.203 -Several separate components were compiled into one program
   1.204 -for efficiency reasons.
   1.205 -This led to intricate innards.
   1.206 -While clearly separated on the outside,
   1.207 -the programs turned out to be fairly interweaved inside.
   1.208 -.\" XXX FIXME rewrite...
   1.209 -.\" Unfortunately, the clear separation on the outside turned out to be
   1.210 -.\" fairly interweaved inside.
   1.211 -.P
   1.212 -The advent of MIME raised the complexity of email by a magnitude.
   1.213 -This is visible in nmh. The MIME-related parts are the most complex ones.
   1.214 -It is also visible that MIME support was added on top of the old MH core.
   1.215 -MH's tool chest style made this easily possible and encourages
   1.216 -such approaches, but unfortunately, it led to duplicated functions
   1.217 -and half-hearted implementation of the concepts.
   1.218 -.P
   1.219 -To provide backward-compatibility, it is a common understanding to not
   1.220 -change the default settings.
   1.221 -In consequence, the user needs to activate modern features explicitly
   1.222 -to be able to use them.
   1.223 -This puts a burden on new users, because out-of-the-box nmh remains
   1.224 -in the same ancient style.
   1.225 -If nmh is seen to be a back-end, then this compatibility surely is important.
   1.226 -However, in the same go, new users have difficulties using nmh for modern
   1.227 -emailing.
   1.228 -The small but mature community around nmh needs few change
   1.229 -as they have had their convenient setups for decades.
   1.230 -
   1.231 -
   1.232 -.H1 "mmh
   1.233 -.P
   1.234 -I started to work on my experimental version in October 2011,
   1.235 -at a time when there had been no more than three commits to nmh
   1.236 -since the beginning of the year.
   1.237 -In December, when I announced my work in progress on the
   1.238 -nmh-workers mailing list,
   1.239 -.[
   1.240 -nmh-workers mmh announce December
   1.241 -.]
   1.242 -nmh's community became active, too.
   1.243 -This movement was heavily pushed by Paul Vixie's ``edginess'' comment.
   1.244 -.[
   1.245 -nmh-workers vixie edginess
   1.246 -.]
   1.247 -After long years of stagnation, nmh became actively developed again.
   1.248 -Hence, while I was working on mmh, the community was once more working
   1.249 -on nmh, in parallel.
   1.250 -.P
   1.251 -The name \fImmh\fP may stand for \fImodern mail handler\fP,
   1.252 -because the project tries to modernize nmh.
   1.253 -Personally however, I prefer to call mmh \fImeillo's mail handler\fP,
   1.254 -emphasizing that the project follows my visions and preferences.
   1.255 -(My login name is \fImeillo\fP.)
   1.256 -This project model was inspired by \fIdwm\fP,
   1.257 -which is Anselm Garbe's personal window manager \(en
   1.258 -targeted to satisfy Garbe's personal needs whenever conflicts appear.
   1.259 -Dwm had retained its lean elegance and its focused character, whereas
   1.260 -its community-driven predecessor \fIwmii\fP had grown fat over time.
   1.261 -The development of mmh should remain focused.
   1.262 -
   1.263 -
   1.264 -.U2 "Motivation
   1.265 -.P
   1.266 -MH is the most important of very few command line tool chest email systems.
   1.267 -Tool chests are powerful because they can be perfectly automated and
   1.268 -extended. They allow arbitrary kinds of front-ends to be
   1.269 -implemented on top of them quickly and without internal knowledge.
   1.270 -Additionally, tool chests are easier to maintain than monolithic
   1.271 -programs.
   1.272 -As there are few tool chests for emailing and as MH-like ones are the most
   1.273 -popular among them, they should be developed further.
   1.274 -This keeps their
   1.275 -conceptional elegance and unique scripting qualities available to users.
   1.276 -Mmh creates a modern and convenient entry point to MH-like systems
   1.277 -for new and interested users.
   1.278 -.P
   1.279 -The mmh project is motivated by deficits of nmh and
   1.280 -my wish for general changes, combined
   1.281 -with the nmh community's reluctancy to change.
   1.282 -.P
   1.283 -At that time, nmh had not adjusted to modern emailing needs well enough.
   1.284 -The default setup was completely unusable for modern emailing.
   1.285 -Too much setup work was required.
   1.286 -Several modern features were already available but the community
   1.287 -did not want to have them as default.
   1.288 -Mmh is a way to change this.
   1.289 -.P
   1.290 -In my eyes, MH's concepts could be exploited even better and
   1.291 -the style of the tools could be improved. Both would simplify
   1.292 -and generalize the system, providing cleaner interfaces and more
   1.293 -software leverage at the same time.
   1.294 -Mmh is a way to demonstrate this.
   1.295 -.P
   1.296 -In providing several parts of an email system, nmh can hardly
   1.297 -compete with the large specialized projects that focus
   1.298 -on only one of the components.
   1.299 -The situation can be improved by concentrating the development power
   1.300 -on the most unique part of MH and letting the user pick his preferred
   1.301 -set of other mail components.
   1.302 -Today's pre-packaged software components encourage this model.
   1.303 -Mmh is a way to go for this approach.
   1.304 -.P
   1.305 -It is worthwhile to fork nmh for the development of mmh, because
   1.306 -the two projects focus on different goals and differ in fundamental questions.
   1.307 -The nmh community's reluctance regarding change conflicts
   1.308 -with my strong desire for it.
   1.309 -In developing a separate experimental version new approaches can
   1.310 -easily be tried out without the need to discuss changes beforehand.
   1.311 -In fact, revolutionary changes are hardly possible otherwise.
   1.312 -.P
   1.313 -The mmh project implements and demonstrates the listed ideas
   1.314 -without the need to change nmh or its community.
   1.315 -Of course, the results of the mmh project shall improve nmh, in the end.
   1.316 -
   1.317 -.U2 "Target Field
   1.318 -.P
   1.319 -Any effort needs to be targeted towards a specific goal
   1.320 -in order to be successful.
   1.321 -Following is a description of the imagined typical mmh user.
   1.322 -mmh should satisfy his needs.
   1.323 -.\" XXX  Remove the next sentence?
   1.324 -Actually, as mmh is my personal version of MH, this is a description
   1.325 -of myself.
   1.326 -.P
   1.327 -The target user of mmh likes Unix and its philosophy.
   1.328 -He likes to use programs that are conceptionally appealing.
   1.329 -He's familiar with the command line and enjoys its power.
   1.330 -He is at least capable of shell scripting and wants to improve his
   1.331 -productivity by scripting the mail system.
   1.332 -He naturally uses modern email features, like attachments,
   1.333 -non-ASCII text, and digital cryptography.
   1.334 -He is able to setup email system components besides mmh,
   1.335 -and actually likes the choice to pick the ones he prefers.
   1.336 -He has a reasonably modern system that complies to standards,
   1.337 -like POSIX and ANSI C.
   1.338 -.P
   1.339 -The typical user invokes mmh commands directly in an interactive
   1.340 -shell session, but as well, he uses them to automate mail handling tasks.
   1.341 -Likely, he runs his mail setup on a server machine, to which he connects
   1.342 -via ssh. He might also have local mmh installations on his workstations,
   1.343 -but does rather not rely on graphical front-ends. He definitely wants
   1.344 -to be flexible and thus be able to change his setup to suite his needs.
   1.345 -.P
   1.346 -The typical mmh user is a programmer himself.
   1.347 -He likes to, occasionally, take the opportunity of Free Software to put
   1.348 -hands on and get involved in the software he uses.
   1.349 -Hence, he likes small and clean code bases and he cares for code quality.
   1.350 -In general, he believes that:
   1.351 -.BU
   1.352 -Elegance \(en i.e. simplicity, clarity and generality \(en
   1.353 -is most important.
   1.354 -.BU
   1.355 -Concepts are more important than the concrete implementation.
   1.356 -.BU
   1.357 -Code optimizations for anything but readability should be avoided
   1.358 -if possible.
   1.359 -.BU
   1.360 -Having a lot of choice is bad.
   1.361 -.BU
   1.362 -Removed code is debugged code.
   1.363 -
   1.364 -.U2 "Goals
   1.365 -.P
   1.366 -The general goals for the mmh project are the following:
   1.367 -.IP "Stream-lining
   1.368 -Mmh should be stripped down to its core, which is the user agent (MUA).
   1.369 -The feature set should be distilled to the ones really needed,
   1.370 -effectively removing corner-cases.
   1.371 -Parts that don't add to the main task of being a conceptionally
   1.372 -appealing MUA should be removed.
   1.373 -This includes, the mail submission and mail retrieval facilities.
   1.374 -Choice should be reduced to the main options.
   1.375 -.IP "Modernizing
   1.376 -Mmh's feature set needs to become more modern.
   1.377 -Better support for attachment and digital cryptography needs to be added.
   1.378 -MIME support needs to be integrated deeper and more naturally.
   1.379 -The modern email features need to be readily available, out-of-the-box.
   1.380 -And on the other hand,
   1.381 -bulletin board support and similar obsolete facilities need to be dropped
   1.382 -out.
   1.383 -Likewise, ancient technologies, like hardcopy terminals, should not
   1.384 -be supported any further.
   1.385 -.IP "Code style
   1.386 -Mmh's source code needs to be updated to modern standards.
   1.387 -Standardized library functions should replace non-standard versions
   1.388 -whenever possible.
   1.389 -Code should be separated into distinct modules when possible.
   1.390 -Time and space optimizations should to be replaced by
   1.391 -clear and readable code.
   1.392 -A uniform programming style should prevail.
   1.393 -.IP "Homogeneity
   1.394 -The available concepts need to be expanded as far as possible.
   1.395 -A small set of concepts should prevail thoroughly throughout the system.
   1.396 -The whole system should appear to be of-one-style.
   1.397 -It should feel like being cast as one.
     2.1 --- a/ch03.roff	Sat Jun 23 22:08:17 2012 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,2527 +0,0 @@
     2.4 -.H0 "Discussion
     2.5 -.P
     2.6 -This main chapter discusses the practical work done in the mmh project.
     2.7 -It is structured along the goals to achieve.
     2.8 -The concrete work done
     2.9 -is described in the examples of how the general goals were achieved.
    2.10 -The discussion compares the current version of mmh with the state of
    2.11 -nmh just before the mmh project started, i.e. Fall 2011.
    2.12 -Current changes of nmh will be mentioned only as side notes.
    2.13 -.\" XXX where do I discuss the parallel development of nmh?
    2.14 -
    2.15 -
    2.16 -
    2.17 -.H1 "Stream-Lining
    2.18 -
    2.19 -.P
    2.20 -MH had been considered an all-in-one system for mail handling.
    2.21 -The community around nmh has a similar understanding.
    2.22 -In fundamental difference, mmh shall be a MUA only.
    2.23 -I believe that the development of all-in-one mail systems is obsolete.
    2.24 -Today, email is too complex to be fully covered by single projects.
    2.25 -Such a project won't be able to excel in all aspects.
    2.26 -Instead, the aspects of email should be covered my multiple projects,
    2.27 -which then can be combined to form a complete system.
    2.28 -Excellent implementations for the various aspects of email exist already.
    2.29 -Just to name three examples: Postfix is a specialized MTA,
    2.30 -Procmail is a specialized MDA, and Fetchmail is a specialized MRA.
    2.31 -I believe that it is best to use such specialized tools instead of
    2.32 -providing the same function again as a side-component in the project.
    2.33 -.P
    2.34 -Doing something well, requires to focus on a small set of specific aspects.
    2.35 -Under the assumption that focused development produces better results
    2.36 -in the particular area, specialized projects will be superior
    2.37 -in their field of focus.
    2.38 -Hence, all-in-one mail system projects \(en no matter if monolithic
    2.39 -or modular \(en will never be the best choice in any of the fields.
    2.40 -Even in providing the best consistent all-in-one system they are likely
    2.41 -to be beaten by projects that focus only on integrating existing mail
    2.42 -components to a homogeneous system.
    2.43 -.P
    2.44 -The limiting resource in Free Software community development
    2.45 -is usually man power.
    2.46 -If the development power is spread over a large development area,
    2.47 -it becomes even more difficult to compete with the specialists in the
    2.48 -various fields.
    2.49 -The concrete situation for MH-based mail systems is even tougher,
    2.50 -given the small and aged community, including both developers and users,
    2.51 -it has.
    2.52 -.P
    2.53 -In consequence, I believe that the available development resources
    2.54 -should focus on the point where MH is most unique.
    2.55 -This is clearly the user interface \(en the MUA.
    2.56 -Peripheral parts should be removed to stream-line mmh for the MUA task.
    2.57 -
    2.58 -
    2.59 -.H2 "Mail Transfer Facilities
    2.60 -.P
    2.61 -In contrast to nmh, which also provides mail submission and mail retrieval
    2.62 -agents, mmh is a MUA only.
    2.63 -This general difference initiated the development of mmh.
    2.64 -Removing the mail transfer facilities had been the first work task
    2.65 -in the mmh project.
    2.66 -.P
    2.67 -Focusing on one mail agent role only is motivated by Eric Allman's
    2.68 -experience with Sendmail.
    2.69 -He identified limiting Sendmail the MTA task had be one reason for
    2.70 -its success:
    2.71 -.[ [
    2.72 -costales sendmail
    2.73 -.], p. xviii]
    2.74 -.QS
    2.75 -Second, I limited myself to the routing function \(en
    2.76 -I wouldn't write user agents or delivery backends.
    2.77 -This was a departure of the dominant through of the time,
    2.78 -in which routing logic, local delivery, and often the network code
    2.79 -were incorporated directly into the user agents.
    2.80 -.QE
    2.81 -.P
    2.82 -In mmh, the Mail Submission Agent (MSA) is called
    2.83 -\fIMessage Transfer Service\fP (MTS).
    2.84 -This facility, implemented by the
    2.85 -.Pn post
    2.86 -command, established network connections and spoke SMTP to submit
    2.87 -messages for relay to the outside world.
    2.88 -The changes in email demanded changes in this part of nmh too.
    2.89 -Encryption and authentication for network connections
    2.90 -needed to be supported, hence TLS and SASL were introduced into nmh.
    2.91 -This added complexity to nmh without improving it in its core functions.
    2.92 -Also, keeping up with recent developments in the field of
    2.93 -mail transfer requires development power and specialists.
    2.94 -In mmh this whole facility was simply cut off.
    2.95 -.Ci f6aa95b724fd8c791164abe7ee5468bf5c34f226
    2.96 -.Ci fecd5d34f65597a4dfa16aeabea7d74b191532c3
    2.97 -.Ci 156d35f6425bea4c1ed3c4c79783dc613379c65b
    2.98 -Instead, mmh depends on an external MSA.
    2.99 -The only outgoing interface available to mmh is the
   2.100 -.Pn sendmail
   2.101 -command, which almost any MSA provides.
   2.102 -If not, a wrapper program can be written.
   2.103 -It must read the message from the standard input, extract the
   2.104 -recipient addresses from the message header, and hand the message
   2.105 -over to the MSA.
   2.106 -For example, a wrapper script for qmail would be:
   2.107 -.VS
   2.108 -#!/bin/sh
   2.109 -# ignore command line arguments
   2.110 -exec qmail-inject
   2.111 -VE
   2.112 -The requirement to parse the recipient addresses out of the message header 
   2.113 -is likely to be removed in the future.
   2.114 -Then mmh would give the recipient addresses as command line arguments.
   2.115 -This appears to be the better interface.
   2.116 -.\" XXX implement it
   2.117 -.P
   2.118 -To retrieve mail, the
   2.119 -.Pn inc
   2.120 -command acted as Mail Retrieval Agent (MRA).
   2.121 -It established network connections
   2.122 -and spoke POP3 to retrieve mail from remote servers.
   2.123 -As with mail submission, the network connections required encryption and
   2.124 -authentication, thus TLS and SASL were added.
   2.125 -Support for message retrieval through IMAP will become necessary
   2.126 -to be added soon, too, and likewise for any other changes in mail transfer.
   2.127 -Not so for mmh because it has dropped the support for retrieving mail
   2.128 -from remote locations.
   2.129 -.Ci ab7b48411962d26439f92f35ed084d3d6275459c
   2.130 -Instead, it depends on an external tool to cover this task.
   2.131 -In mmh exist two paths for messages to enter mmh's mail storage:
   2.132 -(1) Mail can be incorporated with
   2.133 -.Pn inc
   2.134 -from the system maildrop, or (2) with
   2.135 -.Pn rcvstore
   2.136 -by reading them, one at a time, from the standard input.
   2.137 -.P
   2.138 -With the removal of the MSA and MRA, mmh converted from an all-in-one
   2.139 -mail system to being a MUA only.
   2.140 -Now, of course, mmh depends on third-party software.
   2.141 -An external MSA is required to transfer mail to the outside world;
   2.142 -an external MRA is required to retrieve mail from remote machines.
   2.143 -There exist excellent implementations of such software,
   2.144 -which do this specific task likely better than the internal
   2.145 -versions had done it.
   2.146 -Also, the best suiting programs can be freely chosen.
   2.147 -.P
   2.148 -As it had already been possible to use an external MSA or MRA,
   2.149 -why not keep the internal version for convenience?
   2.150 -The question whether there is sense in having a fall-back pager in all
   2.151 -the command line tools, for the cases when
   2.152 -.Pn more
   2.153 -or
   2.154 -.Pn less
   2.155 -aren't available, appears to be ridiculous.
   2.156 -Of course, MSAs and MRAs are more complex than text pagers
   2.157 -and not necessarily available but still the concept of orthogonal
   2.158 -design holds: ``Write programs that do one thing and do it well.''
   2.159 -.[
   2.160 -mcilroy unix phil
   2.161 -p. 53
   2.162 -.]
   2.163 -.[
   2.164 -mcilroy bstj foreword
   2.165 -.]
   2.166 -Here, this part of the Unix philosophy was applied not only
   2.167 -to the programs but to the project itself.
   2.168 -In other words:
   2.169 -``Develop projects that focus on one thing and do it well.''
   2.170 -Projects grown complex should be split for the same reasons programs grown
   2.171 -complex should be split.
   2.172 -If it is conceptionally more elegant to have the MSA and MRA as
   2.173 -separate projects then they should be separated.
   2.174 -This is the case here, in my opinion.
   2.175 -The RFCs propose this separation by clearly distinguishing the different
   2.176 -mail handling tasks.
   2.177 -.[
   2.178 -rfc 821
   2.179 -.]
   2.180 -The small interfaces between the mail agents support the separation.
   2.181 -.P
   2.182 -In the beginning, email had been small and simple.
   2.183 -At that time,
   2.184 -.Pn /bin/mail
   2.185 -had covered anything there was to email and still had been small
   2.186 -and simple.
   2.187 -Later, the essential complexity of email increased.
   2.188 -(Essential complexity is the complexity defined by the problem itself.\0
   2.189 -.[[
   2.190 -brooks no silver bullet
   2.191 -.]])
   2.192 -Email systems reacted to this change: They grew.
   2.193 -RFCs started to introduce the concept of mail agents to separate the
   2.194 -various tasks because they became more extensive and new tasks appeared.
   2.195 -As the mail systems grew even more, parts were split off.
   2.196 -In nmh, for instance, the POP server, which was included in the original
   2.197 -MH, was removed.
   2.198 -Now is the time to go one step further and split the MSA and MRA off, too.
   2.199 -Not only does this decrease the code size of the project,
   2.200 -but, more important, it unburdens mmh of the whole field of
   2.201 -message transfer with all its implications for the project.
   2.202 -There is no more need to concern with changes in network transfer.
   2.203 -This independence is received by depending on an external program
   2.204 -that covers the field.
   2.205 -Today, this is a reasonable exchange.
   2.206 -.P
   2.207 -Functionality can be added in three different ways:
   2.208 -.BU
   2.209 -Implementing the function originally in the project.
   2.210 -.BU
   2.211 -Depending on a library that provides the function.
   2.212 -.BU
   2.213 -Depending on a program that provides the function.
   2.214 -.P
   2.215 -Whereas adding the function originally to the project increases the
   2.216 -code size most and requires most maintenance and development work,
   2.217 -it makes the project most independent of other software.
   2.218 -Using libraries or external programs require less maintenance work
   2.219 -but introduces dependencies on external software.
   2.220 -Programs have the smallest interfaces and provide the best separation
   2.221 -but possibly limit the information exchange.
   2.222 -External libraries are stronger connected than external programs,
   2.223 -thus information can be exchanged more flexible.
   2.224 -Adding code to a project increases maintenance work.
   2.225 -.\" XXX ref
   2.226 -Implementing complex functions originally in the project adds
   2.227 -a lot of code.
   2.228 -This should be avoided if possible.
   2.229 -Hence, the dependencies only change in kind, not in their existence.
   2.230 -In mmh, library dependencies on
   2.231 -.Pn libsasl2
   2.232 -and
   2.233 -.Pn libcrypto /\c
   2.234 -.Pn libssl
   2.235 -were treated against program dependencies on an MSA and an MRA.
   2.236 -This also meant treating build-time dependencies against run-time
   2.237 -dependencies.
   2.238 -Besides program dependencies providing the stronger separation
   2.239 -and being more flexible, they also allowed
   2.240 -over 6\|000 lines of code to be removed from mmh.
   2.241 -This made mmh's code base about 12\|% smaller.
   2.242 -Reducing the project's code size by such an amount without actually
   2.243 -losing functionality is a convincing argument.
   2.244 -Actually, as external MSAs and MRAs are likely superior to the
   2.245 -project's internal versions, the common user even gains functionality.
   2.246 -.P
   2.247 -Users of MH should not have problems to set up an external MSA and MRA.
   2.248 -Also, the popular MSAs and MRAs have large communities and a lot
   2.249 -of documentation available.
   2.250 -Choices for MSAs range from full-featured MTAs like
   2.251 -.I Postfix
   2.252 -over mid-size MTAs like
   2.253 -.I masqmail
   2.254 -and
   2.255 -.I dma
   2.256 -to small forwarders like
   2.257 -.I ssmtp
   2.258 -and
   2.259 -.I nullmailer .
   2.260 -Choices for MRAs include
   2.261 -.I fetchmail ,
   2.262 -.I getmail ,
   2.263 -.I mpop
   2.264 -and
   2.265 -.I fdm .
   2.266 -
   2.267 -
   2.268 -.H2 "Non-MUA Tools
   2.269 -.P
   2.270 -One goal of mmh is to remove the tools that are not part of the MUA's task.
   2.271 -Further more, any tools that don't improve the MUA's job significantly
   2.272 -should be removed.
   2.273 -Loosely related and rarely used tools distract from the lean appearance.
   2.274 -They require maintenance work without adding much to the core task.
   2.275 -By removing these tools, the project shall become more stream-lined
   2.276 -and focused.
   2.277 -In mmh the following tools are not available anymore:
   2.278 -.BU
   2.279 -.Pn conflict
   2.280 -was removed
   2.281 -.Ci 8b235097cbd11d728c07b966cf131aa7133ce5a9
   2.282 -because it is a mail system maintenance tool that is not MUA-related.
   2.283 -It even checked
   2.284 -.Fn /etc/passwd
   2.285 -and
   2.286 -.Fn /etc/group
   2.287 -for consistency, which is completely unrelated to email.
   2.288 -A tool like
   2.289 -.Pn conflict
   2.290 -is surely useful, but it should not be shipped with mmh.
   2.291 -.\" XXX historic reasons?
   2.292 -.BU
   2.293 -.Pn rcvtty
   2.294 -was removed
   2.295 -.Ci 14767c94b3827be7c867196467ed7aea5f6f49b0
   2.296 -because its use case of writing to the user's terminal
   2.297 -on receiving of mail is obsolete.
   2.298 -If users like to be informed of new mail, the shell's
   2.299 -.Ev MAILPATH
   2.300 -variable or graphical notifications are technically more appealing.
   2.301 -Writing directly to terminals is hardly ever wanted today.
   2.302 -If though one wants to have it this way, the standard tool
   2.303 -.Pn write
   2.304 -can be used in a way similar to:
   2.305 -.VS
   2.306 -scan -file - | write `id -un`
   2.307 -VE
   2.308 -.BU
   2.309 -.Pn viamail
   2.310 -was removed
   2.311 -.Ci eda72d6a7a7c20ff123043fb7f19c509ea01f932
   2.312 -when the new attachment system was activated, because
   2.313 -.Pn forw
   2.314 -could then cover the task itself.
   2.315 -The program
   2.316 -.Pn sendfiles
   2.317 -was rewritten as a shell script wrapper around
   2.318 -.Pn forw .
   2.319 -.Ci 0e82199cf3c991a173e0ac8aa776efdb3ded61e6
   2.320 -.BU
   2.321 -.Pn msgchk
   2.322 -was removed
   2.323 -.Ci bb9360ead7eb7a3fedcce2eeedfc660014e41dbe ,
   2.324 -because it lost its use case when POP support was removed.
   2.325 -A call to
   2.326 -.Pn msgchk
   2.327 -provided hardly more information than:
   2.328 -.VS
   2.329 -ls -l /var/mail/meillo
   2.330 -VE
   2.331 -It did distinguish between old and new mail, but
   2.332 -this detail information can be retrieved with
   2.333 -.Pn stat (1),
   2.334 -too.
   2.335 -A small shell script could be written to print the information
   2.336 -in a similar way, if truly necessary.
   2.337 -As mmh's
   2.338 -.Pn inc
   2.339 -only incorporates mail from the user's local maildrop,
   2.340 -and thus no data transfers over slow networks are involved,
   2.341 -there's hardly any need to check for new mail before incorporating it.
   2.342 -.BU
   2.343 -.Pn msh
   2.344 -was removed
   2.345 -.Ci 916690191222433a6923a4be54b0d8f6ac01bd02
   2.346 -because the tool was in conflict with the philosophy of MH.
   2.347 -It provided an interactive shell to access the features of MH,
   2.348 -but it wasn't just a shell, tailored to the needs of mail handling.
   2.349 -Instead it was one large program that had several MH tools built in.
   2.350 -This conflicts with the major feature of MH of being a tool chest.
   2.351 -.Pn msh 's
   2.352 -main use case had been accessing Bulletin Boards, which have seized to
   2.353 -be popular.
   2.354 -.P
   2.355 -Removing
   2.356 -.Pn msh ,
   2.357 -together with the truly archaic code relicts
   2.358 -.Pn vmh
   2.359 -and
   2.360 -.Pn wmh ,
   2.361 -saved more than 7\|000 lines of C code \(en
   2.362 -about 15\|% of the project's original source code amount.
   2.363 -Having less code \(en with equal readability, of course \(en
   2.364 -for the same functionality is an advantage.
   2.365 -Less code means less bugs and less maintenance work.
   2.366 -As
   2.367 -.Pn rcvtty
   2.368 -and
   2.369 -.Pn msgchk
   2.370 -are assumed to be rarely used and can be implemented in different ways,
   2.371 -why should one keep them?
   2.372 -Removing them stream-lines mmh.
   2.373 -.Pn viamail 's
   2.374 -use case is now partly obsolete and partly covered by
   2.375 -.Pn forw ,
   2.376 -hence there's no reason to still maintain it.
   2.377 -.Pn conflict
   2.378 -is not related to the mail client, and
   2.379 -.Pn msh
   2.380 -conflicts with the basic concept of MH.
   2.381 -Theses two tools might still be useful, but they should not be part of mmh.
   2.382 -.P
   2.383 -Finally, there's
   2.384 -.Pn slocal .
   2.385 -.Pn slocal
   2.386 -is an MDA and thus not directly MUA-related.
   2.387 -It should be removed from mmh, because including it conflicts with
   2.388 -the idea that mmh is a MUA only.
   2.389 -.Pn slocal
   2.390 -should rather become a separate project.
   2.391 -However,
   2.392 -.Pn slocal
   2.393 -provides rule-based processing of messages, like filing them into
   2.394 -different folders, which is otherwise not available in mmh.
   2.395 -Although
   2.396 -.Pn slocal
   2.397 -does neither pull in dependencies nor does it include a separate
   2.398 -technical area (cf. Sec. XXX), still,
   2.399 -it accounts for about 1\|000 lines of code that need to be maintained.
   2.400 -As
   2.401 -.Pn slocal
   2.402 -is almost self-standing, it should be split off into a separate project.
   2.403 -This would cut the strong connection between the MUA mmh and the MDA
   2.404 -.Pn slocal .
   2.405 -For anyone not using MH,
   2.406 -.Pn slocal
   2.407 -would become yet another independent MDA, like
   2.408 -.I procmail .
   2.409 -Then
   2.410 -.Pn slocal
   2.411 -could be installed without the complete MH system.
   2.412 -Likewise, mmh users could decide to use
   2.413 -.I procmail
   2.414 -without having a second, unused MDA,
   2.415 -.Pn slocal ,
   2.416 -installed.
   2.417 -That appears to be conceptionally the best solution.
   2.418 -Yet,
   2.419 -.Pn slocal
   2.420 -is not split off.
   2.421 -I defer the decision over
   2.422 -.Pn slocal
   2.423 -in need for deeper investigation.
   2.424 -In the meanwhile, it remains part of mmh.
   2.425 -That does not hurt because
   2.426 -.Pn slocal
   2.427 -is unrelated to the rest of the project.
   2.428 -
   2.429 -
   2.430 -.H2 "\fLshow\fP and \fPmhshow\fP
   2.431 -.P
   2.432 -Since the very beginning \(en already in the first concept paper \(en
   2.433 -.Pn show
   2.434 -had been MH's message display program.
   2.435 -.Pn show
   2.436 -mapped message numbers and sequences to files and invoked
   2.437 -.Pn mhl
   2.438 -to have the files formatted.
   2.439 -With MIME, this approach wasn't sufficient anymore.
   2.440 -MIME messages can consist of multiple parts. Some parts are not
   2.441 -directly displayable and text content might be encoded in
   2.442 -foreign charsets.
   2.443 -.Pn show 's
   2.444 -understanding of messages and
   2.445 -.Pn mhl 's
   2.446 -display capabilities couldn't cope with the task any longer.
   2.447 -.P
   2.448 -Instead of extending these tools, additional tools were written from
   2.449 -scratch and added to the MH tool chest.
   2.450 -Doing so is encouraged by the tool chest approach.
   2.451 -Modular design is a great advantage for extending a system,
   2.452 -as new tools can be added without interfering with existing ones.
   2.453 -First, the new MIME features were added in form of the single program
   2.454 -.Pn mhn .
   2.455 -The command
   2.456 -.Cl "mhn -show 42
   2.457 -would show the MIME message numbered 42.
   2.458 -With the 1.0 release of nmh in February 1999, Richard Coleman finished
   2.459 -the split of
   2.460 -.Pn mhn
   2.461 -into a set of specialized tools, which together covered the
   2.462 -multiple aspects of MIME.
   2.463 -One of them was
   2.464 -.Pn mhshow ,
   2.465 -which replaced
   2.466 -.Cl "mhn -show" .
   2.467 -It was capable of displaying MIME messages appropriately.
   2.468 -.P
   2.469 -From then on, two message display tools were part of nmh,
   2.470 -.Pn show
   2.471 -and
   2.472 -.Pn mhshow .
   2.473 -To ease the life of users,
   2.474 -.Pn show
   2.475 -was extended to automatically hand the job over to
   2.476 -.Pn mhshow
   2.477 -if displaying the message would be beyond
   2.478 -.Pn show 's
   2.479 -abilities.
   2.480 -In consequence, the user would simply invoke
   2.481 -.Pn show
   2.482 -(possibly through
   2.483 -.Pn next
   2.484 -or
   2.485 -.Pn prev )
   2.486 -and get the message printed with either
   2.487 -.Pn show
   2.488 -or
   2.489 -.Pn mhshow ,
   2.490 -whatever was more appropriate.
   2.491 -.P
   2.492 -Having two similar tools for essentially the same task is redundant.
   2.493 -Usually,
   2.494 -users wouldn't distinguish between
   2.495 -.Pn show
   2.496 -and
   2.497 -.Pn mhshow
   2.498 -in their daily mail reading.
   2.499 -Having two separate display programs was therefore mainly unnecessary
   2.500 -from a user's point of view.
   2.501 -Besides, the development of both programs needed to be in sync,
   2.502 -to ensure that the programs behaved in a similar way,
   2.503 -because they were used like a single tool.
   2.504 -Different behavior would have surprised the user.
   2.505 -.P
   2.506 -Today, non-MIME messages are rather seen to be a special case of
   2.507 -MIME messages, although it is the other way round.
   2.508 -As
   2.509 -.Pn mhshow
   2.510 -had already be able to display non-MIME messages, it appeared natural
   2.511 -to drop
   2.512 -.Pn show
   2.513 -in favor of using
   2.514 -.Pn mhshow
   2.515 -exclusively.
   2.516 -.Ci 4c1efddfd499300c7e74263e57d8aa137e84c853
   2.517 -Removing
   2.518 -.Pn show
   2.519 -is no loss in function, because functionally
   2.520 -.Pn mhshow
   2.521 -covers it completely.
   2.522 -The old behavior of
   2.523 -.Pn show
   2.524 -can still be emulated with the simple command line:
   2.525 -.VS
   2.526 -mhl `mhpath c`
   2.527 -VE
   2.528 -.P
   2.529 -For convenience,
   2.530 -.Pn mhshow
   2.531 -was renamed to
   2.532 -.Pn show
   2.533 -after
   2.534 -.Pn show
   2.535 -was gone.
   2.536 -It is clear that such a rename may confuse future developers when
   2.537 -trying to understand the history.
   2.538 -Nevertheless, I consider the convenience on the user's side,
   2.539 -to call
   2.540 -.Pn show
   2.541 -when they want a message to be displayed, to outweigh the inconvenience
   2.542 -on the developer's side when understanding the project history.
   2.543 -.P
   2.544 -To prepare for the transition,
   2.545 -.Pn mhshow
   2.546 -was reworked to behave more like
   2.547 -.Pn show
   2.548 -first.
   2.549 -(cf. Sec. XXX)
   2.550 -Once the tools behaved more alike, the replacing appeared to be
   2.551 -even more natural.
   2.552 -Today, mmh's new
   2.553 -.Pn show
   2.554 -became the one single message display program again, with the difference
   2.555 -that today it handles MIME messages as well as non-MIME messages.
   2.556 -The outcome of the transition is one program less to maintain,
   2.557 -no second display program for users to deal with,
   2.558 -and less system complexity.
   2.559 -.P
   2.560 -Still, removing the old
   2.561 -.Pn show
   2.562 -hurts in one regard: It had been such a simple program.
   2.563 -Its lean elegance is missing to the new
   2.564 -.Pn show .
   2.565 -But there is no chance;
   2.566 -supporting MIME demands for higher essential complexity.
   2.567 -
   2.568 -
   2.569 -.H2 "Configure Options
   2.570 -.P
   2.571 -Customization is a double-edged sword.
   2.572 -It allows better suiting setups, but not for free.
   2.573 -There is the cost of code complexity to be able to customize.
   2.574 -There is the cost of less tested setups, because there are
   2.575 -more possible setups and especially corner-cases.
   2.576 -And, there is the cost of choice itself.
   2.577 -The code complexity directly affects the developers.
   2.578 -Less tested code affects both, users and developers.
   2.579 -The problem of choice affects the users, for once by having to
   2.580 -choose, but also by more complex interfaces that require more documentation.
   2.581 -Whenever options add little advantages, they should be considered for
   2.582 -removal.
   2.583 -I have reduced the number of project-specific configure options from 
   2.584 -fifteen to three.
   2.585 -
   2.586 -.U3 "Mail Transfer Facilities
   2.587 -.P
   2.588 -With the removal of the mail transfer facilities five configure
   2.589 -options vanished:
   2.590 -.P
   2.591 -The switches
   2.592 -.Sw --with-tls
   2.593 -and
   2.594 -.Sw --with-cyrus-sasl
   2.595 -had activated the support for transfer encryption and authentication.
   2.596 -This is not needed anymore.
   2.597 -.Ci fecd5d34f65597a4dfa16aeabea7d74b191532c3
   2.598 -.Ci 156d35f6425bea4c1ed3c4c79783dc613379c65b
   2.599 -.P
   2.600 -The configure switch
   2.601 -.Sw --enable-pop
   2.602 -activated the message retrieval facility.
   2.603 -The code area that would be conditionally compiled in for TLS and SASL
   2.604 -support had been small.
   2.605 -The conditionally compiled code area for POP support had been much larger.
   2.606 -Whereas the code base changes would only slightly change on toggling
   2.607 -TLS or SASL support, it changed much on toggling POP support.
   2.608 -The changes in the code base could hardly be overviewed.
   2.609 -By having POP support togglable a second code base had been created,
   2.610 -one that needed to be tested.
   2.611 -This situation is basically similar for the conditional TLS and SASL  
   2.612 -code, but there the changes are minor and can yet be overviewed.
   2.613 -Still, conditional compilation of a code base creates variations
   2.614 -of the original program.
   2.615 -More variations require more testing and maintenance work.
   2.616 -.P
   2.617 -Two other options only specified default configuration values:
   2.618 -.Sw --with-mts
   2.619 -defined the default transport service, either
   2.620 -.Ar smtp
   2.621 -or
   2.622 -.Ar sendmail .
   2.623 -In mmh this fixed to
   2.624 -.Ar sendmail .
   2.625 -.Ci f6aa95b724fd8c791164abe7ee5468bf5c34f226
   2.626 -With
   2.627 -.Sw --with-smtpservers
   2.628 -default SMTP servers for the
   2.629 -.Ar smtp
   2.630 -transport service could be specified.
   2.631 -.Ci 128545e06224233b7e91fc4c83f8830252fe16c9
   2.632 -Both of them became irrelevant.
   2.633 -
   2.634 -.U3 "Backup Prefix
   2.635 -.P
   2.636 -The backup prefix is the string that was prepended to message
   2.637 -filenames to tag them as deleted.
   2.638 -By default it had been the comma character `\f(CW,\fP'.
   2.639 -In July 2000, Kimmo Suominen introduced
   2.640 -the configure option
   2.641 -.Sw --with-hash-backup
   2.642 -to change the default to the hash symbol `\f(CW#\fP'.
   2.643 -The choice was probably personal preference, because first, the
   2.644 -option was named
   2.645 -.Sw --with-backup-prefix.
   2.646 -and had the prefix symbol as argument.
   2.647 -But giving the hash symbol as argument caused too many problems
   2.648 -for Autoconf,
   2.649 -thus the option was limited to use the hash symbol as the default prefix.
   2.650 -This supports the assumption, that the choice for the hash was
   2.651 -personal preference only.
   2.652 -Being related or not, words that start with the hash symbol
   2.653 -introduce a comment in the Unix shell.
   2.654 -Thus, the command line
   2.655 -.Cl "rm #13 #15
   2.656 -calls
   2.657 -.Pn rm
   2.658 -without arguments because the first hash symbol starts the comment
   2.659 -that reaches until the end of the line.
   2.660 -To delete the backup files,
   2.661 -.Cl "rm ./#13 ./#15"
   2.662 -needs to be used.
   2.663 -Using the hash as backup prefix can be seen as a precaution against
   2.664 -data loss.
   2.665 -.P
   2.666 -I removed the configure option but added the profile entry
   2.667 -.Pe backup-prefix ,
   2.668 -which allows to specify an arbitrary string as backup prefix.
   2.669 -.Ci 6c40d481d661d532dd527eaf34cebb6d3f8ed086
   2.670 -Profile entries are the common method to change mmh's behavior.
   2.671 -This change did not remove the choice but moved it to a location where
   2.672 -it suited better.
   2.673 -.P
   2.674 -Eventually, however, the new trash folder concept
   2.675 -.Cf "Sec. XXX
   2.676 -obsoleted the concept of the backup prefix completely.
   2.677 -.Ci 8edc5aaf86f9f77124664f6801bc6c6cdf258173
   2.678 -.\" (Well, there still are corner-cases to remove until the backup
   2.679 -.\" prefix can be laid to rest, eventually.)
   2.680 -.\" FIXME: Do this work in the code!
   2.681 -
   2.682 -.U3 "Editor and Pager
   2.683 -.P
   2.684 -The two configure options
   2.685 -.CW --with-editor=EDITOR
   2.686 -.CW --with-pager=PAGER
   2.687 -were used to specify the default editor and pager at configure time.
   2.688 -Doing so at configure time made sense in the Eighties,
   2.689 -when the set of available editors and pagers varied much across
   2.690 -different systems.
   2.691 -Today, the situation is more homogeneous.
   2.692 -The programs
   2.693 -.Pn vi
   2.694 -and
   2.695 -.Pn more
   2.696 -can be expected to be available on every Unix system,
   2.697 -as they are specified by POSIX since two decades.
   2.698 -(The specifications for
   2.699 -.Pn vi
   2.700 -and
   2.701 -.Pn more
   2.702 -appeared in
   2.703 -.[
   2.704 -posix 1987
   2.705 -.]
   2.706 -and,
   2.707 -.[
   2.708 -posix 1992
   2.709 -.]
   2.710 -respectively.)
   2.711 -As a first step, these two tools were hard-coded as defaults.
   2.712 -.Ci 5d43a99db70c12a673028c7758c20cbe3e13ef5f
   2.713 -Not changed were the
   2.714 -.Pe editor
   2.715 -and
   2.716 -.Pe moreproc
   2.717 -profile entries, which allowed the user to override the system defaults.
   2.718 -Later, the concept was reworked to respect the standard environment
   2.719 -variables
   2.720 -.Ev VISUAL
   2.721 -and
   2.722 -.Ev PAGER
   2.723 -if they are set.
   2.724 -Today, mmh determines the editor to use in the following order,
   2.725 -taking the first available and non-empty item:
   2.726 -.IP (1)
   2.727 -Environment variable
   2.728 -.Ev MMHEDITOR
   2.729 -.IP (2)
   2.730 -Profile entry
   2.731 -.Pe Editor
   2.732 -.IP (3)
   2.733 -Environment variable
   2.734 -.Ev VISUAL
   2.735 -.IP (4)
   2.736 -Environment variable
   2.737 -.Ev EDITOR
   2.738 -.IP (5)
   2.739 -Command
   2.740 -.Pn vi .
   2.741 -.P
   2.742 -.Ci f85f4b7ae62e3d05a945dcd46ead51f0a2a89a9b
   2.743 -.P
   2.744 -The pager to use is determined in a similar order,
   2.745 -also taking the first available and non-empty item:
   2.746 -.IP (1)
   2.747 -Environment variable
   2.748 -.Ev MMHPAGER
   2.749 -.IP (2)
   2.750 -Profile entry
   2.751 -.Pe Pager
   2.752 -(replaces
   2.753 -.Pe moreproc )
   2.754 -.IP (3)
   2.755 -Environment variable
   2.756 -.Ev PAGER
   2.757 -.IP (4)
   2.758 -Command
   2.759 -.Pn more .
   2.760 -.P
   2.761 -.Ci 0c4214ea2aec6497d0d67b436bbee9bc1d225f1e
   2.762 -.P
   2.763 -By respecting the
   2.764 -.Ev VISUAL /\c
   2.765 -.Ev EDITOR
   2.766 -and
   2.767 -.Ev PAGER
   2.768 -environment variables,
   2.769 -the new behavior confirms better to the common style on Unix systems.
   2.770 -Additionally, the new approach is more uniform and clearer to users.
   2.771 -
   2.772 -
   2.773 -.U3 "ndbm
   2.774 -.P
   2.775 -.Pn slocal
   2.776 -used to depend on
   2.777 -.I ndbm ,
   2.778 -a database library.
   2.779 -The database is used to store the `\fLMessage-ID\fP's of all
   2.780 -messages delivered.
   2.781 -This enables
   2.782 -.Pn slocal
   2.783 -to suppress delivering the same message to the same user twice.
   2.784 -(This features was enabled by the
   2.785 -.Sw -suppressdup
   2.786 -switch.)
   2.787 -.P
   2.788 -A variety of versions of the database library exist.
   2.789 -.[
   2.790 -wolter unix incompat notes dbm
   2.791 -.]
   2.792 -Complicated autoconf code was needed to detect them correctly.
   2.793 -Further more, the configure switches
   2.794 -.Sw --with-ndbm=ARG
   2.795 -and
   2.796 -.Sw --with-ndbmheader=ARG
   2.797 -were added to help with difficult setups that would
   2.798 -not be detected automatically or correctly.
   2.799 -.P
   2.800 -By removing the suppress duplicates feature of
   2.801 -.Pn slocal ,
   2.802 -the dependency on
   2.803 -.I ndbm
   2.804 -vanished and 120 lines of complex autoconf code could be saved.
   2.805 -.Ci ecd6d6a20cb7a1507e3a20d6c4cb3a1cf14c6bbf
   2.806 -The change removed functionality too, but that is minor to the
   2.807 -improvement by dropping the dependency and the complex autoconf code.
   2.808 -
   2.809 -.U3 "mh-e Support
   2.810 -.P
   2.811 -The configure option
   2.812 -.Sw --disable-mhe
   2.813 -was removed when the mh-e support was reworked. 
   2.814 -Mh-e is the Emacs front-end to MH.
   2.815 -It requires MH to provide minor additional functions.
   2.816 -The
   2.817 -.Sw --disable-mhe
   2.818 -configure option could switch these extensions off.
   2.819 -After removing the support for old versions of mh-e,
   2.820 -only the
   2.821 -.Sw -build
   2.822 -switches of
   2.823 -.Pn forw
   2.824 -and
   2.825 -.Pn repl
   2.826 -are left to be mh-e extensions.
   2.827 -They are now always built in because they add little code and complexity.
   2.828 -In consequence, the
   2.829 -.Sw --disable-mhe
   2.830 -configure option was removed
   2.831 -.Ci a7ce7b4a580d77b6c2c4d980812beb589aa4c643
   2.832 -Removing the option removed a second code setup that would have
   2.833 -needed to be tested.
   2.834 -This change was first done in nmh and thereafter merged into mmh.
   2.835 -.P
   2.836 -The interface changes in mmh require mh-e to be adjusted in order
   2.837 -to be able to use mmh as back-end.
   2.838 -This will require minor changes to mh-e, but removing the
   2.839 -.Sw -build
   2.840 -switches would require more rework.
   2.841 -
   2.842 -.U3 "Masquerading
   2.843 -.P
   2.844 -The configure option
   2.845 -.Sw --enable-masquerade
   2.846 -could take up to three arguments:
   2.847 -`draft_from', `mmailid', and `username_extension'.
   2.848 -They activated different types of address masquerading.
   2.849 -All of them were implemented in the SMTP-speaking
   2.850 -.Pn post
   2.851 -command, which provided an MSA.
   2.852 -Address masquerading is an MTA's task and mmh does not cover
   2.853 -this field anymore.
   2.854 -Hence, true masquerading needs to be implemented in the external MTA.
   2.855 -.P
   2.856 -The
   2.857 -.I mmailid
   2.858 -masquerading type is the oldest one of the three and the only one
   2.859 -available in the original MH.
   2.860 -It provided a
   2.861 -.I username
   2.862 -to
   2.863 -.I fakeusername
   2.864 -mapping, based on the password file's GECOS field.
   2.865 -The man page
   2.866 -.Mp mh-tailor(5)
   2.867 -described the use case as being the following:
   2.868 -.QS
   2.869 -This is useful if you want the messages you send to always
   2.870 -appear to come from the name of an MTA alias rather than your
   2.871 -actual account name.  For instance, many organizations set up
   2.872 -`First.Last' sendmail aliases for all users.  If this is
   2.873 -the case, the GECOS field for each user should look like:
   2.874 -``First [Middle] Last <First.Last>''
   2.875 -.QE
   2.876 -.P
   2.877 -As mmh sends outgoing mail via the local MTA only,
   2.878 -the best location to do such global rewrites is there.
   2.879 -Besides, the MTA is conceptionally the right location because it
   2.880 -does the reverse mapping for incoming mail (aliasing), too.
   2.881 -Further more, masquerading set up there is readily available for all
   2.882 -mail software on the system.
   2.883 -Hence, mmailid masquerading was removed.
   2.884 -.Ci 0836c8000ccb34b59410ef1c15b1b7feac70ce5f
   2.885 -.P
   2.886 -The
   2.887 -.I username_extension
   2.888 -masquerading type did not replace the username but would append a suffix,
   2.889 -specified by the
   2.890 -.Ev USERNAME_EXTENSION
   2.891 -environment variable, to it.
   2.892 -This provided support for the
   2.893 -.I user-extension
   2.894 -feature of qmail and the similar
   2.895 -.I "plussed user
   2.896 -processing of sendmail.
   2.897 -The decision to remove this username_extension masquerading was
   2.898 -motivated by the fact that
   2.899 -.Pn spost
   2.900 -hadn't supported it already.
   2.901 -.Ci 2abae0bfd0ad5bf898461e50aa4b466d641f23d9
   2.902 -Username extensions are possible in mmh, but less convenient to use.
   2.903 -.\" XXX format file %(getenv USERNAME_EXTENSION)
   2.904 -.P
   2.905 -The
   2.906 -.I draft_from
   2.907 -masquerading type instructed
   2.908 -.Pn post
   2.909 -to use the value of the
   2.910 -.Hd From
   2.911 -header field as SMTP envelope sender.
   2.912 -Sender addresses could be replaced completely.
   2.913 -.Ci b14ea6073f77b4359aaf3fddd0e105989db9
   2.914 -Mmh offers a kind of masquerading similar in effect, but
   2.915 -with technical differences.
   2.916 -As mmh does not transfer messages itself, the local MTA has final control
   2.917 -over the sender's address. Any masquerading mmh introduces may be reverted
   2.918 -by the MTA.
   2.919 -In times of pedantic spam checking, an MTA will take care to use
   2.920 -sensible envelope sender addresses to keep its own reputation up.
   2.921 -Nonetheless, the MUA can set the
   2.922 -.Hd From
   2.923 -header field and thereby propose
   2.924 -a sender address to the MTA.
   2.925 -The MTA may then decide to take that one or generate the canonical sender
   2.926 -address for use as envelope sender address.
   2.927 -.P
   2.928 -In mmh, the MTA will always extract the recipient and sender from the
   2.929 -message header (\c
   2.930 -.Pn sendmail 's
   2.931 -.Sw -t
   2.932 -switch).
   2.933 -The
   2.934 -.Hd From
   2.935 -header field of the draft may be set arbitrary by the user.
   2.936 -If it is missing, the canonical sender address will be generated by the MTA.
   2.937 -
   2.938 -.U3 "Remaining Options
   2.939 -.P
   2.940 -Two configure options remain in mmh.
   2.941 -One is the locking method to use:
   2.942 -.Sw --with-locking=[dot|fcntl|flock|lockf] .
   2.943 -The idea of removing all methods except the portable dot locking
   2.944 -and having that one as the default is appealing, but this change
   2.945 -requires deeper technical investigation into the topic.
   2.946 -The other option,
   2.947 -.Sw --enable-debug ,
   2.948 -compiles the programs with debugging symbols and does not strip them.
   2.949 -This option is likely to stay.
   2.950 -
   2.951 -
   2.952 -
   2.953 -
   2.954 -.H2 "Command Line Switches
   2.955 -.P
   2.956 -The command line switches of MH tools follow the X Window style.
   2.957 -They are words, introduced by a single dash.
   2.958 -For example:
   2.959 -.Cl "-truncate" .
   2.960 -Every program in mmh has two generic switches:
   2.961 -.Sw -help ,
   2.962 -to print a short message on how to use the program, and 
   2.963 -.Sw -Version ,
   2.964 -to tell what version of mmh the program belongs to.
   2.965 -.P
   2.966 -Switches change the behavior of programs.
   2.967 -Programs that do one thing in one way require no switches.
   2.968 -In most cases, doing something in exactly one way is too limiting.
   2.969 -If there is basically one task to accomplish, but it should be done
   2.970 -in various ways, switches are a good approach to alter the behavior
   2.971 -of a program.
   2.972 -Changing the behavior of programs provides flexibility and customization
   2.973 -to users, but at the same time it complicates the code, documentation and
   2.974 -usage of the program.
   2.975 -.\" XXX: Ref
   2.976 -Therefore, the number of switches should be kept small.
   2.977 -A small set of well-chosen switches does no harm.
   2.978 -But usually, the number of switches increases over time.
   2.979 -Already in 1985, Rose and Romine have identified this as a major
   2.980 -problem of MH:
   2.981 -.[ [
   2.982 -rose romine real work
   2.983 -.], p. 12]
   2.984 -.QS
   2.985 -A complaint often heard about systems which undergo substantial development
   2.986 -by many people over a number of years, is that more and more options are
   2.987 -introduced which add little to the functionality but greatly increase the
   2.988 -amount of information a user needs to know in order to get useful work done.
   2.989 -This is usually referred to as creeping featurism.
   2.990 -.QP
   2.991 -Unfortunately MH, having undergone six years of off-and-on development by
   2.992 -ten or so well-meaning programmers (the present authors included),
   2.993 -suffers mightily from this.
   2.994 -.QE
   2.995 -.P
   2.996 -Being reluctant to adding new switches \(en or `options',
   2.997 -as Rose and Romine call them \(en is one part of a counter-action,
   2.998 -the other part is removing hardly used switches.
   2.999 -Nmh's tools had lots of switches already implemented,
  2.1000 -hence, cleaning up by removing some of them was the more important part
  2.1001 -of the counter-action.
  2.1002 -Removing existing functionality is always difficult because it
  2.1003 -breaks programs that use these functions.
  2.1004 -Also, for every obsolete feature, there'll always be someone who still
  2.1005 -uses it and thus opposes its removal.
  2.1006 -This puts the developer into the position,
  2.1007 -where sensible improvements to style are regarded as destructive acts.
  2.1008 -Yet, living with the featurism is far worse, in my eyes, because
  2.1009 -future needs will demand adding further features,
  2.1010 -worsening the situation more and more.
  2.1011 -Rose and Romine added in a footnote,
  2.1012 -``[...]
  2.1013 -.Pn send
  2.1014 -will no doubt acquire an endless number of switches in the years to come.''
  2.1015 -Although clearly humorous, the comment points to the nature of the problem.
  2.1016 -Refusing to add any new switches would encounter the problem at its root,
  2.1017 -but this is not practical.
  2.1018 -New needs will require new switches and it would be unwise to block
  2.1019 -them strictly.
  2.1020 -Nevertheless, removing obsolete switches still is an effective approach
  2.1021 -to deal with the problem.
  2.1022 -Working on an experimental branch without an established user base,
  2.1023 -eased my work because I did not offend users when I removed existing
  2.1024 -funtions.
  2.1025 -.P
  2.1026 -Rose and Romine counted 24 visible and 9 more hidden switches for
  2.1027 -.Pn send .
  2.1028 -In nmh, they increased up to 32 visible and 12 hidden ones.
  2.1029 -At the time of writing, no more than 7 visible switches and 1 hidden switch
  2.1030 -have remained in mmh's
  2.1031 -.Pn send .
  2.1032 -(These numbers include two generic switches, help and version.)
  2.1033 -.P
  2.1034 -Fig. XXX
  2.1035 -.\" XXX Ref
  2.1036 -displays the number of switches for each of the tools that is available
  2.1037 -in both, nmh and mmh.
  2.1038 -The tools are sorted by the number of switches they had in nmh.
  2.1039 -Visible and hidden switches were counted,
  2.1040 -but not the generic help and version switches.
  2.1041 -Whereas in the beginning of the project, the average tool had 11 switches,
  2.1042 -now it has no more than 5 \(en only half as many.
  2.1043 -If the `no' switches and similar inverse variant are folded onto
  2.1044 -their counter-parts, the average tool had 8 switches in pre-mmh times and
  2.1045 -has 4 now.
  2.1046 -The total number of functional switches in mmh dropped from 465
  2.1047 -to 234.
  2.1048 -
  2.1049 -.KS
  2.1050 -.in 1c
  2.1051 -.so input/switches.grap
  2.1052 -.KE
  2.1053 -
  2.1054 -.P
  2.1055 -A part of the switches vanished after functions were removed.
  2.1056 -This was the case for network mail transfer, for instance.
  2.1057 -Sometimes, however, the work flow was the other way:
  2.1058 -I looked through the
  2.1059 -.Mp mh-chart (7)
  2.1060 -man page to identify the tools with apparently too many switches.
  2.1061 -Then considering the value of each of the switches by examining
  2.1062 -the tool's man page and source code, aided by recherche and testing.
  2.1063 -This way, the removal of functions was suggested by the aim to reduce
  2.1064 -the number of switches per command.
  2.1065 -
  2.1066 -
  2.1067 -.U3 "Draft Folder Facility
  2.1068 -.P
  2.1069 -A change early in the project was the complete transition from
  2.1070 -the single draft message to the draft folder facility.
  2.1071 -.Ci 337338b404931f06f0db2119c9e145e8ca5a9860
  2.1072 -The draft folder facility was introduced in the mid-Eighties, when
  2.1073 -Rose and Romine called it a ``relatively new feature''.
  2.1074 -.[
  2.1075 -rose romine real work
  2.1076 -.]
  2.1077 -Since then, the facility had existed but was deactivated by default.
  2.1078 -The default activation and the related rework of the tools made it
  2.1079 -possible to remove the
  2.1080 -.Sw -[no]draftfolder ,
  2.1081 -and
  2.1082 -.Sw -draftmessage
  2.1083 -switches from
  2.1084 -.Pn comp ,
  2.1085 -.Pn repl ,
  2.1086 -.Pn forw ,
  2.1087 -.Pn dist ,
  2.1088 -.Pn whatnow ,
  2.1089 -and
  2.1090 -.Pn send .
  2.1091 -.Ci 337338b404931f06f0db2119c9e145e8ca5a9860
  2.1092 -The only flexibility removed with this change is having multiple
  2.1093 -draft folders within one profile.
  2.1094 -I consider this a theoretical problem only.
  2.1095 -In the same go, the
  2.1096 -.Sw -draft
  2.1097 -switch of
  2.1098 -.Pn anno ,
  2.1099 -.Pn refile ,
  2.1100 -and
  2.1101 -.Pn send
  2.1102 -was removed.
  2.1103 -The special-casing of `the' draft message became irrelevant after
  2.1104 -the rework of the draft system.
  2.1105 -(See Sec. XXX.)
  2.1106 -Equally,
  2.1107 -.Pn comp
  2.1108 -lost its
  2.1109 -.Sw -file
  2.1110 -switch.
  2.1111 -The draft folder facility, together with the
  2.1112 -.Sw -form
  2.1113 -switch, are sufficient.
  2.1114 -
  2.1115 -
  2.1116 -.U3 "In Place Editing
  2.1117 -.P
  2.1118 -.Pn anno
  2.1119 -had the switches
  2.1120 -.Sw -[no]inplace
  2.1121 -to either annotate the message in place and thus preserve hard links,
  2.1122 -or annotate a copy to replace the original message, breaking hard links.
  2.1123 -Following the assumption that linked messages should truly be the
  2.1124 -same message, and annotating it should not break the link, the
  2.1125 -.Sw -[no]inplace
  2.1126 -switches were removed and the previous default
  2.1127 -.Sw -inplace
  2.1128 -was made the only behavior.
  2.1129 -.Ci c8195849d2e366c569271abb0f5f60f4ebf0b4d0
  2.1130 -The
  2.1131 -.Sw -[no]inplace
  2.1132 -switches of
  2.1133 -.Pn repl ,
  2.1134 -.Pn forw ,
  2.1135 -and
  2.1136 -.Pn dist
  2.1137 -could be removed, too, as they were simply passed through to
  2.1138 -.Pn anno .
  2.1139 -.P
  2.1140 -.Pn burst
  2.1141 -also had
  2.1142 -.Sw -[no]inplace
  2.1143 -switches, but with different meaning.
  2.1144 -With
  2.1145 -.Sw -inplace ,
  2.1146 -the digest had been replaced by the table of contents (i.e. the
  2.1147 -introduction text) and the bursted messages were placed right
  2.1148 -after this message, renumbering all following messages.
  2.1149 -Also, any trailing text of the digest was lost, though,
  2.1150 -in practice, it usually consists of an end-of-digest marker only.
  2.1151 -Nontheless, this behavior appeared less elegant than the
  2.1152 -.Sw -noinplace
  2.1153 -behavior, which already had been the default.
  2.1154 -Nmh's
  2.1155 -.Mp burst (1)
  2.1156 -man page reads:
  2.1157 -.sp \n(PDu
  2.1158 -.QS
  2.1159 -If -noinplace is given, each digest is preserved, no table
  2.1160 -of contents is produced, and the messages contained within
  2.1161 -the digest are placed at the end of the folder. Other messages
  2.1162 -are not tampered with in any way.
  2.1163 -.QE
  2.1164 -.LP
  2.1165 -The decision to drop the
  2.1166 -.Sw -inplace
  2.1167 -behavior was supported by the code complexity and the possible data loss
  2.1168 -it caused.
  2.1169 -.Sw -noinplace
  2.1170 -was chosen to be the definitive behavior.
  2.1171 -.Ci 68a686adeb39223a5e1ad35e4a24890ec053679d
  2.1172 -
  2.1173 -
  2.1174 -.U3 "Forms and Format Strings
  2.1175 -.P
  2.1176 -Historically, the tools that had
  2.1177 -.Sw -form
  2.1178 -switches to supply a form file had
  2.1179 -.Sw -format
  2.1180 -switches as well to supply the contents of a form file as a string
  2.1181 -on the command line directly.
  2.1182 -In consequence, the following two lines equaled:
  2.1183 -.VS
  2.1184 -scan -form scan.mailx
  2.1185 -scan -format "`cat .../scan.mailx`"
  2.1186 -VE
  2.1187 -The
  2.1188 -.Sw -format
  2.1189 -switches were dropped in favor for extending the
  2.1190 -.Sw -form
  2.1191 -switches.
  2.1192 -.Ci f51956be123db66b00138f80464d06f030dbb88d
  2.1193 -If their argument starts with an equal sign (`='),
  2.1194 -then the rest of the argument is taken as a format string,
  2.1195 -otherwise the arguments is treated as the name of a format file.
  2.1196 -Thus, now the following two lines equal:
  2.1197 -.VS
  2.1198 -scan -form scan.mailx
  2.1199 -scan -form "=`cat .../scan.mailx`"
  2.1200 -VE
  2.1201 -This rework removed the prefix collision between
  2.1202 -.Sw -form
  2.1203 -and
  2.1204 -.Sw -format .
  2.1205 -Now, typing
  2.1206 -.Sw -fo
  2.1207 -suffices to specify form or format string.
  2.1208 -.P
  2.1209 -The different meaning of
  2.1210 -.Sw -format
  2.1211 -for
  2.1212 -.Pn repl
  2.1213 -and
  2.1214 -.Pn forw
  2.1215 -was removed in mmh.
  2.1216 -.Pn forw
  2.1217 -was completely switched to MIME-type forwarding, thus removing the
  2.1218 -.Sw -[no]format .
  2.1219 -.Ci 6e271608b7b9c23771523f88d23a4d3593010cf1
  2.1220 -For
  2.1221 -.Pn repl ,
  2.1222 -the
  2.1223 -.Sw -[no]format
  2.1224 -switches were reworked to
  2.1225 -.Sw -[no]filter
  2.1226 -switches.
  2.1227 -.Ci 67411b1f95d6ec987b4c732459e1ba8a8ac192c6
  2.1228 -The
  2.1229 -.Sw -format
  2.1230 -switches of
  2.1231 -.Pn send
  2.1232 -and
  2.1233 -.Pn post ,
  2.1234 -which had a third meaning,
  2.1235 -were removed likewise.
  2.1236 -.Ci f3cb7cde0e6f10451b6848678d95860d512224b9
  2.1237 -Eventually, the ambiguity of the
  2.1238 -.Sw -format
  2.1239 -switches was resolved by not anymore having any such switch in mmh.
  2.1240 -
  2.1241 -
  2.1242 -.U3 "MIME Tools
  2.1243 -.P
  2.1244 -The MIME tools, which were once part of
  2.1245 -.Pn mhn
  2.1246 -[sic!],
  2.1247 -had several switches that added little practical value to the programs.
  2.1248 -The
  2.1249 -.Sw -[no]realsize
  2.1250 -switches of
  2.1251 -.Pn mhbuild
  2.1252 -and
  2.1253 -.Pn mhlist
  2.1254 -were removed, doing real size calculations always now
  2.1255 -.Ci 8d8f1c3abc586c005c904e52c4adbfe694d2201c ,
  2.1256 -as
  2.1257 -``This provides an accurate count at the expense of a small delay.''
  2.1258 -This small delay is not noticable on modern systems.
  2.1259 -.P
  2.1260 -The
  2.1261 -.Sw -[no]check
  2.1262 -switches were removed together with the support for
  2.1263 -.Hd Content-MD5
  2.1264 -header fields.
  2.1265 -.[
  2.1266 -rfc 1864
  2.1267 -.]
  2.1268 -.Ci 31dc797eb5178970d68962ca8939da3fd9a8efda
  2.1269 -(See Sec. XXX)
  2.1270 -.P
  2.1271 -The
  2.1272 -.Sw -[no]ebcdicsafe
  2.1273 -and
  2.1274 -.Sw -[no]rfc934mode
  2.1275 -switches of
  2.1276 -.Pn mhbuild
  2.1277 -were removed because they are considered obsolete.
  2.1278 -.Ci 01a3480928da485b4d6109d36d751dfa71799d58
  2.1279 -.Ci 3363e2624dce0eb8164cf8b3f1ab385c8ff72e88
  2.1280 -.P
  2.1281 -Content caching of external MIME parts, activated with the
  2.1282 -.Sw -rcache
  2.1283 -and
  2.1284 -.Sw -wcache
  2.1285 -switches was completely removed.
  2.1286 -.Ci d1fefd9f614e4dc3cda16da6c69133c1b2005269
  2.1287 -External MIME parts are rare today, having a caching facility
  2.1288 -for them is appears to be unnecessary.
  2.1289 -.P
  2.1290 -In pre-MIME times,
  2.1291 -.Pn mhl
  2.1292 -had covered many tasks that are part of MIME handling today.
  2.1293 -Therefore,
  2.1294 -.Pn mhl
  2.1295 -could be simplified to a large extend, reducing the number of its
  2.1296 -switches from 21 to 6.
  2.1297 -.Ci 350ad6d3542a07639213cf2a4fe524e829c1e7b6
  2.1298 -.Ci 0e46503be3c855bddaeae3843e1b659279c35d70
  2.1299 -
  2.1300 -
  2.1301 -.U3 "Mail Transfer Switches
  2.1302 -.P
  2.1303 -With the removal of the mail transfer facilities, a lot of switches
  2.1304 -vanished automatically.
  2.1305 -.Pn inc
  2.1306 -lost 9 switches, namely
  2.1307 -.Sw -host ,
  2.1308 -.Sw -port ,
  2.1309 -.Sw -user ,
  2.1310 -.Sw -proxy ,
  2.1311 -.Sw -snoop ,
  2.1312 -.Sw -[no]pack ,
  2.1313 -as well as
  2.1314 -.Sw -sasl
  2.1315 -and
  2.1316 -.Sw -saslmech .
  2.1317 -.Pn send
  2.1318 -and
  2.1319 -.Pn post 
  2.1320 -lost 11 switches each, namely
  2.1321 -.Sw -server ,
  2.1322 -.Sw -port ,
  2.1323 -.Sw -client ,
  2.1324 -.Sw -user ,
  2.1325 -.Sw -mail ,
  2.1326 -.Sw -saml ,
  2.1327 -.Sw -send ,
  2.1328 -.Sw -soml ,
  2.1329 -.Sw -snoop ,
  2.1330 -as well as
  2.1331 -.Sw -sasl ,
  2.1332 -.Sw -saslmech ,
  2.1333 -and
  2.1334 -.Sw -tls .
  2.1335 -.Pn send
  2.1336 -had the switches only to pass them further to
  2.1337 -.Pn post ,
  2.1338 -because the user would invoke
  2.1339 -.Pn post
  2.1340 -not directly, but through
  2.1341 -.Pn send .
  2.1342 -All these switches, except
  2.1343 -.Sw -snoop
  2.1344 -were usually defined as default switches in the user's profile,
  2.1345 -but hardly given in interactive usage.
  2.1346 -.P
  2.1347 -Of course, those switches did not really ``vanish'', but the configuration
  2.1348 -they did was handed over to external MSAs and MRAs.
  2.1349 -Instead of setting up the mail transfer in mmh, it is set up in
  2.1350 -external tools.
  2.1351 -Yet, this simplifies mmh.
  2.1352 -Specialized external tools will likely have simple configuration files.
  2.1353 -Hence, instead of having one complicated central configuration file,
  2.1354 -the configuration of each domain is separate.
  2.1355 -Although the user needs to learn to configure each of the tools,
  2.1356 -each configuration is likely much simpler.
  2.1357 -
  2.1358 -
  2.1359 -.U3 "Maildrop Formats
  2.1360 -.P
  2.1361 -With the removal of MMDF maildrop format support,
  2.1362 -.Pn packf
  2.1363 -and
  2.1364 -.Pn rcvpack
  2.1365 -no longer needed their
  2.1366 -.Sw -mbox
  2.1367 -and
  2.1368 -.Sw -mmdf
  2.1369 -switches.
  2.1370 -.Sw -mbox
  2.1371 -is the sole  behavior now.
  2.1372 -.Ci 3916ab66ad5d183705ac12357621ea8661afd3c0
  2.1373 -In the same go,
  2.1374 -.Pn packf
  2.1375 -and
  2.1376 -.Pn rcvpack
  2.1377 -were reworked (see Sec. XXX) and their
  2.1378 -.Sw -file
  2.1379 -switch became unnecessary.
  2.1380 -.Ci ca1023716d4c2ab890696f3e41fa0d94267a940e
  2.1381 -
  2.1382 -
  2.1383 -.U3 "Terminal Magic
  2.1384 -.P
  2.1385 -Mmh's tools will no longer clear the screen (\c
  2.1386 -.Pn scan 's
  2.1387 -and
  2.1388 -.Pn mhl 's
  2.1389 -.Sw -[no]clear
  2.1390 -switches
  2.1391 -.Ci e57b17343dcb3ff373ef4dd089fbe778f0c7c270
  2.1392 -.Ci 943765e7ac5693ae177fd8d2b5a2440e53ce816e ).
  2.1393 -Neither will
  2.1394 -.Pn mhl
  2.1395 -ring the bell (\c
  2.1396 -.Sw -[no]bell
  2.1397 -.Ci e11983f44e59d8de236affa5b0d0d3067c192e24 )
  2.1398 -nor page the output itself (\c
  2.1399 -.Sw -length
  2.1400 -.Ci 5b9d883db0318ed2b84bb82dee880d7381f99188 ).
  2.1401 -.P
  2.1402 -Generally, the pager to use is no longer specified with the
  2.1403 -.Sw -[no]moreproc
  2.1404 -command line switches for
  2.1405 -.Pn mhl
  2.1406 -and
  2.1407 -.Pn show /\c
  2.1408 -.Pn mhshow .
  2.1409 -.Ci 39e87a75b5c2d3572ec72e717720b44af291e88a
  2.1410 -.P
  2.1411 -.Pn prompter
  2.1412 -lost its
  2.1413 -.Sw -erase
  2.1414 -and
  2.1415 -.Sw -kill
  2.1416 -switches because today the terminal cares for the line editing keys.
  2.1417 -
  2.1418 -
  2.1419 -.U3 "Header Printing
  2.1420 -.P
  2.1421 -.Pn folder 's
  2.1422 -data output is self-explaining enough that
  2.1423 -displaying the header line makes few sense.
  2.1424 -Hence, the
  2.1425 -.Sw -[no]header
  2.1426 -switch was removed and headers are never printed.
  2.1427 -.Ci 601cc73d1fa05ce96faa728f036d6c51b91701c7
  2.1428 -.P
  2.1429 -In
  2.1430 -.Pn mhlist ,
  2.1431 -the
  2.1432 -.Sw -[no]header
  2.1433 -switches were removed, too.
  2.1434 -.Ci b24f96523aaf60e44e04a3ffb1d22e69a13a602f
  2.1435 -But in this case headers are always printed,
  2.1436 -because the output is not self-explaining.
  2.1437 -.P
  2.1438 -.Pn scan
  2.1439 -also had
  2.1440 -.Sw -[no]header
  2.1441 -switches.
  2.1442 -Printing the header had been sensible until the introduction of
  2.1443 -format strings made it impossible to display the column headings.
  2.1444 -Only the folder name and the current date remained to be printed.
  2.1445 -As this information can be perfectly retrieved by
  2.1446 -.Pn folder
  2.1447 -and
  2.1448 -.Pn date ,
  2.1449 -consequently, the switches were removed.
  2.1450 -.Ci c477dc5d1d03fa6d9a8ab3dd3508c63cbddc044e
  2.1451 -.P
  2.1452 -By removing all
  2.1453 -.Sw -header
  2.1454 -switches, the collision with
  2.1455 -.Sw -help
  2.1456 -on the first two letters was resolved.
  2.1457 -Currently,
  2.1458 -.Sw -h
  2.1459 -evaluates to
  2.1460 -.Sw -help
  2.1461 -for all tools of mmh.
  2.1462 -
  2.1463 -
  2.1464 -.U3 "Suppressing Edits or the WhatNow Shell
  2.1465 -.P
  2.1466 -The
  2.1467 -.Sw -noedit
  2.1468 -switch of
  2.1469 -.Pn comp ,
  2.1470 -.Pn repl ,
  2.1471 -.Pn forw ,
  2.1472 -.Pn dist ,
  2.1473 -and
  2.1474 -.Pn whatnow
  2.1475 -was removed, but it can now be replaced by specifying
  2.1476 -.Sw -editor
  2.1477 -with an empty argument.
  2.1478 -.Ci 75fca31a5b9d5c1a99c74ab14c94438d8852fba9
  2.1479 -(Specifying
  2.1480 -.Cl "-editor true
  2.1481 -is nearly the same, only differing by the previous editor being set.)
  2.1482 -.P
  2.1483 -The more important change is the removal of the
  2.1484 -.Sw -nowhatnowproc
  2.1485 -switch.
  2.1486 -.Ci ee4f43cf2ef0084ec698e4e87159a94c01940622
  2.1487 -This switch had introduced an awkward behavior, as explained in nmh's
  2.1488 -man page for
  2.1489 -.Mp comp (1):
  2.1490 -.QS
  2.1491 -The \-editor editor switch indicates the editor to use for
  2.1492 -the initial edit. Upon exiting from the editor, comp will
  2.1493 -invoke the whatnow program. See whatnow(1) for a discussion
  2.1494 -of available options. The invocation of this program can be
  2.1495 -inhibited by using the \-nowhatnowproc switch. (In truth of
  2.1496 -fact, it is the whatnow program which starts the initial
  2.1497 -edit. Hence, \-nowhatnowproc will prevent any edit from
  2.1498 -occurring.)
  2.1499 -.QE
  2.1500 -.P
  2.1501 -Effectively, the
  2.1502 -.Sw -nowhatnowproc
  2.1503 -switch creates only a draft message.
  2.1504 -As
  2.1505 -.Cl "-whatnowproc true
  2.1506 -causes the same behavior, the
  2.1507 -.Sw -nowhatnowproc
  2.1508 -switch was removed for being redundant.
  2.1509 -Likely, the
  2.1510 -.Sw -nowhatnowproc
  2.1511 -switch was intended to be used by front-ends.
  2.1512 -
  2.1513 -
  2.1514 -.U3 "Compatibility Switches
  2.1515 -.BU
  2.1516 -The hidden
  2.1517 -.Sw -[no]total
  2.1518 -switches of
  2.1519 -.Pn flist .
  2.1520 -They were simply the inverse of the visible
  2.1521 -.Sw -[no]fast
  2.1522 -switches:
  2.1523 -.Sw -total
  2.1524 -was
  2.1525 -.Sw -nofast
  2.1526 -and
  2.1527 -.Sw -nototal
  2.1528 -was
  2.1529 -.Sw -fast .
  2.1530 -I removed the
  2.1531 -.Sw -[no]total
  2.1532 -legacy.
  2.1533 -.Ci ea21fe2c4bd23c639bef251398fae809875732ec
  2.1534 -.BU
  2.1535 -The
  2.1536 -.Sw -subject
  2.1537 -switch of
  2.1538 -.Pn sortm
  2.1539 -existed for compatibility only.
  2.1540 -It can be fully replaced by
  2.1541 -.Cl "-textfield subject
  2.1542 -thus it was removed.
  2.1543 -.Ci 00140a3c86e9def69d98ba2ffd4d6e50ef6326ea
  2.1544 -
  2.1545 -
  2.1546 -.U3 "Various
  2.1547 -.BU
  2.1548 -In order to avoid prefix collisions among switch names, the
  2.1549 -.Sw -version
  2.1550 -switch was renamed to
  2.1551 -.Sw -Version
  2.1552 -(with capital `V').
  2.1553 -.Ci 32b2354dbaf4bf934936eb5b102a4a3d2fdd209a
  2.1554 -Every program has the
  2.1555 -.Sw -version
  2.1556 -switch but its first three letters collided with the
  2.1557 -.Sw -verbose
  2.1558 -switch, present in many programs.
  2.1559 -The rename solved this problem once for all.
  2.1560 -Although this rename breaks a basic interface, having the
  2.1561 -.Sw -V
  2.1562 -abbreviation to display the version information, isn't all too bad.
  2.1563 -.BU
  2.1564 -.Sw -[no]preserve
  2.1565 -of
  2.1566 -.Pn refile
  2.1567 -was removed because what use was it anyway?
  2.1568 -.QS
  2.1569 -Normally when a message is refiled, for each destination
  2.1570 -folder it is assigned the number which is one above the current
  2.1571 -highest message number in that folder. Use of the
  2.1572 -\-preserv [sic!] switch will override this message renaming, and try
  2.1573 -to preserve the number of the message. If a conflict for a
  2.1574 -particular folder occurs when using the \-preserve switch,
  2.1575 -then refile will use the next available message number which
  2.1576 -is above the message number you wish to preserve.
  2.1577 -.QE
  2.1578 -.BU
  2.1579 -The removal of the
  2.1580 -.Sw -[no]reverse
  2.1581 -switches of
  2.1582 -.Pn scan
  2.1583 -.Ci 8edc5aaf86f9f77124664f6801bc6c6cdf258173
  2.1584 -is a bug fix, supported by the comments
  2.1585 -``\-[no]reverse under #ifdef BERK (I really HATE this)''
  2.1586 -by Rose and
  2.1587 -``Lists messages in reverse order with the `\-reverse' switch.
  2.1588 -This should be considered a bug.'' by Romine in the documentation.
  2.1589 -The question remains why neither Rose and Romine had fixed this
  2.1590 -bug in the Eighties when they wrote these comments nor has anyone
  2.1591 -thereafter.
  2.1592 -
  2.1593 -
  2.1594 -.ig
  2.1595 -
  2.1596 -forw: [no]dashstuffing(mhl)
  2.1597 -
  2.1598 -mhshow: [no]pause [no]serialonly
  2.1599 -
  2.1600 -mhmail: resent queued
  2.1601 -inc: snoop, (pop)
  2.1602 -
  2.1603 -mhl: [no]faceproc folder sleep
  2.1604 -	[no]dashstuffing(forw) digest list volume number issue number
  2.1605 -
  2.1606 -prompter: [no]doteof
  2.1607 -
  2.1608 -refile: [no]preserve [no]unlink [no]rmmproc
  2.1609 -
  2.1610 -send: [no]forward [no]mime [no]msgid
  2.1611 -	[no]push split [no]unique (sasl) width snoop [no]dashstuffing
  2.1612 -	attach attachformat
  2.1613 -whatnow: (noedit) attach
  2.1614 -
  2.1615 -slocal: [no]suppressdups
  2.1616 -
  2.1617 -spost: [no]filter [no]backup width [no]push idanno
  2.1618 -	[no]check(whom) whom(whom)
  2.1619 -
  2.1620 -whom: ???
  2.1621 -
  2.1622 -..
  2.1623 -
  2.1624 -
  2.1625 -.ig
  2.1626 -
  2.1627 -.P
  2.1628 -In the best case, all switches are unambiguous on the first character,
  2.1629 -or on the three-letter prefix for the `no' variants.
  2.1630 -Reducing switch prefix collisions, shortens the necessary prefix length
  2.1631 -the user must type.
  2.1632 -Having less switches helps best.
  2.1633 -
  2.1634 -..
  2.1635 -
  2.1636 -
  2.1637 -.\" XXX: whatnow prompt commands
  2.1638 -
  2.1639 -
  2.1640 -
  2.1641 -
  2.1642 -.H1 "Modernizing
  2.1643 -.P
  2.1644 -The code base of mmh originates from the late Seventies.
  2.1645 -Through the Eighties, extensive work had been done on it.
  2.1646 -In the Nineties, it had been partly reorganized and extended.
  2.1647 -Relicts from each decade have gathered in the code base.
  2.1648 -My goal was to modernize the code base.
  2.1649 -
  2.1650 -.P
  2.1651 -FIXME functional aspect only here
  2.1652 -.P
  2.1653 -FIXME ref to `code style' for non-functional aspects.
  2.1654 -
  2.1655 -
  2.1656 -.H2 "Code Relicts
  2.1657 -.P
  2.1658 -My position to drop obsolete functionality of mmh to remove old code
  2.1659 -is much more revolutional than the nmh community likes to have it.
  2.1660 -Working on an experimental version, I was able to quickly drop
  2.1661 -functionality I considered ancient.
  2.1662 -The need for consensus with peers would have slowed this process down.
  2.1663 -Without the need to justify my decisions, I was able to rush forward.
  2.1664 -In Dezember 2011, Paul Vixie motivated the nmh developers to just
  2.1665 -do the work:
  2.1666 -.[
  2.1667 -paul vixie edginess nmh-workers
  2.1668 -.]
  2.1669 -.QS
  2.1670 -let's stop walking on egg shells with this code base. there's no need to
  2.1671 -discuss whether to keep using vfork, just note in [sic!] passing, [...]
  2.1672 -we don't need a separate branch for removing vmh
  2.1673 -or ridding ourselves of #ifdef's or removing posix replacement functions
  2.1674 -or depending on pure ansi/posix "libc".
  2.1675 -.QP
  2.1676 -these things should each be a day or two of work and the "main branch"
  2.1677 -should just be modern. [...]
  2.1678 -let's push forward, aggressively.
  2.1679 -.QE
  2.1680 -.LP
  2.1681 -I did so already in the months before.
  2.1682 -I pushed forward.
  2.1683 -I simply dropped the cruft.
  2.1684 -.P
  2.1685 -The decision to drop a feature was based on literature research and
  2.1686 -careful thinking, but whether having had contact to this particular
  2.1687 -feature within my own computer life served as a rule of thumb.
  2.1688 -My reasons are always made clean in the commit message for the
  2.1689 -version control system.
  2.1690 -Hence, others can comprehend my view and argue for undoing the change
  2.1691 -if I have missed an important aspect.
  2.1692 -
  2.1693 -
  2.1694 -.U3 "Forking
  2.1695 -.P
  2.1696 -In being a tool chest, MH creates many processes.
  2.1697 -In earlier times
  2.1698 -.Fu fork()
  2.1699 -had been an expensive system call, because the process's image needed
  2.1700 -to be duplicated completely at once.
  2.1701 -This was especially painfull in the common case when the image gets
  2.1702 -replaced by a call to
  2.1703 -.Fu exec()
  2.1704 -right after having forked the child process.
  2.1705 -The
  2.1706 -.Fu vfork()
  2.1707 -system call was invented to speed up this particular case.
  2.1708 -It completely omits the duplication of the image.
  2.1709 -On old systems this resulted in significant speed ups.
  2.1710 -Therefore MH used
  2.1711 -.Fu vfork()
  2.1712 -whenever possible.
  2.1713 -.P
  2.1714 -Modern memory management units support copy-on-write semantics, which make
  2.1715 -.Fu fork()
  2.1716 -almost as fast as
  2.1717 -.Fu vfork() .
  2.1718 -The man page of
  2.1719 -.Mp vfork (2)
  2.1720 -in FreeBSD 8.0 states:
  2.1721 -.QS
  2.1722 -This system call will be eliminated when proper system sharing mechanisms
  2.1723 -are implemented. Users should not depend on the memory sharing semantics
  2.1724 -of vfork() as it will, in that case, be made synonymous to fork(2).
  2.1725 -.QE
  2.1726 -.LP
  2.1727 -Vixie supports the removal with the note that ``the last
  2.1728 -system on which fork was so slow that an mh user would notice it, was
  2.1729 -Eunice. that was 1987''.
  2.1730 -.[
  2.1731 -nmh-workers vixie edginess
  2.1732 -.]
  2.1733 -I replaced all calls to
  2.1734 -.Fu vfork()
  2.1735 -with calls to
  2.1736 -.Fu fork() .
  2.1737 -.P
  2.1738 -Related to the costs of
  2.1739 -.Fu fork()
  2.1740 -is the probability of its success.
  2.1741 -In the Eighties on heavy loaded systems, calls to
  2.1742 -.Fu fork()
  2.1743 -were prone to failure.
  2.1744 -Hence, many of the
  2.1745 -.Fu fork()
  2.1746 -calls in the code were wrapped into loops to retry the
  2.1747 -.Fu fork()
  2.1748 -several times, for higher changes to succeed, eventually.
  2.1749 -On modern systems, failing calls to
  2.1750 -.Fu fork()
  2.1751 -are unusual.
  2.1752 -Hence, in the rare case when
  2.1753 -.Fu fork()
  2.1754 -fails, mmh programs simply abort.
  2.1755 -
  2.1756 -
  2.1757 -.U3 "Obsolete Header Fields
  2.1758 -.BU
  2.1759 -The
  2.1760 -.Hd Encrypted
  2.1761 -header field was introduced by RFC\|822,
  2.1762 -but already marked legacy in RFC\|2822.
  2.1763 -OpenPGP provides the basis for standardized exchange of encrypted
  2.1764 -messages [RFC\|4880, RFC\|3156].
  2.1765 -The support for
  2.1766 -.Hd Encrypted
  2.1767 -header fields is removed in mmh.
  2.1768 -.BU
  2.1769 -Native support for
  2.1770 -.Hd Face
  2.1771 -header fields has been removed, as well.
  2.1772 -This feature is similar to the
  2.1773 -.Hd X-Face
  2.1774 -header field in its intent,
  2.1775 -but takes a different approach to store the image.
  2.1776 -Instead of encoding the image data directly into the header field,
  2.1777 -the it contains the hostname and UDP port where the image
  2.1778 -date could be retrieved.
  2.1779 -There is even a third system, invented in 2005.
  2.1780 -Although it re-uses the
  2.1781 -.Hd Face
  2.1782 -header field, it is the successor of
  2.1783 -.Hd X-Face
  2.1784 -with support for colored PNG images.
  2.1785 -None of the Face systems described here is popular today.
  2.1786 -Hence, mmh has no direct support for them.
  2.1787 -.BU
  2.1788 -The
  2.1789 -.Hd Content-MD5
  2.1790 -header field was introduced by RFC\|1864.
  2.1791 -It provides detection of data corruption during the transfer.
  2.1792 -But it can not ensure verbatim end-to-end delivery of the contents
  2.1793 -[RFC\|1864].
  2.1794 -The proper approach to verify content integrity in an
  2.1795 -end-to-end relationship is the use of digital cryptography.
  2.1796 -.\" XXX (RFCs FIXME).
  2.1797 -On the other hand, transfer protocols should detect corruption during
  2.1798 -each transmission. The TCP includes a checksum field therefore.
  2.1799 -These two approaches in combinations render the
  2.1800 -.Hd Content-MD5
  2.1801 -header field superfluous.
  2.1802 -The nmh-workers mailing list archive contains about 4\|200 messages,
  2.1803 -ranging from 1992 until today.
  2.1804 -Not a single one had a
  2.1805 -.Hd Content-MD5
  2.1806 -header field.
  2.1807 -Neither did any of the 60\|000 messages in my personal mail storage.
  2.1808 -Removing the support for this header field,
  2.1809 -removed the last place where MD5 computation was needed.
  2.1810 -Hence, the MD5 code could be removed as well.
  2.1811 -Over 500 lines of code vanished by this one change.
  2.1812 -
  2.1813 -
  2.1814 -.U3 "MMDF maildrop support
  2.1815 -.P
  2.1816 -This type of format is conceptionally similar to the mbox format,
  2.1817 -but uses a different message delimiter (`\fL^A^A^A^A\fP' instead of
  2.1818 -`\fLFrom\0\fP').
  2.1819 -Mbox is the de-facto standard maildrop format on Unix,
  2.1820 -whereas the MMDF maildrop format is hardly still known today.
  2.1821 -I did drop MMDF maildrop format support.
  2.1822 -.P
  2.1823 -The simplifications within the code were only moderate.
  2.1824 -Switches could be removed from
  2.1825 -.L packf
  2.1826 -and
  2.1827 -.L rcvpack ,
  2.1828 -which generate packed mailboxes.
  2.1829 -Only one packed mailbox format remained: mbox.
  2.1830 -The more important changes affected the equally named mail parsing
  2.1831 -routine in
  2.1832 -.Fn sbr/m_getfld.c .
  2.1833 -The MMDF code had been removed there, but as now only one packed mailbox
  2.1834 -format is left, further code structure simplifications may be possible.
  2.1835 -I have not worked on them yet because
  2.1836 -.Fu m_getfld()
  2.1837 -is heavily optimized and thus dangerous to touch.
  2.1838 -The risk of damaging the intricate workings of the optimized code is
  2.1839 -too high.
  2.1840 -.\" XXX: move somewhere else
  2.1841 -This problem is know to the developers of nmh, too.
  2.1842 -They also avoid touching this minefield if possible.
  2.1843 -
  2.1844 -
  2.1845 -.U3 "Prompter's Control Keys
  2.1846 -.P
  2.1847 -The program
  2.1848 -.Pn prompter
  2.1849 -queries the user to fill in a message form.
  2.1850 -When used by
  2.1851 -.Pn comp
  2.1852 -as
  2.1853 -.Cl "comp -editor prompter" ,
  2.1854 -the resulting behavior is similar to
  2.1855 -.Pn mailx .
  2.1856 -Apparently,
  2.1857 -.Pn prompter
  2.1858 -hadn't been touched lately.
  2.1859 -Otherwise it's hardly explainable why it
  2.1860 -still offered the switches
  2.1861 -.Sw -erase
  2.1862 -.Ar chr
  2.1863 -and
  2.1864 -.Sw -kill
  2.1865 -.Ar chr
  2.1866 -to name the characters for command line editing.
  2.1867 -The times when this had been necessary are long time gone.
  2.1868 -Today these things work out-of-the-box, and if not, are configured
  2.1869 -with the standard tool
  2.1870 -.Pn stty .
  2.1871 -The switches are removed now
  2.1872 -.Ci 0bd9750710cdbab80cfb4036dd87af20afe1552f .
  2.1873 -
  2.1874 -
  2.1875 -.U3 "Hardcopy terminal support
  2.1876 -.P
  2.1877 -More of a funny anecdote is a check for printing to a
  2.1878 -hardcopy terminal that remained in the code until Spring 2012,
  2.1879 -when I finally removed it
  2.1880 -.Ci b7764c4a6b71d37918a97594d866258f154017ca .
  2.1881 -I surely would be very happy to see such a terminal in action,
  2.1882 -maybe actually being able to work on it, but I fear my chances are null.
  2.1883 -.P
  2.1884 -The check only prevented a pager to be placed between the outputting
  2.1885 -program (\c
  2.1886 -.Pn mhl )
  2.1887 -and the terminal.
  2.1888 -In nmh, this could have been ensured with the
  2.1889 -.Sw -nomoreproc
  2.1890 -at the command line statically, too.
  2.1891 -In mmh, set the profile entry
  2.1892 -.Pe Pager
  2.1893 -or the environment variable
  2.1894 -.Ev PAGER
  2.1895 -to
  2.1896 -.Pn cat .
  2.1897 -
  2.1898 -
  2.1899 -
  2.1900 -
  2.1901 -.H2 "Attachments
  2.1902 -.P
  2.1903 -The mind model of email attachments is unrelated to MIME.
  2.1904 -Although the MIME RFCs (2045 through 2049) define the technical
  2.1905 -requirements for having attachments, they do not mention the the word
  2.1906 -``attachment''.
  2.1907 -Instead of attachments, MIME talks about ``multi-part message bodies''
  2.1908 -[RFC\|2045], a more general concept.
  2.1909 -Multi-part messages are messages
  2.1910 -``in which one or more different
  2.1911 -sets of data are combined in a single body''
  2.1912 -[RFC\|2046].
  2.1913 -MIME keeps its descriptions generic;
  2.1914 -it does not imply specific usage models.
  2.1915 -In email one usage model became prevalent: attachments.
  2.1916 -The idea is having a main text document with files of arbitrary kind
  2.1917 -attached to it.
  2.1918 -In MIME terms, this is a multi-part message having a text part first
  2.1919 -and parts of arbitray type following.
  2.1920 -.P
  2.1921 -MH's MIME support is a direct implementation of the RFCs.
  2.1922 -The perception of the topic described in the RFCs is clearly visible
  2.1923 -in MH's implementation.
  2.1924 -Thus, MH had all the MIME features but no idea of attachments.
  2.1925 -Today, however, users don't need all the MIME features but they want
  2.1926 -convenient attachment handling.
  2.1927 -
  2.1928 -.U3 "Composing MIME Messages
  2.1929 -.P
  2.1930 -In order to improve the situation on the message composing side,
  2.1931 -Jon Steinhart had added an attachment system to nmh in 2002.
  2.1932 -.Ci 7480dbc14bc90f2d872d434205c0784704213252
  2.1933 -In the file
  2.1934 -.Fn docs/README-ATTACHMENTS ,
  2.1935 -he described his motivation to do so as such:
  2.1936 -.QS
  2.1937 -Although nmh contains the necessary functionality for MIME message handing,
  2.1938 -the interface to this functionality is pretty obtuse.
  2.1939 -There's no way that I'm ever going to convince my partner to write
  2.1940 -.Pn mhbuild
  2.1941 -composition files!
  2.1942 -.QE
  2.1943 -.LP
  2.1944 -With this change, the mind model of attachments entered nmh.
  2.1945 -In the same document:
  2.1946 -.QS
  2.1947 -These changes simplify the task of managing attachments on draft files.
  2.1948 -They allow attachments to be added, listed, and deleted.
  2.1949 -MIME messages are automatically created when drafts with attachments
  2.1950 -are sent.
  2.1951 -.QE
  2.1952 -.LP
  2.1953 -Unfortunately, the attachment system,
  2.1954 -like any new facilities in nmh,
  2.1955 -was deactive by default.
  2.1956 -.P
  2.1957 -During my work in Argentina, I tried to improve the attachment system.
  2.1958 -But, because of great opposition in the nmh community,
  2.1959 -my patch died as a proposal on the mailing list, after long discussions.
  2.1960 -.[
  2.1961 -nmh-workers attachment proposal
  2.1962 -.]
  2.1963 -In Januar 2012, I extended the patch and applied it to mmh.
  2.1964 -.Ci 8ff284ff9167eff8f5349481529332d59ed913b1
  2.1965 -In mmh, the attachment system is active by default.
  2.1966 -Instead of command line switches, the
  2.1967 -.Pe Attachment-Header
  2.1968 -profile entry is used to specify
  2.1969 -the name of the attachment header field.
  2.1970 -It is pre-defined to
  2.1971 -.Hd Attach .
  2.1972 -.P
  2.1973 -To add an attachment to a draft, simply add an attachment header:
  2.1974 -.VS
  2.1975 -To: bob
  2.1976 -Subject: The file you wanted
  2.1977 -Attach: /path/to/the/file-bob-wanted
  2.1978 ---------
  2.1979 -Here it is.
  2.1980 -VE
  2.1981 -The header field can be added to the draft manually in the editor,
  2.1982 -or by using the `attach' command at the WhatNow prompt, or
  2.1983 -non-interactively with
  2.1984 -.Pn anno :
  2.1985 -.VS
  2.1986 -anno -append -nodate -component Attach -text /path/to/attachment
  2.1987 -VE
  2.1988 -Drafts with attachment headers are converted to MIME automatically by
  2.1989 -.Pn send .
  2.1990 -The conversion to MIME is invisible to the user.
  2.1991 -The draft stored in the draft folder is always in source form, with
  2.1992 -attachment headers.
  2.1993 -If the MIMEification fails, for instance because the file to attach
  2.1994 -is not accessible, the original draft is not changed.
  2.1995 -.P
  2.1996 -The attachment system handles the forwarding of messages, too.
  2.1997 -If the attachment header value starts with a plus character (`+'),
  2.1998 -like in
  2.1999 -.Cl "Attach: +bob 30 42" ,
  2.2000 -The given messages in the specified folder will be attached.
  2.2001 -This allowed to simplify
  2.2002 -.Pn forw .
  2.2003 -.Ci f41f04cf4ceca7355232cf7413e59afafccc9550
  2.2004 -.P
  2.2005 -Closely related to attachments is non-ASCII text content,
  2.2006 -because it requires MIME too.
  2.2007 -In nmh, the user needed to call `mime' at the WhatNow prompt
  2.2008 -to have the draft converted to MIME.
  2.2009 -This was necessary whenever the draft contained non-ASCII characters.
  2.2010 -If the user did not call `mime', a broken message would be sent.
  2.2011 -Therefore, the
  2.2012 -.Pe automimeproc
  2.2013 -profile entry could be specified to have the `mime' command invoked
  2.2014 -automatically each time.
  2.2015 -Unfortunately, this approach conflicted with with attachment system
  2.2016 -because the draft would already be in MIME format at the time
  2.2017 -when the attachment system wanted to MIMEify it.
  2.2018 -To use nmh's attachment system, `mime' must not be called at the
  2.2019 -WhatNow prompt and
  2.2020 -.Pe automimeproc
  2.2021 -must not be set in the profile.
  2.2022 -But then the case of non-ASCII text without attachment headers was
  2.2023 -not caught.
  2.2024 -All in all, the solution was complex and irritating.
  2.2025 -My patch from December 2010 would have simplified the situation.
  2.2026 -.P
  2.2027 -Mmh's current solution is even more elaborate.
  2.2028 -Any necessary MIMEification is done automatically.
  2.2029 -There is no `mime' command at the WhatNow prompt anymore.
  2.2030 -The draft will be converted automatically to MIME when either an
  2.2031 -attachment header or non-ASCII text is present.
  2.2032 -Further more, the special meaning of the hash character (`#')
  2.2033 -at line beginnings in the draft message is removed.
  2.2034 -Users need not at all deal with the whole topic.
  2.2035 -.P
  2.2036 -Although the new approach does not anymore support arbitrary MIME
  2.2037 -compositions directly, the full power of
  2.2038 -.Pn mhbuild
  2.2039 -can still be accessed.
  2.2040 -Given no attachment headers are included, the user can create
  2.2041 -.Pn mhbuild
  2.2042 -composition drafts like in nmh.
  2.2043 -Then, at the WhatNow prompt, he needs to invoke
  2.2044 -.Cl "edit mhbuild
  2.2045 -to convert it to MIME.
  2.2046 -Because the resulting draft does neither contain non-aASCII characters
  2.2047 -nor has it attachment headers, the attachment system will not touch it.
  2.2048 -.P
  2.2049 -The approach taken in mmh is taylored towards todays most common case:
  2.2050 -a text part with possibly attachments.
  2.2051 -This case is simplified a lot for users.
  2.2052 -
  2.2053 -.U3 "MIME Type Guessing
  2.2054 -.P
  2.2055 -The use of
  2.2056 -.Pn mhbuild
  2.2057 -composition drafts had one notable advantage over attachment headers
  2.2058 -from the programmer's point of view: The user provides the appropriate
  2.2059 -MIME types for files to include.
  2.2060 -The attachment system needs to find out the correct MIME type itself.
  2.2061 -This is a difficult task, yet it spares the user irritating work.
  2.2062 -Determining the correct MIME type of content is partly mechanical,
  2.2063 -partly intelligent work.
  2.2064 -Forcing the user to find out the correct MIME type,
  2.2065 -forces him to do partly mechanical work.
  2.2066 -Letting the computer do the work, can lead to bad choices for difficult
  2.2067 -content.
  2.2068 -For mmh, the latter option was chosen.
  2.2069 -.P
  2.2070 -Determining the MIME type by the suffix of the file name is a dumb
  2.2071 -approach, yet it is simple to implement and provides good results
  2.2072 -for the common cases.
  2.2073 -Mmh implements this approach in the
  2.2074 -.Pn print-mimetype
  2.2075 -script.
  2.2076 -Using it is the default choice.
  2.2077 -.P
  2.2078 -A far better but less portable approach is the use of
  2.2079 -.Pn file .
  2.2080 -This standard tool tries to determine the type of files.
  2.2081 -Unfortunately, its capabilities and accuracy varies from system to system.
  2.2082 -Additionally, its output was only intended for human beings,
  2.2083 -but not to be used by programs.
  2.2084 -It varies much.
  2.2085 -Nevertheless, modern versions of GNU
  2.2086 -.Pn file ,
  2.2087 -which is prevalent on the popular GNU/Linux systems,
  2.2088 -provides MIME type output in machine-readable form.
  2.2089 -Although this solution is highly system-dependent,
  2.2090 -it solves the difficult problem well.
  2.2091 -On systems where GNU
  2.2092 -.Pn file ,
  2.2093 -version 5.04 or higher, is available it should be used.
  2.2094 -One needs to specify the following profile entry to do so:
  2.2095 -.VS
  2.2096 -Mime-Type-Query: file -b --mime
  2.2097 -VE
  2.2098 -.LP
  2.2099 -Other versions of
  2.2100 -.Pn file
  2.2101 -might possibly be usable with wrapper scripts to reformat the output.
  2.2102 -The diversity among
  2.2103 -.Pn file
  2.2104 -implementations is great; one needs to check the local variant.
  2.2105 -.P
  2.2106 -If no MIME type can be determined, text content gets sent as
  2.2107 -`text/plain' and anything else under the generic fall-back type
  2.2108 -`application/octet-stream'.
  2.2109 -It is not possible in mmh to override the automatic MIME type guessing
  2.2110 -for a specific file.
  2.2111 -To do so, the user would need to know in advance for which file
  2.2112 -the automatic guessing does fail, or the system would require interaction.
  2.2113 -I consider both cases impractical.
  2.2114 -The existing solution should be sufficient.
  2.2115 -If not, the user may always fall back to
  2.2116 -.Pn mhbuild
  2.2117 -composition drafts and ignore the attachment system.
  2.2118 -
  2.2119 -
  2.2120 -.U3 "Storing Attachments
  2.2121 -.P
  2.2122 -FIXME
  2.2123 -
  2.2124 -
  2.2125 -.U3 "Showing MIME Messages
  2.2126 -.P
  2.2127 -FIXME
  2.2128 -
  2.2129 -
  2.2130 -
  2.2131 -.H2 "Digital Cryptography
  2.2132 -.P
  2.2133 -Signing and encryption.
  2.2134 -
  2.2135 -
  2.2136 -
  2.2137 -.H2 "Modern Defaults
  2.2138 -.P
  2.2139 -Just to give one example, for me it took one year of using nmh
  2.2140 -before I became aware of the existence of the attachment system.
  2.2141 -One could argue that this fact disqualifies my reading of the
  2.2142 -documentation.
  2.2143 -If I would have installed nmh from source back then, I could agree.
  2.2144 -Yet I had used a prepackaged version and had expected that it would
  2.2145 -just work.
  2.2146 -
  2.2147 -
  2.2148 -
  2.2149 -.H1 "Code Style
  2.2150 -.P
  2.2151 -foo
  2.2152 -
  2.2153 -
  2.2154 -.H2 "Standard Code
  2.2155 -.P
  2.2156 -POSIX
  2.2157 -
  2.2158 -.U3 "Converting to Standard Code
  2.2159 -.P
  2.2160 -One part of this task was converting obsolete code constructs
  2.2161 -to standard constructs.
  2.2162 -As I'm not even thirty years old and have no more than seven years of
  2.2163 -Unix experience, I needed to learn about the history in retrospective.
  2.2164 -Older people likely have used those ancient constructs themselves
  2.2165 -and have suffered from their incompatibilities and have longed for
  2.2166 -standardization.
  2.2167 -Unfortunately, I have only read that others had done so.
  2.2168 -This put me in a much more difficult positions when working on the old
  2.2169 -code.
  2.2170 -I needed to recherche what other would have known by heart from
  2.2171 -experience.
  2.2172 -All my programming experience comes from a time past ANSI C
  2.2173 -and past POSIX.
  2.2174 -Although I knew about the times before, I took the
  2.2175 -current state implicitly for granted most of the time.
  2.2176 -.P
  2.2177 -Being aware of
  2.2178 -these facts, I rather let people with more historic experience solve the 
  2.2179 -task of converting the ancient code constructs to standardized ones.
  2.2180 -Luckily, Lyndon Nerenberg focused on this task at the nmh project.
  2.2181 -He converted large parts of the code to POSIX constructs, removing
  2.2182 -the conditionals compilation for now standardized features.
  2.2183 -I'm thankful for this task being solved.
  2.2184 -I only pulled the changes into
  2.2185 -mmh.
  2.2186 -
  2.2187 -
  2.2188 -
  2.2189 -
  2.2190 -.H2 "Separation
  2.2191 -
  2.2192 -.U2 "MH Directory Split
  2.2193 -.P
  2.2194 -In MH and nmh, a personal setup had consisted of two parts:
  2.2195 -The MH profile, named
  2.2196 -.Fn \&.mh_profile
  2.2197 -and being located directly in the user's home directory.
  2.2198 -And the MH directory, where all his mail messages and also his personal
  2.2199 -forms, scan formats, other configuration files are stored.
  2.2200 -The location
  2.2201 -of this directory could be user-chosen.
  2.2202 -The default was to name it
  2.2203 -.Fn Mail
  2.2204 -and have it directly in the home directory.
  2.2205 -.P
  2.2206 -I've never liked the data storage and the configuration to be intermixed.
  2.2207 -They are different kinds of data.
  2.2208 -One part, are the messages,
  2.2209 -which are the data to operate on.
  2.2210 -The other part, are the personal
  2.2211 -configuration files, which are able to change the behavior of the operations.
  2.2212 -The actual operations are defined in the profile, however.
  2.2213 -.P
  2.2214 -When storing data, one should try to group data by its type.
  2.2215 -There's sense in the Unix file system hierarchy, where configuration
  2.2216 -file are stored separate (\c
  2.2217 -.Fn /etc )
  2.2218 -to the programs (\c
  2.2219 -.Fn /bin
  2.2220 -and
  2.2221 -.Fn /usr/bin )
  2.2222 -to their sources (\c
  2.2223 -.Fn /usr/src ).
  2.2224 -Such separation eases the backup management, for instance.
  2.2225 -.P
  2.2226 -In mmh, I've reorganized the file locations.
  2.2227 -Still there are two places:
  2.2228 -There's the mail storage directory, which, like in MH, contains all the
  2.2229 -messages, but, unlike in MH, nothing else.
  2.2230 -Its location still is user-chosen, with the default name
  2.2231 -.Fn Mail ,
  2.2232 -in the user's home directory.
  2.2233 -This is much similar to the case in nmh.
  2.2234 -The configuration files, however, are grouped together in the new directory
  2.2235 -.Fn \&.mmh
  2.2236 -in the user's home directory.
  2.2237 -The user's profile now is a file, named
  2.2238 -.Fn profile ,
  2.2239 -in this mmh directory.
  2.2240 -Consistently, the context file and all the personal forms, scan formats,
  2.2241 -and the like, are also there.
  2.2242 -.P
  2.2243 -The naming changed with the relocation.
  2.2244 -The directory where everything, except the profile, had been stored (\c
  2.2245 -.Fn $HOME/Mail ),
  2.2246 -used to be called \fIMH directory\fP.
  2.2247 -Now, this directory is called the
  2.2248 -user's \fImail storage\fP.
  2.2249 -The name \fImmh directory\fP is now given to
  2.2250 -the new directory
  2.2251 -(\c
  2.2252 -.Fn $HOME/.mmh ),
  2.2253 -containing all the personal configuration files.
  2.2254 -.P
  2.2255 -The separation of the files by type of content is logical and convenient.
  2.2256 -There are no functional differences as any possible setup known to me
  2.2257 -can be implemented with both approaches, although likely a bit easier
  2.2258 -with the new approach.
  2.2259 -The main goal of the change had been to provide
  2.2260 -sensible storage locations for any type of personal mmh file.
  2.2261 -.P
  2.2262 -In order for one user to have multiple MH setups, he can use the
  2.2263 -environment variable
  2.2264 -.Ev MH
  2.2265 -the point to a different profile file.
  2.2266 -The MH directory (mail storage plus personal configuration files) is
  2.2267 -defined by the
  2.2268 -.Pe Path
  2.2269 -profile entry.
  2.2270 -The context file could be defined by the
  2.2271 -.Pe context
  2.2272 -profile entry or by the
  2.2273 -.Ev MHCONTEXT
  2.2274 -environment variable.
  2.2275 -The latter is useful to have a distinct context (e.g. current folders)
  2.2276 -in each terminal window, for instance.
  2.2277 -In mmh, there are three environment variables now.
  2.2278 -.Ev MMH
  2.2279 -may be used to change the location of the mmh directory.
  2.2280 -.Ev MMHP
  2.2281 -and
  2.2282 -.Ev MMHC
  2.2283 -change the profile and context files, respectively.
  2.2284 -Besides providing a more consistent feel (which simply is the result
  2.2285 -of being designed anew), the set of personal configuration files can
  2.2286 -be chosen independently from the profile (including mail storage location)
  2.2287 -and context, now.
  2.2288 -Being it relevant for practical use or not, it
  2.2289 -de-facto is an improvement.
  2.2290 -However, the main achievement is the
  2.2291 -split between mail storage and personal configuration files.
  2.2292 -
  2.2293 -
  2.2294 -.H2 "Modularization
  2.2295 -.P
  2.2296 -whatnowproc
  2.2297 -.P
  2.2298 -The \fIMH library\fP
  2.2299 -.Fn libmh.a
  2.2300 -collects a bunch of standard functions that many of the MH tools need,
  2.2301 -like reading the profile or context files.
  2.2302 -This doesn't hurt the separation.
  2.2303 -
  2.2304 -
  2.2305 -.H2 "Style
  2.2306 -.P
  2.2307 -Code layout, goto, ...
  2.2308 -
  2.2309 -.P
  2.2310 -anno rework
  2.2311 -
  2.2312 -
  2.2313 -
  2.2314 -
  2.2315 -.H1 "Concept Exploitation/Homogeneity
  2.2316 -
  2.2317 -
  2.2318 -.H2 "Draft Folder
  2.2319 -.P
  2.2320 -Historically, MH provided exactly one draft message, named
  2.2321 -.Fn draft
  2.2322 -and
  2.2323 -being located in the MH directory.
  2.2324 -When starting to compose another message
  2.2325 -before the former one was sent, the user had been questioned whether to use,
  2.2326 -refile or replace the old draft.
  2.2327 -Working on multiple drafts at the same time
  2.2328 -was impossible.
  2.2329 -One could only work on them in alteration by refiling the
  2.2330 -previous one to some directory and fetching some other one for reediting.
  2.2331 -This manual draft management needed to be done each time the user wanted
  2.2332 -to switch between editing one draft to editing another.
  2.2333 -.P
  2.2334 -To allow true parallel editing of drafts, in a straight forward way, the
  2.2335 -draft folder facility exists.
  2.2336 -It had been introduced already in July 1984
  2.2337 -by Marshall T. Rose.
  2.2338 -The facility was deactivated by default.
  2.2339 -Even in nmh, the draft folder facility remained deactivated by default.
  2.2340 -At least, Richard Coleman added the man page
  2.2341 -.Mp mh-draft(5)
  2.2342 -to document
  2.2343 -the feature well.
  2.2344 -.P
  2.2345 -The only advantage of not using the draft folder facility is the static
  2.2346 -name of the draft file.
  2.2347 -This could be an issue for MH front-ends like mh-e.
  2.2348 -But as they likely want to provide working on multiple drafts in parallel,
  2.2349 -the issue is only concerning compatibility.
  2.2350 -The aim of nmh to stay compatible
  2.2351 -prevented the default activation of the draft folder facility.
  2.2352 -.P
  2.2353 -On the other hand, a draft folder is the much more natural concept than
  2.2354 -a draft message.
  2.2355 -MH's mail storage consists of folders and messages,
  2.2356 -the messages named with ascending numbers.
  2.2357 -A draft message breaks with this
  2.2358 -concept by introducing a message in a file named
  2.2359 -.Fn draft .
  2.2360 -This draft
  2.2361 -message is special.
  2.2362 -It can not be simply listed with the available tools,
  2.2363 -but instead requires special switches.
  2.2364 -I.e. corner-cases were
  2.2365 -introduced.
  2.2366 -A draft folder, in contrast, does not introduce such
  2.2367 -corner-cases.
  2.2368 -The available tools can operate on the messages within that
  2.2369 -folder like on any messages within any mail folders.
  2.2370 -The only difference
  2.2371 -is the fact that the default folder for
  2.2372 -.Pn send
  2.2373 -is the draft folder,
  2.2374 -instead of the current folder, like for all other tools.
  2.2375 -.P
  2.2376 -The trivial part of the change was activating the draft folder facility
  2.2377 -by default and setting a default name for this folder.
  2.2378 -Obviously, I chose
  2.2379 -the name
  2.2380 -.Fn +drafts .
  2.2381 -This made the
  2.2382 -.Sw -draftfolder
  2.2383 -and
  2.2384 -.Sw -draftmessage
  2.2385 -switches useless, and I could remove them.
  2.2386 -The more difficult but also the part that showed the real improvement,
  2.2387 -was updating the tools to the new concept.
  2.2388 -.Sw -draft
  2.2389 -switches could
  2.2390 -be dropped, as operating on a draft message became indistinguishable to
  2.2391 -operating on any other message for the tools.
  2.2392 -.Pn comp
  2.2393 -still has its
  2.2394 -.Sw -use
  2.2395 -switch for switching between its two modes: (1) Compose a new
  2.2396 -draft, possibly by taking some existing message as a form.
  2.2397 -(2) Modify
  2.2398 -an existing draft.
  2.2399 -In either case, the behavior of
  2.2400 -.Pn comp is
  2.2401 -deterministic.
  2.2402 -There is no more need to query the user.
  2.2403 -I consider this
  2.2404 -a major improvement.
  2.2405 -By making
  2.2406 -.Pn send
  2.2407 -simply operate on the current
  2.2408 -message in the draft folder by default, with message and folder both
  2.2409 -overridable by specifying them on the command line, it is now possible
  2.2410 -to send a draft anywhere within the storage by simply specifying its folder
  2.2411 -and name.
  2.2412 -.P
  2.2413 -All theses changes converted special cases to regular cases, thus
  2.2414 -simplifying the tools and increasing the flexibility.
  2.2415 -
  2.2416 -
  2.2417 -.H2 "Trash Folder
  2.2418 -.P
  2.2419 -Similar to the situation for drafts is the situation for removed messages.
  2.2420 -Historically, a message was deleted by renaming.
  2.2421 -A specific
  2.2422 -\fIbackup prefix\fP, often comma (\c
  2.2423 -.Fn , )
  2.2424 -or hash (\c
  2.2425 -.Fn # ),
  2.2426 -being prepended to the file name.
  2.2427 -Thus, MH wouldn't recognize the file
  2.2428 -as a message anymore, as only files whose name consists of digits only
  2.2429 -are treated as messages.
  2.2430 -The removed messages remained as files in the
  2.2431 -same directory and needed some maintenance job to truly delete them after
  2.2432 -some grace time.
  2.2433 -Usually, by running a command similar to
  2.2434 -.VS
  2.2435 -find /home/user/Mail -ctime +7 -name ',*' | xargs rm
  2.2436 -VE
  2.2437 -in a cron job.
  2.2438 -Within the grace time interval
  2.2439 -the original message could be restored by stripping the
  2.2440 -the backup prefix from the file name.
  2.2441 -If however, the last message of
  2.2442 -a folder is been removed \(en say message
  2.2443 -.Fn 6
  2.2444 -becomes file
  2.2445 -.Fn ,6
  2.2446 -\(en and a new message enters the same folder, thus the same
  2.2447 -numbered being given again \(en in our case
  2.2448 -.Fn 6
  2.2449 -\(en, if that one
  2.2450 -is removed too, then the backup of the former message gets overwritten.
  2.2451 -Thus, the ability to restore removed messages does not only depend on
  2.2452 -the ``sweeping cron job'' but also on the removing of further messages.
  2.2453 -This is undesirable, because the real mechanism is hidden from the user
  2.2454 -and the consequences of further removals are not always obvious.
  2.2455 -Further more, the backup files are scattered within the whole mail
  2.2456 -storage, instead of being collected at one place.
  2.2457 -.P
  2.2458 -To improve the situation, the profile entry
  2.2459 -.Pe rmmproc
  2.2460 -(previously named
  2.2461 -.Pe Delete-Prog )
  2.2462 -was introduced, very early.
  2.2463 -It could be set to any command, which would care for the mail removal
  2.2464 -instead of taking the default action, described above.
  2.2465 -Refiling the to-be-removed files to some garbage folder was a common
  2.2466 -example.
  2.2467 -Nmh's man page
  2.2468 -.Mp rmm(1)
  2.2469 -proposes
  2.2470 -.Cl "refile +d
  2.2471 -to move messages to the garbage folder and
  2.2472 -.Cl "rm `mhpath +d all`
  2.2473 -the empty the garbage folder.
  2.2474 -Managing the message removal this way is a sane approach.
  2.2475 -It keeps
  2.2476 -the removed messages in one place, makes it easy to remove the backup
  2.2477 -files, and, most important, enables the user to use the tools of MH
  2.2478 -itself to operate on the removed messages.
  2.2479 -One can
  2.2480 -.Pn scan
  2.2481 -them,
  2.2482 -.Pn show
  2.2483 -them, and restore them with
  2.2484 -.Pn refile .
  2.2485 -There's no more
  2.2486 -need to use
  2.2487 -.Pn mhpath
  2.2488 -to switch over from MH tools to Unix tools \(en MH can do it all itself.
  2.2489 -.P
  2.2490 -This approach matches perfect with the concepts of MH, thus making
  2.2491 -it powerful.
  2.2492 -Hence, I made it the default.
  2.2493 -And even more, I also
  2.2494 -removed the old backup prefix approach, as it is clearly less powerful.
  2.2495 -Keeping unused alternative in the code is a bad choice as they likely
  2.2496 -gather bugs, by not being constantly tested.
  2.2497 -Also, the increased code
  2.2498 -size and more conditions crease the maintenance costs.
  2.2499 -By strictly
  2.2500 -converting to the trash folder approach, I simplified the code base.
  2.2501 -.Pn rmm
  2.2502 -calls
  2.2503 -.Pn refile
  2.2504 -internally to move the to-be-removed
  2.2505 -message to the trash folder (\c
  2.2506 -.Fn +trash
  2.2507 -by default).
  2.2508 -Messages
  2.2509 -there can be operated on like on any other message in the storage.
  2.2510 -The sweep clean, one can use
  2.2511 -.Cl "rmm -unlink +trash a" ,
  2.2512 -where the
  2.2513 -.Sw -unlink
  2.2514 -switch causes the files to be truly unliked instead
  2.2515 -of moved to the trash folder.
  2.2516 -
  2.2517 -
  2.2518 -.H2 "Path Notations
  2.2519 -.P
  2.2520 -foo
  2.2521 -
  2.2522 -
  2.2523 -.H2 "MIME Integration
  2.2524 -.P
  2.2525 -user-visible access to whole messages and MIME parts are inherently
  2.2526 -different
  2.2527 -
  2.2528 -
  2.2529 -.H2 "Of One Cast
  2.2530 -.P
     3.1 --- a/ch04.roff	Sat Jun 23 22:08:17 2012 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,16 +0,0 @@
     3.4 -.H0 "Summary
     3.5 -
     3.6 -.P
     3.7 -Because of several circumstances, my experimental version is rather
     3.8 -a fork today, although this may change again in the future.
     3.9 -
    3.10 -.P
    3.11 -Although mmh bases on nmh, it is likely seen as a step backward.
    3.12 -I agree.
    3.13 -However, this step backward actually is a step forward,
    3.14 -although in a different direction.
    3.15 -
    3.16 -.P
    3.17 -.\" Top candidate for the final sentence:
    3.18 -This enabled me to follow my vision straightly and thus produce
    3.19 -a result of greater pureness.
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/discussion.roff	Sat Jun 23 22:12:14 2012 +0200
     4.3 @@ -0,0 +1,2527 @@
     4.4 +.H0 "Discussion
     4.5 +.P
     4.6 +This main chapter discusses the practical work done in the mmh project.
     4.7 +It is structured along the goals to achieve.
     4.8 +The concrete work done
     4.9 +is described in the examples of how the general goals were achieved.
    4.10 +The discussion compares the current version of mmh with the state of
    4.11 +nmh just before the mmh project started, i.e. Fall 2011.
    4.12 +Current changes of nmh will be mentioned only as side notes.
    4.13 +.\" XXX where do I discuss the parallel development of nmh?
    4.14 +
    4.15 +
    4.16 +
    4.17 +.H1 "Stream-Lining
    4.18 +
    4.19 +.P
    4.20 +MH had been considered an all-in-one system for mail handling.
    4.21 +The community around nmh has a similar understanding.
    4.22 +In fundamental difference, mmh shall be a MUA only.
    4.23 +I believe that the development of all-in-one mail systems is obsolete.
    4.24 +Today, email is too complex to be fully covered by single projects.
    4.25 +Such a project won't be able to excel in all aspects.
    4.26 +Instead, the aspects of email should be covered my multiple projects,
    4.27 +which then can be combined to form a complete system.
    4.28 +Excellent implementations for the various aspects of email exist already.
    4.29 +Just to name three examples: Postfix is a specialized MTA,
    4.30 +Procmail is a specialized MDA, and Fetchmail is a specialized MRA.
    4.31 +I believe that it is best to use such specialized tools instead of
    4.32 +providing the same function again as a side-component in the project.
    4.33 +.P
    4.34 +Doing something well, requires to focus on a small set of specific aspects.
    4.35 +Under the assumption that focused development produces better results
    4.36 +in the particular area, specialized projects will be superior
    4.37 +in their field of focus.
    4.38 +Hence, all-in-one mail system projects \(en no matter if monolithic
    4.39 +or modular \(en will never be the best choice in any of the fields.
    4.40 +Even in providing the best consistent all-in-one system they are likely
    4.41 +to be beaten by projects that focus only on integrating existing mail
    4.42 +components to a homogeneous system.
    4.43 +.P
    4.44 +The limiting resource in Free Software community development
    4.45 +is usually man power.
    4.46 +If the development power is spread over a large development area,
    4.47 +it becomes even more difficult to compete with the specialists in the
    4.48 +various fields.
    4.49 +The concrete situation for MH-based mail systems is even tougher,
    4.50 +given the small and aged community, including both developers and users,
    4.51 +it has.
    4.52 +.P
    4.53 +In consequence, I believe that the available development resources
    4.54 +should focus on the point where MH is most unique.
    4.55 +This is clearly the user interface \(en the MUA.
    4.56 +Peripheral parts should be removed to stream-line mmh for the MUA task.
    4.57 +
    4.58 +
    4.59 +.H2 "Mail Transfer Facilities
    4.60 +.P
    4.61 +In contrast to nmh, which also provides mail submission and mail retrieval
    4.62 +agents, mmh is a MUA only.
    4.63 +This general difference initiated the development of mmh.
    4.64 +Removing the mail transfer facilities had been the first work task
    4.65 +in the mmh project.
    4.66 +.P
    4.67 +Focusing on one mail agent role only is motivated by Eric Allman's
    4.68 +experience with Sendmail.
    4.69 +He identified limiting Sendmail the MTA task had be one reason for
    4.70 +its success:
    4.71 +.[ [
    4.72 +costales sendmail
    4.73 +.], p. xviii]
    4.74 +.QS
    4.75 +Second, I limited myself to the routing function \(en
    4.76 +I wouldn't write user agents or delivery backends.
    4.77 +This was a departure of the dominant through of the time,
    4.78 +in which routing logic, local delivery, and often the network code
    4.79 +were incorporated directly into the user agents.
    4.80 +.QE
    4.81 +.P
    4.82 +In mmh, the Mail Submission Agent (MSA) is called
    4.83 +\fIMessage Transfer Service\fP (MTS).
    4.84 +This facility, implemented by the
    4.85 +.Pn post
    4.86 +command, established network connections and spoke SMTP to submit
    4.87 +messages for relay to the outside world.
    4.88 +The changes in email demanded changes in this part of nmh too.
    4.89 +Encryption and authentication for network connections
    4.90 +needed to be supported, hence TLS and SASL were introduced into nmh.
    4.91 +This added complexity to nmh without improving it in its core functions.
    4.92 +Also, keeping up with recent developments in the field of
    4.93 +mail transfer requires development power and specialists.
    4.94 +In mmh this whole facility was simply cut off.
    4.95 +.Ci f6aa95b724fd8c791164abe7ee5468bf5c34f226
    4.96 +.Ci fecd5d34f65597a4dfa16aeabea7d74b191532c3
    4.97 +.Ci 156d35f6425bea4c1ed3c4c79783dc613379c65b
    4.98 +Instead, mmh depends on an external MSA.
    4.99 +The only outgoing interface available to mmh is the
   4.100 +.Pn sendmail
   4.101 +command, which almost any MSA provides.
   4.102 +If not, a wrapper program can be written.
   4.103 +It must read the message from the standard input, extract the
   4.104 +recipient addresses from the message header, and hand the message
   4.105 +over to the MSA.
   4.106 +For example, a wrapper script for qmail would be:
   4.107 +.VS
   4.108 +#!/bin/sh
   4.109 +# ignore command line arguments
   4.110 +exec qmail-inject
   4.111 +VE
   4.112 +The requirement to parse the recipient addresses out of the message header 
   4.113 +is likely to be removed in the future.
   4.114 +Then mmh would give the recipient addresses as command line arguments.
   4.115 +This appears to be the better interface.
   4.116 +.\" XXX implement it
   4.117 +.P
   4.118 +To retrieve mail, the
   4.119 +.Pn inc
   4.120 +command acted as Mail Retrieval Agent (MRA).
   4.121 +It established network connections
   4.122 +and spoke POP3 to retrieve mail from remote servers.
   4.123 +As with mail submission, the network connections required encryption and
   4.124 +authentication, thus TLS and SASL were added.
   4.125 +Support for message retrieval through IMAP will become necessary
   4.126 +to be added soon, too, and likewise for any other changes in mail transfer.
   4.127 +Not so for mmh because it has dropped the support for retrieving mail
   4.128 +from remote locations.
   4.129 +.Ci ab7b48411962d26439f92f35ed084d3d6275459c
   4.130 +Instead, it depends on an external tool to cover this task.
   4.131 +In mmh exist two paths for messages to enter mmh's mail storage:
   4.132 +(1) Mail can be incorporated with
   4.133 +.Pn inc
   4.134 +from the system maildrop, or (2) with
   4.135 +.Pn rcvstore
   4.136 +by reading them, one at a time, from the standard input.
   4.137 +.P
   4.138 +With the removal of the MSA and MRA, mmh converted from an all-in-one
   4.139 +mail system to being a MUA only.
   4.140 +Now, of course, mmh depends on third-party software.
   4.141 +An external MSA is required to transfer mail to the outside world;
   4.142 +an external MRA is required to retrieve mail from remote machines.
   4.143 +There exist excellent implementations of such software,
   4.144 +which do this specific task likely better than the internal
   4.145 +versions had done it.
   4.146 +Also, the best suiting programs can be freely chosen.
   4.147 +.P
   4.148 +As it had already been possible to use an external MSA or MRA,
   4.149 +why not keep the internal version for convenience?
   4.150 +The question whether there is sense in having a fall-back pager in all
   4.151 +the command line tools, for the cases when
   4.152 +.Pn more
   4.153 +or
   4.154 +.Pn less
   4.155 +aren't available, appears to be ridiculous.
   4.156 +Of course, MSAs and MRAs are more complex than text pagers
   4.157 +and not necessarily available but still the concept of orthogonal
   4.158 +design holds: ``Write programs that do one thing and do it well.''
   4.159 +.[
   4.160 +mcilroy unix phil
   4.161 +p. 53
   4.162 +.]
   4.163 +.[
   4.164 +mcilroy bstj foreword
   4.165 +.]
   4.166 +Here, this part of the Unix philosophy was applied not only
   4.167 +to the programs but to the project itself.
   4.168 +In other words:
   4.169 +``Develop projects that focus on one thing and do it well.''
   4.170 +Projects grown complex should be split for the same reasons programs grown
   4.171 +complex should be split.
   4.172 +If it is conceptionally more elegant to have the MSA and MRA as
   4.173 +separate projects then they should be separated.
   4.174 +This is the case here, in my opinion.
   4.175 +The RFCs propose this separation by clearly distinguishing the different
   4.176 +mail handling tasks.
   4.177 +.[
   4.178 +rfc 821
   4.179 +.]
   4.180 +The small interfaces between the mail agents support the separation.
   4.181 +.P
   4.182 +In the beginning, email had been small and simple.
   4.183 +At that time,
   4.184 +.Pn /bin/mail
   4.185 +had covered anything there was to email and still had been small
   4.186 +and simple.
   4.187 +Later, the essential complexity of email increased.
   4.188 +(Essential complexity is the complexity defined by the problem itself.\0
   4.189 +.[[
   4.190 +brooks no silver bullet
   4.191 +.]])
   4.192 +Email systems reacted to this change: They grew.
   4.193 +RFCs started to introduce the concept of mail agents to separate the
   4.194 +various tasks because they became more extensive and new tasks appeared.
   4.195 +As the mail systems grew even more, parts were split off.
   4.196 +In nmh, for instance, the POP server, which was included in the original
   4.197 +MH, was removed.
   4.198 +Now is the time to go one step further and split the MSA and MRA off, too.
   4.199 +Not only does this decrease the code size of the project,
   4.200 +but, more important, it unburdens mmh of the whole field of
   4.201 +message transfer with all its implications for the project.
   4.202 +There is no more need to concern with changes in network transfer.
   4.203 +This independence is received by depending on an external program
   4.204 +that covers the field.
   4.205 +Today, this is a reasonable exchange.
   4.206 +.P
   4.207 +Functionality can be added in three different ways:
   4.208 +.BU
   4.209 +Implementing the function originally in the project.
   4.210 +.BU
   4.211 +Depending on a library that provides the function.
   4.212 +.BU
   4.213 +Depending on a program that provides the function.
   4.214 +.P
   4.215 +Whereas adding the function originally to the project increases the
   4.216 +code size most and requires most maintenance and development work,
   4.217 +it makes the project most independent of other software.
   4.218 +Using libraries or external programs require less maintenance work
   4.219 +but introduces dependencies on external software.
   4.220 +Programs have the smallest interfaces and provide the best separation
   4.221 +but possibly limit the information exchange.
   4.222 +External libraries are stronger connected than external programs,
   4.223 +thus information can be exchanged more flexible.
   4.224 +Adding code to a project increases maintenance work.
   4.225 +.\" XXX ref
   4.226 +Implementing complex functions originally in the project adds
   4.227 +a lot of code.
   4.228 +This should be avoided if possible.
   4.229 +Hence, the dependencies only change in kind, not in their existence.
   4.230 +In mmh, library dependencies on
   4.231 +.Pn libsasl2
   4.232 +and
   4.233 +.Pn libcrypto /\c
   4.234 +.Pn libssl
   4.235 +were treated against program dependencies on an MSA and an MRA.
   4.236 +This also meant treating build-time dependencies against run-time
   4.237 +dependencies.
   4.238 +Besides program dependencies providing the stronger separation
   4.239 +and being more flexible, they also allowed
   4.240 +over 6\|000 lines of code to be removed from mmh.
   4.241 +This made mmh's code base about 12\|% smaller.
   4.242 +Reducing the project's code size by such an amount without actually
   4.243 +losing functionality is a convincing argument.
   4.244 +Actually, as external MSAs and MRAs are likely superior to the
   4.245 +project's internal versions, the common user even gains functionality.
   4.246 +.P
   4.247 +Users of MH should not have problems to set up an external MSA and MRA.
   4.248 +Also, the popular MSAs and MRAs have large communities and a lot
   4.249 +of documentation available.
   4.250 +Choices for MSAs range from full-featured MTAs like
   4.251 +.I Postfix
   4.252 +over mid-size MTAs like
   4.253 +.I masqmail
   4.254 +and
   4.255 +.I dma
   4.256 +to small forwarders like
   4.257 +.I ssmtp
   4.258 +and
   4.259 +.I nullmailer .
   4.260 +Choices for MRAs include
   4.261 +.I fetchmail ,
   4.262 +.I getmail ,
   4.263 +.I mpop
   4.264 +and
   4.265 +.I fdm .
   4.266 +
   4.267 +
   4.268 +.H2 "Non-MUA Tools
   4.269 +.P
   4.270 +One goal of mmh is to remove the tools that are not part of the MUA's task.
   4.271 +Further more, any tools that don't improve the MUA's job significantly
   4.272 +should be removed.
   4.273 +Loosely related and rarely used tools distract from the lean appearance.
   4.274 +They require maintenance work without adding much to the core task.
   4.275 +By removing these tools, the project shall become more stream-lined
   4.276 +and focused.
   4.277 +In mmh the following tools are not available anymore:
   4.278 +.BU
   4.279 +.Pn conflict
   4.280 +was removed
   4.281 +.Ci 8b235097cbd11d728c07b966cf131aa7133ce5a9
   4.282 +because it is a mail system maintenance tool that is not MUA-related.
   4.283 +It even checked
   4.284 +.Fn /etc/passwd
   4.285 +and
   4.286 +.Fn /etc/group
   4.287 +for consistency, which is completely unrelated to email.
   4.288 +A tool like
   4.289 +.Pn conflict
   4.290 +is surely useful, but it should not be shipped with mmh.
   4.291 +.\" XXX historic reasons?
   4.292 +.BU
   4.293 +.Pn rcvtty
   4.294 +was removed
   4.295 +.Ci 14767c94b3827be7c867196467ed7aea5f6f49b0
   4.296 +because its use case of writing to the user's terminal
   4.297 +on receiving of mail is obsolete.
   4.298 +If users like to be informed of new mail, the shell's
   4.299 +.Ev MAILPATH
   4.300 +variable or graphical notifications are technically more appealing.
   4.301 +Writing directly to terminals is hardly ever wanted today.
   4.302 +If though one wants to have it this way, the standard tool
   4.303 +.Pn write
   4.304 +can be used in a way similar to:
   4.305 +.VS
   4.306 +scan -file - | write `id -un`
   4.307 +VE
   4.308 +.BU
   4.309 +.Pn viamail
   4.310 +was removed
   4.311 +.Ci eda72d6a7a7c20ff123043fb7f19c509ea01f932
   4.312 +when the new attachment system was activated, because
   4.313 +.Pn forw
   4.314 +could then cover the task itself.
   4.315 +The program
   4.316 +.Pn sendfiles
   4.317 +was rewritten as a shell script wrapper around
   4.318 +.Pn forw .
   4.319 +.Ci 0e82199cf3c991a173e0ac8aa776efdb3ded61e6
   4.320 +.BU
   4.321 +.Pn msgchk
   4.322 +was removed
   4.323 +.Ci bb9360ead7eb7a3fedcce2eeedfc660014e41dbe ,
   4.324 +because it lost its use case when POP support was removed.
   4.325 +A call to
   4.326 +.Pn msgchk
   4.327 +provided hardly more information than:
   4.328 +.VS
   4.329 +ls -l /var/mail/meillo
   4.330 +VE
   4.331 +It did distinguish between old and new mail, but
   4.332 +this detail information can be retrieved with
   4.333 +.Pn stat (1),
   4.334 +too.
   4.335 +A small shell script could be written to print the information
   4.336 +in a similar way, if truly necessary.
   4.337 +As mmh's
   4.338 +.Pn inc
   4.339 +only incorporates mail from the user's local maildrop,
   4.340 +and thus no data transfers over slow networks are involved,
   4.341 +there's hardly any need to check for new mail before incorporating it.
   4.342 +.BU
   4.343 +.Pn msh
   4.344 +was removed
   4.345 +.Ci 916690191222433a6923a4be54b0d8f6ac01bd02
   4.346 +because the tool was in conflict with the philosophy of MH.
   4.347 +It provided an interactive shell to access the features of MH,
   4.348 +but it wasn't just a shell, tailored to the needs of mail handling.
   4.349 +Instead it was one large program that had several MH tools built in.
   4.350 +This conflicts with the major feature of MH of being a tool chest.
   4.351 +.Pn msh 's
   4.352 +main use case had been accessing Bulletin Boards, which have seized to
   4.353 +be popular.
   4.354 +.P
   4.355 +Removing
   4.356 +.Pn msh ,
   4.357 +together with the truly archaic code relicts
   4.358 +.Pn vmh
   4.359 +and
   4.360 +.Pn wmh ,
   4.361 +saved more than 7\|000 lines of C code \(en
   4.362 +about 15\|% of the project's original source code amount.
   4.363 +Having less code \(en with equal readability, of course \(en
   4.364 +for the same functionality is an advantage.
   4.365 +Less code means less bugs and less maintenance work.
   4.366 +As
   4.367 +.Pn rcvtty
   4.368 +and
   4.369 +.Pn msgchk
   4.370 +are assumed to be rarely used and can be implemented in different ways,
   4.371 +why should one keep them?
   4.372 +Removing them stream-lines mmh.
   4.373 +.Pn viamail 's
   4.374 +use case is now partly obsolete and partly covered by
   4.375 +.Pn forw ,
   4.376 +hence there's no reason to still maintain it.
   4.377 +.Pn conflict
   4.378 +is not related to the mail client, and
   4.379 +.Pn msh
   4.380 +conflicts with the basic concept of MH.
   4.381 +Theses two tools might still be useful, but they should not be part of mmh.
   4.382 +.P
   4.383 +Finally, there's
   4.384 +.Pn slocal .
   4.385 +.Pn slocal
   4.386 +is an MDA and thus not directly MUA-related.
   4.387 +It should be removed from mmh, because including it conflicts with
   4.388 +the idea that mmh is a MUA only.
   4.389 +.Pn slocal
   4.390 +should rather become a separate project.
   4.391 +However,
   4.392 +.Pn slocal
   4.393 +provides rule-based processing of messages, like filing them into
   4.394 +different folders, which is otherwise not available in mmh.
   4.395 +Although
   4.396 +.Pn slocal
   4.397 +does neither pull in dependencies nor does it include a separate
   4.398 +technical area (cf. Sec. XXX), still,
   4.399 +it accounts for about 1\|000 lines of code that need to be maintained.
   4.400 +As
   4.401 +.Pn slocal
   4.402 +is almost self-standing, it should be split off into a separate project.
   4.403 +This would cut the strong connection between the MUA mmh and the MDA
   4.404 +.Pn slocal .
   4.405 +For anyone not using MH,
   4.406 +.Pn slocal
   4.407 +would become yet another independent MDA, like
   4.408 +.I procmail .
   4.409 +Then
   4.410 +.Pn slocal
   4.411 +could be installed without the complete MH system.
   4.412 +Likewise, mmh users could decide to use
   4.413 +.I procmail
   4.414 +without having a second, unused MDA,
   4.415 +.Pn slocal ,
   4.416 +installed.
   4.417 +That appears to be conceptionally the best solution.
   4.418 +Yet,
   4.419 +.Pn slocal
   4.420 +is not split off.
   4.421 +I defer the decision over
   4.422 +.Pn slocal
   4.423 +in need for deeper investigation.
   4.424 +In the meanwhile, it remains part of mmh.
   4.425 +That does not hurt because
   4.426 +.Pn slocal
   4.427 +is unrelated to the rest of the project.
   4.428 +
   4.429 +
   4.430 +.H2 "\fLshow\fP and \fPmhshow\fP
   4.431 +.P
   4.432 +Since the very beginning \(en already in the first concept paper \(en
   4.433 +.Pn show
   4.434 +had been MH's message display program.
   4.435 +.Pn show
   4.436 +mapped message numbers and sequences to files and invoked
   4.437 +.Pn mhl
   4.438 +to have the files formatted.
   4.439 +With MIME, this approach wasn't sufficient anymore.
   4.440 +MIME messages can consist of multiple parts. Some parts are not
   4.441 +directly displayable and text content might be encoded in
   4.442 +foreign charsets.
   4.443 +.Pn show 's
   4.444 +understanding of messages and
   4.445 +.Pn mhl 's
   4.446 +display capabilities couldn't cope with the task any longer.
   4.447 +.P
   4.448 +Instead of extending these tools, additional tools were written from
   4.449 +scratch and added to the MH tool chest.
   4.450 +Doing so is encouraged by the tool chest approach.
   4.451 +Modular design is a great advantage for extending a system,
   4.452 +as new tools can be added without interfering with existing ones.
   4.453 +First, the new MIME features were added in form of the single program
   4.454 +.Pn mhn .
   4.455 +The command
   4.456 +.Cl "mhn -show 42
   4.457 +would show the MIME message numbered 42.
   4.458 +With the 1.0 release of nmh in February 1999, Richard Coleman finished
   4.459 +the split of
   4.460 +.Pn mhn
   4.461 +into a set of specialized tools, which together covered the
   4.462 +multiple aspects of MIME.
   4.463 +One of them was
   4.464 +.Pn mhshow ,
   4.465 +which replaced
   4.466 +.Cl "mhn -show" .
   4.467 +It was capable of displaying MIME messages appropriately.
   4.468 +.P
   4.469 +From then on, two message display tools were part of nmh,
   4.470 +.Pn show
   4.471 +and
   4.472 +.Pn mhshow .
   4.473 +To ease the life of users,
   4.474 +.Pn show
   4.475 +was extended to automatically hand the job over to
   4.476 +.Pn mhshow
   4.477 +if displaying the message would be beyond
   4.478 +.Pn show 's
   4.479 +abilities.
   4.480 +In consequence, the user would simply invoke
   4.481 +.Pn show
   4.482 +(possibly through
   4.483 +.Pn next
   4.484 +or
   4.485 +.Pn prev )
   4.486 +and get the message printed with either
   4.487 +.Pn show
   4.488 +or
   4.489 +.Pn mhshow ,
   4.490 +whatever was more appropriate.
   4.491 +.P
   4.492 +Having two similar tools for essentially the same task is redundant.
   4.493 +Usually,
   4.494 +users wouldn't distinguish between
   4.495 +.Pn show
   4.496 +and
   4.497 +.Pn mhshow
   4.498 +in their daily mail reading.
   4.499 +Having two separate display programs was therefore mainly unnecessary
   4.500 +from a user's point of view.
   4.501 +Besides, the development of both programs needed to be in sync,
   4.502 +to ensure that the programs behaved in a similar way,
   4.503 +because they were used like a single tool.
   4.504 +Different behavior would have surprised the user.
   4.505 +.P
   4.506 +Today, non-MIME messages are rather seen to be a special case of
   4.507 +MIME messages, although it is the other way round.
   4.508 +As
   4.509 +.Pn mhshow
   4.510 +had already be able to display non-MIME messages, it appeared natural
   4.511 +to drop
   4.512 +.Pn show
   4.513 +in favor of using
   4.514 +.Pn mhshow
   4.515 +exclusively.
   4.516 +.Ci 4c1efddfd499300c7e74263e57d8aa137e84c853
   4.517 +Removing
   4.518 +.Pn show
   4.519 +is no loss in function, because functionally
   4.520 +.Pn mhshow
   4.521 +covers it completely.
   4.522 +The old behavior of
   4.523 +.Pn show
   4.524 +can still be emulated with the simple command line:
   4.525 +.VS
   4.526 +mhl `mhpath c`
   4.527 +VE
   4.528 +.P
   4.529 +For convenience,
   4.530 +.Pn mhshow
   4.531 +was renamed to
   4.532 +.Pn show
   4.533 +after
   4.534 +.Pn show
   4.535 +was gone.
   4.536 +It is clear that such a rename may confuse future developers when
   4.537 +trying to understand the history.
   4.538 +Nevertheless, I consider the convenience on the user's side,
   4.539 +to call
   4.540 +.Pn show
   4.541 +when they want a message to be displayed, to outweigh the inconvenience
   4.542 +on the developer's side when understanding the project history.
   4.543 +.P
   4.544 +To prepare for the transition,
   4.545 +.Pn mhshow
   4.546 +was reworked to behave more like
   4.547 +.Pn show
   4.548 +first.
   4.549 +(cf. Sec. XXX)
   4.550 +Once the tools behaved more alike, the replacing appeared to be
   4.551 +even more natural.
   4.552 +Today, mmh's new
   4.553 +.Pn show
   4.554 +became the one single message display program again, with the difference
   4.555 +that today it handles MIME messages as well as non-MIME messages.
   4.556 +The outcome of the transition is one program less to maintain,
   4.557 +no second display program for users to deal with,
   4.558 +and less system complexity.
   4.559 +.P
   4.560 +Still, removing the old
   4.561 +.Pn show
   4.562 +hurts in one regard: It had been such a simple program.
   4.563 +Its lean elegance is missing to the new
   4.564 +.Pn show .
   4.565 +But there is no chance;
   4.566 +supporting MIME demands for higher essential complexity.
   4.567 +
   4.568 +
   4.569 +.H2 "Configure Options
   4.570 +.P
   4.571 +Customization is a double-edged sword.
   4.572 +It allows better suiting setups, but not for free.
   4.573 +There is the cost of code complexity to be able to customize.
   4.574 +There is the cost of less tested setups, because there are
   4.575 +more possible setups and especially corner-cases.
   4.576 +And, there is the cost of choice itself.
   4.577 +The code complexity directly affects the developers.
   4.578 +Less tested code affects both, users and developers.
   4.579 +The problem of choice affects the users, for once by having to
   4.580 +choose, but also by more complex interfaces that require more documentation.
   4.581 +Whenever options add little advantages, they should be considered for
   4.582 +removal.
   4.583 +I have reduced the number of project-specific configure options from 
   4.584 +fifteen to three.
   4.585 +
   4.586 +.U3 "Mail Transfer Facilities
   4.587 +.P
   4.588 +With the removal of the mail transfer facilities five configure
   4.589 +options vanished:
   4.590 +.P
   4.591 +The switches
   4.592 +.Sw --with-tls
   4.593 +and
   4.594 +.Sw --with-cyrus-sasl
   4.595 +had activated the support for transfer encryption and authentication.
   4.596 +This is not needed anymore.
   4.597 +.Ci fecd5d34f65597a4dfa16aeabea7d74b191532c3
   4.598 +.Ci 156d35f6425bea4c1ed3c4c79783dc613379c65b
   4.599 +.P
   4.600 +The configure switch
   4.601 +.Sw --enable-pop
   4.602 +activated the message retrieval facility.
   4.603 +The code area that would be conditionally compiled in for TLS and SASL
   4.604 +support had been small.
   4.605 +The conditionally compiled code area for POP support had been much larger.
   4.606 +Whereas the code base changes would only slightly change on toggling
   4.607 +TLS or SASL support, it changed much on toggling POP support.
   4.608 +The changes in the code base could hardly be overviewed.
   4.609 +By having POP support togglable a second code base had been created,
   4.610 +one that needed to be tested.
   4.611 +This situation is basically similar for the conditional TLS and SASL  
   4.612 +code, but there the changes are minor and can yet be overviewed.
   4.613 +Still, conditional compilation of a code base creates variations
   4.614 +of the original program.
   4.615 +More variations require more testing and maintenance work.
   4.616 +.P
   4.617 +Two other options only specified default configuration values:
   4.618 +.Sw --with-mts
   4.619 +defined the default transport service, either
   4.620 +.Ar smtp
   4.621 +or
   4.622 +.Ar sendmail .
   4.623 +In mmh this fixed to
   4.624 +.Ar sendmail .
   4.625 +.Ci f6aa95b724fd8c791164abe7ee5468bf5c34f226
   4.626 +With
   4.627 +.Sw --with-smtpservers
   4.628 +default SMTP servers for the
   4.629 +.Ar smtp
   4.630 +transport service could be specified.
   4.631 +.Ci 128545e06224233b7e91fc4c83f8830252fe16c9
   4.632 +Both of them became irrelevant.
   4.633 +
   4.634 +.U3 "Backup Prefix
   4.635 +.P
   4.636 +The backup prefix is the string that was prepended to message
   4.637 +filenames to tag them as deleted.
   4.638 +By default it had been the comma character `\f(CW,\fP'.
   4.639 +In July 2000, Kimmo Suominen introduced
   4.640 +the configure option
   4.641 +.Sw --with-hash-backup
   4.642 +to change the default to the hash symbol `\f(CW#\fP'.
   4.643 +The choice was probably personal preference, because first, the
   4.644 +option was named
   4.645 +.Sw --with-backup-prefix.
   4.646 +and had the prefix symbol as argument.
   4.647 +But giving the hash symbol as argument caused too many problems
   4.648 +for Autoconf,
   4.649 +thus the option was limited to use the hash symbol as the default prefix.
   4.650 +This supports the assumption, that the choice for the hash was
   4.651 +personal preference only.
   4.652 +Being related or not, words that start with the hash symbol
   4.653 +introduce a comment in the Unix shell.
   4.654 +Thus, the command line
   4.655 +.Cl "rm #13 #15
   4.656 +calls
   4.657 +.Pn rm
   4.658 +without arguments because the first hash symbol starts the comment
   4.659 +that reaches until the end of the line.
   4.660 +To delete the backup files,
   4.661 +.Cl "rm ./#13 ./#15"
   4.662 +needs to be used.
   4.663 +Using the hash as backup prefix can be seen as a precaution against
   4.664 +data loss.
   4.665 +.P
   4.666 +I removed the configure option but added the profile entry
   4.667 +.Pe backup-prefix ,
   4.668 +which allows to specify an arbitrary string as backup prefix.
   4.669 +.Ci 6c40d481d661d532dd527eaf34cebb6d3f8ed086
   4.670 +Profile entries are the common method to change mmh's behavior.
   4.671 +This change did not remove the choice but moved it to a location where
   4.672 +it suited better.
   4.673 +.P
   4.674 +Eventually, however, the new trash folder concept
   4.675 +.Cf "Sec. XXX
   4.676 +obsoleted the concept of the backup prefix completely.
   4.677 +.Ci 8edc5aaf86f9f77124664f6801bc6c6cdf258173
   4.678 +.\" (Well, there still are corner-cases to remove until the backup
   4.679 +.\" prefix can be laid to rest, eventually.)
   4.680 +.\" FIXME: Do this work in the code!
   4.681 +
   4.682 +.U3 "Editor and Pager
   4.683 +.P
   4.684 +The two configure options
   4.685 +.CW --with-editor=EDITOR
   4.686 +.CW --with-pager=PAGER
   4.687 +were used to specify the default editor and pager at configure time.
   4.688 +Doing so at configure time made sense in the Eighties,
   4.689 +when the set of available editors and pagers varied much across
   4.690 +different systems.
   4.691 +Today, the situation is more homogeneous.
   4.692 +The programs
   4.693 +.Pn vi
   4.694 +and
   4.695 +.Pn more
   4.696 +can be expected to be available on every Unix system,
   4.697 +as they are specified by POSIX since two decades.
   4.698 +(The specifications for
   4.699 +.Pn vi
   4.700 +and
   4.701 +.Pn more
   4.702 +appeared in
   4.703 +.[
   4.704 +posix 1987
   4.705 +.]
   4.706 +and,
   4.707 +.[
   4.708 +posix 1992
   4.709 +.]
   4.710 +respectively.)
   4.711 +As a first step, these two tools were hard-coded as defaults.
   4.712 +.Ci 5d43a99db70c12a673028c7758c20cbe3e13ef5f
   4.713 +Not changed were the
   4.714 +.Pe editor
   4.715 +and
   4.716 +.Pe moreproc
   4.717 +profile entries, which allowed the user to override the system defaults.
   4.718 +Later, the concept was reworked to respect the standard environment
   4.719 +variables
   4.720 +.Ev VISUAL
   4.721 +and
   4.722 +.Ev PAGER
   4.723 +if they are set.
   4.724 +Today, mmh determines the editor to use in the following order,
   4.725 +taking the first available and non-empty item:
   4.726 +.IP (1)
   4.727 +Environment variable
   4.728 +.Ev MMHEDITOR
   4.729 +.IP (2)
   4.730 +Profile entry
   4.731 +.Pe Editor
   4.732 +.IP (3)
   4.733 +Environment variable
   4.734 +.Ev VISUAL
   4.735 +.IP (4)
   4.736 +Environment variable
   4.737 +.Ev EDITOR
   4.738 +.IP (5)
   4.739 +Command
   4.740 +.Pn vi .
   4.741 +.P
   4.742 +.Ci f85f4b7ae62e3d05a945dcd46ead51f0a2a89a9b
   4.743 +.P
   4.744 +The pager to use is determined in a similar order,
   4.745 +also taking the first available and non-empty item:
   4.746 +.IP (1)
   4.747 +Environment variable
   4.748 +.Ev MMHPAGER
   4.749 +.IP (2)
   4.750 +Profile entry
   4.751 +.Pe Pager
   4.752 +(replaces
   4.753 +.Pe moreproc )
   4.754 +.IP (3)
   4.755 +Environment variable
   4.756 +.Ev PAGER
   4.757 +.IP (4)
   4.758 +Command
   4.759 +.Pn more .
   4.760 +.P
   4.761 +.Ci 0c4214ea2aec6497d0d67b436bbee9bc1d225f1e
   4.762 +.P
   4.763 +By respecting the
   4.764 +.Ev VISUAL /\c
   4.765 +.Ev EDITOR
   4.766 +and
   4.767 +.Ev PAGER
   4.768 +environment variables,
   4.769 +the new behavior confirms better to the common style on Unix systems.
   4.770 +Additionally, the new approach is more uniform and clearer to users.
   4.771 +
   4.772 +
   4.773 +.U3 "ndbm
   4.774 +.P
   4.775 +.Pn slocal
   4.776 +used to depend on
   4.777 +.I ndbm ,
   4.778 +a database library.
   4.779 +The database is used to store the `\fLMessage-ID\fP's of all
   4.780 +messages delivered.
   4.781 +This enables
   4.782 +.Pn slocal
   4.783 +to suppress delivering the same message to the same user twice.
   4.784 +(This features was enabled by the
   4.785 +.Sw -suppressdup
   4.786 +switch.)
   4.787 +.P
   4.788 +A variety of versions of the database library exist.
   4.789 +.[
   4.790 +wolter unix incompat notes dbm
   4.791 +.]
   4.792 +Complicated autoconf code was needed to detect them correctly.
   4.793 +Further more, the configure switches
   4.794 +.Sw --with-ndbm=ARG
   4.795 +and
   4.796 +.Sw --with-ndbmheader=ARG
   4.797 +were added to help with difficult setups that would
   4.798 +not be detected automatically or correctly.
   4.799 +.P
   4.800 +By removing the suppress duplicates feature of
   4.801 +.Pn slocal ,
   4.802 +the dependency on
   4.803 +.I ndbm
   4.804 +vanished and 120 lines of complex autoconf code could be saved.
   4.805 +.Ci ecd6d6a20cb7a1507e3a20d6c4cb3a1cf14c6bbf
   4.806 +The change removed functionality too, but that is minor to the
   4.807 +improvement by dropping the dependency and the complex autoconf code.
   4.808 +
   4.809 +.U3 "mh-e Support
   4.810 +.P
   4.811 +The configure option
   4.812 +.Sw --disable-mhe
   4.813 +was removed when the mh-e support was reworked. 
   4.814 +Mh-e is the Emacs front-end to MH.
   4.815 +It requires MH to provide minor additional functions.
   4.816 +The
   4.817 +.Sw --disable-mhe
   4.818 +configure option could switch these extensions off.
   4.819 +After removing the support for old versions of mh-e,
   4.820 +only the
   4.821 +.Sw -build
   4.822 +switches of
   4.823 +.Pn forw
   4.824 +and
   4.825 +.Pn repl
   4.826 +are left to be mh-e extensions.
   4.827 +They are now always built in because they add little code and complexity.
   4.828 +In consequence, the
   4.829 +.Sw --disable-mhe
   4.830 +configure option was removed
   4.831 +.Ci a7ce7b4a580d77b6c2c4d980812beb589aa4c643
   4.832 +Removing the option removed a second code setup that would have
   4.833 +needed to be tested.
   4.834 +This change was first done in nmh and thereafter merged into mmh.
   4.835 +.P
   4.836 +The interface changes in mmh require mh-e to be adjusted in order
   4.837 +to be able to use mmh as back-end.
   4.838 +This will require minor changes to mh-e, but removing the
   4.839 +.Sw -build
   4.840 +switches would require more rework.
   4.841 +
   4.842 +.U3 "Masquerading
   4.843 +.P
   4.844 +The configure option
   4.845 +.Sw --enable-masquerade
   4.846 +could take up to three arguments:
   4.847 +`draft_from', `mmailid', and `username_extension'.
   4.848 +They activated different types of address masquerading.
   4.849 +All of them were implemented in the SMTP-speaking
   4.850 +.Pn post
   4.851 +command, which provided an MSA.
   4.852 +Address masquerading is an MTA's task and mmh does not cover
   4.853 +this field anymore.
   4.854 +Hence, true masquerading needs to be implemented in the external MTA.
   4.855 +.P
   4.856 +The
   4.857 +.I mmailid
   4.858 +masquerading type is the oldest one of the three and the only one
   4.859 +available in the original MH.
   4.860 +It provided a
   4.861 +.I username
   4.862 +to
   4.863 +.I fakeusername
   4.864 +mapping, based on the password file's GECOS field.
   4.865 +The man page
   4.866 +.Mp mh-tailor(5)
   4.867 +described the use case as being the following:
   4.868 +.QS
   4.869 +This is useful if you want the messages you send to always
   4.870 +appear to come from the name of an MTA alias rather than your
   4.871 +actual account name.  For instance, many organizations set up
   4.872 +`First.Last' sendmail aliases for all users.  If this is
   4.873 +the case, the GECOS field for each user should look like:
   4.874 +``First [Middle] Last <First.Last>''
   4.875 +.QE
   4.876 +.P
   4.877 +As mmh sends outgoing mail via the local MTA only,
   4.878 +the best location to do such global rewrites is there.
   4.879 +Besides, the MTA is conceptionally the right location because it
   4.880 +does the reverse mapping for incoming mail (aliasing), too.
   4.881 +Further more, masquerading set up there is readily available for all
   4.882 +mail software on the system.
   4.883 +Hence, mmailid masquerading was removed.
   4.884 +.Ci 0836c8000ccb34b59410ef1c15b1b7feac70ce5f
   4.885 +.P
   4.886 +The
   4.887 +.I username_extension
   4.888 +masquerading type did not replace the username but would append a suffix,
   4.889 +specified by the
   4.890 +.Ev USERNAME_EXTENSION
   4.891 +environment variable, to it.
   4.892 +This provided support for the
   4.893 +.I user-extension
   4.894 +feature of qmail and the similar
   4.895 +.I "plussed user
   4.896 +processing of sendmail.
   4.897 +The decision to remove this username_extension masquerading was
   4.898 +motivated by the fact that
   4.899 +.Pn spost
   4.900 +hadn't supported it already.
   4.901 +.Ci 2abae0bfd0ad5bf898461e50aa4b466d641f23d9
   4.902 +Username extensions are possible in mmh, but less convenient to use.
   4.903 +.\" XXX format file %(getenv USERNAME_EXTENSION)
   4.904 +.P
   4.905 +The
   4.906 +.I draft_from
   4.907 +masquerading type instructed
   4.908 +.Pn post
   4.909 +to use the value of the
   4.910 +.Hd From
   4.911 +header field as SMTP envelope sender.
   4.912 +Sender addresses could be replaced completely.
   4.913 +.Ci b14ea6073f77b4359aaf3fddd0e105989db9
   4.914 +Mmh offers a kind of masquerading similar in effect, but
   4.915 +with technical differences.
   4.916 +As mmh does not transfer messages itself, the local MTA has final control
   4.917 +over the sender's address. Any masquerading mmh introduces may be reverted
   4.918 +by the MTA.
   4.919 +In times of pedantic spam checking, an MTA will take care to use
   4.920 +sensible envelope sender addresses to keep its own reputation up.
   4.921 +Nonetheless, the MUA can set the
   4.922 +.Hd From
   4.923 +header field and thereby propose
   4.924 +a sender address to the MTA.
   4.925 +The MTA may then decide to take that one or generate the canonical sender
   4.926 +address for use as envelope sender address.
   4.927 +.P
   4.928 +In mmh, the MTA will always extract the recipient and sender from the
   4.929 +message header (\c
   4.930 +.Pn sendmail 's
   4.931 +.Sw -t
   4.932 +switch).
   4.933 +The
   4.934 +.Hd From
   4.935 +header field of the draft may be set arbitrary by the user.
   4.936 +If it is missing, the canonical sender address will be generated by the MTA.
   4.937 +
   4.938 +.U3 "Remaining Options
   4.939 +.P
   4.940 +Two configure options remain in mmh.
   4.941 +One is the locking method to use:
   4.942 +.Sw --with-locking=[dot|fcntl|flock|lockf] .
   4.943 +The idea of removing all methods except the portable dot locking
   4.944 +and having that one as the default is appealing, but this change
   4.945 +requires deeper technical investigation into the topic.
   4.946 +The other option,
   4.947 +.Sw --enable-debug ,
   4.948 +compiles the programs with debugging symbols and does not strip them.
   4.949 +This option is likely to stay.
   4.950 +
   4.951 +
   4.952 +
   4.953 +
   4.954 +.H2 "Command Line Switches
   4.955 +.P
   4.956 +The command line switches of MH tools follow the X Window style.
   4.957 +They are words, introduced by a single dash.
   4.958 +For example:
   4.959 +.Cl "-truncate" .
   4.960 +Every program in mmh has two generic switches:
   4.961 +.Sw -help ,
   4.962 +to print a short message on how to use the program, and 
   4.963 +.Sw -Version ,
   4.964 +to tell what version of mmh the program belongs to.
   4.965 +.P
   4.966 +Switches change the behavior of programs.
   4.967 +Programs that do one thing in one way require no switches.
   4.968 +In most cases, doing something in exactly one way is too limiting.
   4.969 +If there is basically one task to accomplish, but it should be done
   4.970 +in various ways, switches are a good approach to alter the behavior
   4.971 +of a program.
   4.972 +Changing the behavior of programs provides flexibility and customization
   4.973 +to users, but at the same time it complicates the code, documentation and
   4.974 +usage of the program.
   4.975 +.\" XXX: Ref
   4.976 +Therefore, the number of switches should be kept small.
   4.977 +A small set of well-chosen switches does no harm.
   4.978 +But usually, the number of switches increases over time.
   4.979 +Already in 1985, Rose and Romine have identified this as a major
   4.980 +problem of MH:
   4.981 +.[ [
   4.982 +rose romine real work
   4.983 +.], p. 12]
   4.984 +.QS
   4.985 +A complaint often heard about systems which undergo substantial development
   4.986 +by many people over a number of years, is that more and more options are
   4.987 +introduced which add little to the functionality but greatly increase the
   4.988 +amount of information a user needs to know in order to get useful work done.
   4.989 +This is usually referred to as creeping featurism.
   4.990 +.QP
   4.991 +Unfortunately MH, having undergone six years of off-and-on development by
   4.992 +ten or so well-meaning programmers (the present authors included),
   4.993 +suffers mightily from this.
   4.994 +.QE
   4.995 +.P
   4.996 +Being reluctant to adding new switches \(en or `options',
   4.997 +as Rose and Romine call them \(en is one part of a counter-action,
   4.998 +the other part is removing hardly used switches.
   4.999 +Nmh's tools had lots of switches already implemented,
  4.1000 +hence, cleaning up by removing some of them was the more important part
  4.1001 +of the counter-action.
  4.1002 +Removing existing functionality is always difficult because it
  4.1003 +breaks programs that use these functions.
  4.1004 +Also, for every obsolete feature, there'll always be someone who still
  4.1005 +uses it and thus opposes its removal.
  4.1006 +This puts the developer into the position,
  4.1007 +where sensible improvements to style are regarded as destructive acts.
  4.1008 +Yet, living with the featurism is far worse, in my eyes, because
  4.1009 +future needs will demand adding further features,
  4.1010 +worsening the situation more and more.
  4.1011 +Rose and Romine added in a footnote,
  4.1012 +``[...]
  4.1013 +.Pn send
  4.1014 +will no doubt acquire an endless number of switches in the years to come.''
  4.1015 +Although clearly humorous, the comment points to the nature of the problem.
  4.1016 +Refusing to add any new switches would encounter the problem at its root,
  4.1017 +but this is not practical.
  4.1018 +New needs will require new switches and it would be unwise to block
  4.1019 +them strictly.
  4.1020 +Nevertheless, removing obsolete switches still is an effective approach
  4.1021 +to deal with the problem.
  4.1022 +Working on an experimental branch without an established user base,
  4.1023 +eased my work because I did not offend users when I removed existing
  4.1024 +funtions.
  4.1025 +.P
  4.1026 +Rose and Romine counted 24 visible and 9 more hidden switches for
  4.1027 +.Pn send .
  4.1028 +In nmh, they increased up to 32 visible and 12 hidden ones.
  4.1029 +At the time of writing, no more than 7 visible switches and 1 hidden switch
  4.1030 +have remained in mmh's
  4.1031 +.Pn send .
  4.1032 +(These numbers include two generic switches, help and version.)
  4.1033 +.P
  4.1034 +Fig. XXX
  4.1035 +.\" XXX Ref
  4.1036 +displays the number of switches for each of the tools that is available
  4.1037 +in both, nmh and mmh.
  4.1038 +The tools are sorted by the number of switches they had in nmh.
  4.1039 +Visible and hidden switches were counted,
  4.1040 +but not the generic help and version switches.
  4.1041 +Whereas in the beginning of the project, the average tool had 11 switches,
  4.1042 +now it has no more than 5 \(en only half as many.
  4.1043 +If the `no' switches and similar inverse variant are folded onto
  4.1044 +their counter-parts, the average tool had 8 switches in pre-mmh times and
  4.1045 +has 4 now.
  4.1046 +The total number of functional switches in mmh dropped from 465
  4.1047 +to 234.
  4.1048 +
  4.1049 +.KS
  4.1050 +.in 1c
  4.1051 +.so input/switches.grap
  4.1052 +.KE
  4.1053 +
  4.1054 +.P
  4.1055 +A part of the switches vanished after functions were removed.
  4.1056 +This was the case for network mail transfer, for instance.
  4.1057 +Sometimes, however, the work flow was the other way:
  4.1058 +I looked through the
  4.1059 +.Mp mh-chart (7)
  4.1060 +man page to identify the tools with apparently too many switches.
  4.1061 +Then considering the value of each of the switches by examining
  4.1062 +the tool's man page and source code, aided by recherche and testing.
  4.1063 +This way, the removal of functions was suggested by the aim to reduce
  4.1064 +the number of switches per command.
  4.1065 +
  4.1066 +
  4.1067 +.U3 "Draft Folder Facility
  4.1068 +.P
  4.1069 +A change early in the project was the complete transition from
  4.1070 +the single draft message to the draft folder facility.
  4.1071 +.Ci 337338b404931f06f0db2119c9e145e8ca5a9860
  4.1072 +The draft folder facility was introduced in the mid-Eighties, when
  4.1073 +Rose and Romine called it a ``relatively new feature''.
  4.1074 +.[
  4.1075 +rose romine real work
  4.1076 +.]
  4.1077 +Since then, the facility had existed but was deactivated by default.
  4.1078 +The default activation and the related rework of the tools made it
  4.1079 +possible to remove the
  4.1080 +.Sw -[no]draftfolder ,
  4.1081 +and
  4.1082 +.Sw -draftmessage
  4.1083 +switches from
  4.1084 +.Pn comp ,
  4.1085 +.Pn repl ,
  4.1086 +.Pn forw ,
  4.1087 +.Pn dist ,
  4.1088 +.Pn whatnow ,
  4.1089 +and
  4.1090 +.Pn send .
  4.1091 +.Ci 337338b404931f06f0db2119c9e145e8ca5a9860
  4.1092 +The only flexibility removed with this change is having multiple
  4.1093 +draft folders within one profile.
  4.1094 +I consider this a theoretical problem only.
  4.1095 +In the same go, the
  4.1096 +.Sw -draft
  4.1097 +switch of
  4.1098 +.Pn anno ,
  4.1099 +.Pn refile ,
  4.1100 +and
  4.1101 +.Pn send
  4.1102 +was removed.
  4.1103 +The special-casing of `the' draft message became irrelevant after
  4.1104 +the rework of the draft system.
  4.1105 +(See Sec. XXX.)
  4.1106 +Equally,
  4.1107 +.Pn comp
  4.1108 +lost its
  4.1109 +.Sw -file
  4.1110 +switch.
  4.1111 +The draft folder facility, together with the
  4.1112 +.Sw -form
  4.1113 +switch, are sufficient.
  4.1114 +
  4.1115 +
  4.1116 +.U3 "In Place Editing
  4.1117 +.P
  4.1118 +.Pn anno
  4.1119 +had the switches
  4.1120 +.Sw -[no]inplace
  4.1121 +to either annotate the message in place and thus preserve hard links,
  4.1122 +or annotate a copy to replace the original message, breaking hard links.
  4.1123 +Following the assumption that linked messages should truly be the
  4.1124 +same message, and annotating it should not break the link, the
  4.1125 +.Sw -[no]inplace
  4.1126 +switches were removed and the previous default
  4.1127 +.Sw -inplace
  4.1128 +was made the only behavior.
  4.1129 +.Ci c8195849d2e366c569271abb0f5f60f4ebf0b4d0
  4.1130 +The
  4.1131 +.Sw -[no]inplace
  4.1132 +switches of
  4.1133 +.Pn repl ,
  4.1134 +.Pn forw ,
  4.1135 +and
  4.1136 +.Pn dist
  4.1137 +could be removed, too, as they were simply passed through to
  4.1138 +.Pn anno .
  4.1139 +.P
  4.1140 +.Pn burst
  4.1141 +also had
  4.1142 +.Sw -[no]inplace
  4.1143 +switches, but with different meaning.
  4.1144 +With
  4.1145 +.Sw -inplace ,
  4.1146 +the digest had been replaced by the table of contents (i.e. the
  4.1147 +introduction text) and the bursted messages were placed right
  4.1148 +after this message, renumbering all following messages.
  4.1149 +Also, any trailing text of the digest was lost, though,
  4.1150 +in practice, it usually consists of an end-of-digest marker only.
  4.1151 +Nontheless, this behavior appeared less elegant than the
  4.1152 +.Sw -noinplace
  4.1153 +behavior, which already had been the default.
  4.1154 +Nmh's
  4.1155 +.Mp burst (1)
  4.1156 +man page reads:
  4.1157 +.sp \n(PDu
  4.1158 +.QS
  4.1159 +If -noinplace is given, each digest is preserved, no table
  4.1160 +of contents is produced, and the messages contained within
  4.1161 +the digest are placed at the end of the folder. Other messages
  4.1162 +are not tampered with in any way.
  4.1163 +.QE
  4.1164 +.LP
  4.1165 +The decision to drop the
  4.1166 +.Sw -inplace
  4.1167 +behavior was supported by the code complexity and the possible data loss
  4.1168 +it caused.
  4.1169 +.Sw -noinplace
  4.1170 +was chosen to be the definitive behavior.
  4.1171 +.Ci 68a686adeb39223a5e1ad35e4a24890ec053679d
  4.1172 +
  4.1173 +
  4.1174 +.U3 "Forms and Format Strings
  4.1175 +.P
  4.1176 +Historically, the tools that had
  4.1177 +.Sw -form
  4.1178 +switches to supply a form file had
  4.1179 +.Sw -format
  4.1180 +switches as well to supply the contents of a form file as a string
  4.1181 +on the command line directly.
  4.1182 +In consequence, the following two lines equaled:
  4.1183 +.VS
  4.1184 +scan -form scan.mailx
  4.1185 +scan -format "`cat .../scan.mailx`"
  4.1186 +VE
  4.1187 +The
  4.1188 +.Sw -format
  4.1189 +switches were dropped in favor for extending the
  4.1190 +.Sw -form
  4.1191 +switches.
  4.1192 +.Ci f51956be123db66b00138f80464d06f030dbb88d
  4.1193 +If their argument starts with an equal sign (`='),
  4.1194 +then the rest of the argument is taken as a format string,
  4.1195 +otherwise the arguments is treated as the name of a format file.
  4.1196 +Thus, now the following two lines equal:
  4.1197 +.VS
  4.1198 +scan -form scan.mailx
  4.1199 +scan -form "=`cat .../scan.mailx`"
  4.1200 +VE
  4.1201 +This rework removed the prefix collision between
  4.1202 +.Sw -form
  4.1203 +and
  4.1204 +.Sw -format .
  4.1205 +Now, typing
  4.1206 +.Sw -fo
  4.1207 +suffices to specify form or format string.
  4.1208 +.P
  4.1209 +The different meaning of
  4.1210 +.Sw -format
  4.1211 +for
  4.1212 +.Pn repl
  4.1213 +and
  4.1214 +.Pn forw
  4.1215 +was removed in mmh.
  4.1216 +.Pn forw
  4.1217 +was completely switched to MIME-type forwarding, thus removing the
  4.1218 +.Sw -[no]format .
  4.1219 +.Ci 6e271608b7b9c23771523f88d23a4d3593010cf1
  4.1220 +For
  4.1221 +.Pn repl ,
  4.1222 +the
  4.1223 +.Sw -[no]format
  4.1224 +switches were reworked to
  4.1225 +.Sw -[no]filter
  4.1226 +switches.
  4.1227 +.Ci 67411b1f95d6ec987b4c732459e1ba8a8ac192c6
  4.1228 +The
  4.1229 +.Sw -format
  4.1230 +switches of
  4.1231 +.Pn send
  4.1232 +and
  4.1233 +.Pn post ,
  4.1234 +which had a third meaning,
  4.1235 +were removed likewise.
  4.1236 +.Ci f3cb7cde0e6f10451b6848678d95860d512224b9
  4.1237 +Eventually, the ambiguity of the
  4.1238 +.Sw -format
  4.1239 +switches was resolved by not anymore having any such switch in mmh.
  4.1240 +
  4.1241 +
  4.1242 +.U3 "MIME Tools
  4.1243 +.P
  4.1244 +The MIME tools, which were once part of
  4.1245 +.Pn mhn
  4.1246 +[sic!],
  4.1247 +had several switches that added little practical value to the programs.
  4.1248 +The
  4.1249 +.Sw -[no]realsize
  4.1250 +switches of
  4.1251 +.Pn mhbuild
  4.1252 +and
  4.1253 +.Pn mhlist
  4.1254 +were removed, doing real size calculations always now
  4.1255 +.Ci 8d8f1c3abc586c005c904e52c4adbfe694d2201c ,
  4.1256 +as
  4.1257 +``This provides an accurate count at the expense of a small delay.''
  4.1258 +This small delay is not noticable on modern systems.
  4.1259 +.P
  4.1260 +The
  4.1261 +.Sw -[no]check
  4.1262 +switches were removed together with the support for
  4.1263 +.Hd Content-MD5
  4.1264 +header fields.
  4.1265 +.[
  4.1266 +rfc 1864
  4.1267 +.]
  4.1268 +.Ci 31dc797eb5178970d68962ca8939da3fd9a8efda
  4.1269 +(See Sec. XXX)
  4.1270 +.P
  4.1271 +The
  4.1272 +.Sw -[no]ebcdicsafe
  4.1273 +and
  4.1274 +.Sw -[no]rfc934mode
  4.1275 +switches of
  4.1276 +.Pn mhbuild
  4.1277 +were removed because they are considered obsolete.
  4.1278 +.Ci 01a3480928da485b4d6109d36d751dfa71799d58
  4.1279 +.Ci 3363e2624dce0eb8164cf8b3f1ab385c8ff72e88
  4.1280 +.P
  4.1281 +Content caching of external MIME parts, activated with the
  4.1282 +.Sw -rcache
  4.1283 +and
  4.1284 +.Sw -wcache
  4.1285 +switches was completely removed.
  4.1286 +.Ci d1fefd9f614e4dc3cda16da6c69133c1b2005269
  4.1287 +External MIME parts are rare today, having a caching facility
  4.1288 +for them is appears to be unnecessary.
  4.1289 +.P
  4.1290 +In pre-MIME times,
  4.1291 +.Pn mhl
  4.1292 +had covered many tasks that are part of MIME handling today.
  4.1293 +Therefore,
  4.1294 +.Pn mhl
  4.1295 +could be simplified to a large extend, reducing the number of its
  4.1296 +switches from 21 to 6.
  4.1297 +.Ci 350ad6d3542a07639213cf2a4fe524e829c1e7b6
  4.1298 +.Ci 0e46503be3c855bddaeae3843e1b659279c35d70
  4.1299 +
  4.1300 +
  4.1301 +.U3 "Mail Transfer Switches
  4.1302 +.P
  4.1303 +With the removal of the mail transfer facilities, a lot of switches
  4.1304 +vanished automatically.
  4.1305 +.Pn inc
  4.1306 +lost 9 switches, namely
  4.1307 +.Sw -host ,
  4.1308 +.Sw -port ,
  4.1309 +.Sw -user ,
  4.1310 +.Sw -proxy ,
  4.1311 +.Sw -snoop ,
  4.1312 +.Sw -[no]pack ,
  4.1313 +as well as
  4.1314 +.Sw -sasl
  4.1315 +and
  4.1316 +.Sw -saslmech .
  4.1317 +.Pn send
  4.1318 +and
  4.1319 +.Pn post 
  4.1320 +lost 11 switches each, namely
  4.1321 +.Sw -server ,
  4.1322 +.Sw -port ,
  4.1323 +.Sw -client ,
  4.1324 +.Sw -user ,
  4.1325 +.Sw -mail ,
  4.1326 +.Sw -saml ,
  4.1327 +.Sw -send ,
  4.1328 +.Sw -soml ,
  4.1329 +.Sw -snoop ,
  4.1330 +as well as
  4.1331 +.Sw -sasl ,
  4.1332 +.Sw -saslmech ,
  4.1333 +and
  4.1334 +.Sw -tls .
  4.1335 +.Pn send
  4.1336 +had the switches only to pass them further to
  4.1337 +.Pn post ,
  4.1338 +because the user would invoke
  4.1339 +.Pn post
  4.1340 +not directly, but through
  4.1341 +.Pn send .
  4.1342 +All these switches, except
  4.1343 +.Sw -snoop
  4.1344 +were usually defined as default switches in the user's profile,
  4.1345 +but hardly given in interactive usage.
  4.1346 +.P
  4.1347 +Of course, those switches did not really ``vanish'', but the configuration
  4.1348 +they did was handed over to external MSAs and MRAs.
  4.1349 +Instead of setting up the mail transfer in mmh, it is set up in
  4.1350 +external tools.
  4.1351 +Yet, this simplifies mmh.
  4.1352 +Specialized external tools will likely have simple configuration files.
  4.1353 +Hence, instead of having one complicated central configuration file,
  4.1354 +the configuration of each domain is separate.
  4.1355 +Although the user needs to learn to configure each of the tools,
  4.1356 +each configuration is likely much simpler.
  4.1357 +
  4.1358 +
  4.1359 +.U3 "Maildrop Formats
  4.1360 +.P
  4.1361 +With the removal of MMDF maildrop format support,
  4.1362 +.Pn packf
  4.1363 +and
  4.1364 +.Pn rcvpack
  4.1365 +no longer needed their
  4.1366 +.Sw -mbox
  4.1367 +and
  4.1368 +.Sw -mmdf
  4.1369 +switches.
  4.1370 +.Sw -mbox
  4.1371 +is the sole  behavior now.
  4.1372 +.Ci 3916ab66ad5d183705ac12357621ea8661afd3c0
  4.1373 +In the same go,
  4.1374 +.Pn packf
  4.1375 +and
  4.1376 +.Pn rcvpack
  4.1377 +were reworked (see Sec. XXX) and their
  4.1378 +.Sw -file
  4.1379 +switch became unnecessary.
  4.1380 +.Ci ca1023716d4c2ab890696f3e41fa0d94267a940e
  4.1381 +
  4.1382 +
  4.1383 +.U3 "Terminal Magic
  4.1384 +.P
  4.1385 +Mmh's tools will no longer clear the screen (\c
  4.1386 +.Pn scan 's
  4.1387 +and
  4.1388 +.Pn mhl 's
  4.1389 +.Sw -[no]clear
  4.1390 +switches
  4.1391 +.Ci e57b17343dcb3ff373ef4dd089fbe778f0c7c270
  4.1392 +.Ci 943765e7ac5693ae177fd8d2b5a2440e53ce816e ).
  4.1393 +Neither will
  4.1394 +.Pn mhl
  4.1395 +ring the bell (\c
  4.1396 +.Sw -[no]bell
  4.1397 +.Ci e11983f44e59d8de236affa5b0d0d3067c192e24 )
  4.1398 +nor page the output itself (\c
  4.1399 +.Sw -length
  4.1400 +.Ci 5b9d883db0318ed2b84bb82dee880d7381f99188 ).
  4.1401 +.P
  4.1402 +Generally, the pager to use is no longer specified with the
  4.1403 +.Sw -[no]moreproc
  4.1404 +command line switches for
  4.1405 +.Pn mhl
  4.1406 +and
  4.1407 +.Pn show /\c
  4.1408 +.Pn mhshow .
  4.1409 +.Ci 39e87a75b5c2d3572ec72e717720b44af291e88a
  4.1410 +.P
  4.1411 +.Pn prompter
  4.1412 +lost its
  4.1413 +.Sw -erase
  4.1414 +and
  4.1415 +.Sw -kill
  4.1416 +switches because today the terminal cares for the line editing keys.
  4.1417 +
  4.1418 +
  4.1419 +.U3 "Header Printing
  4.1420 +.P
  4.1421 +.Pn folder 's
  4.1422 +data output is self-explaining enough that
  4.1423 +displaying the header line makes few sense.
  4.1424 +Hence, the
  4.1425 +.Sw -[no]header
  4.1426 +switch was removed and headers are never printed.
  4.1427 +.Ci 601cc73d1fa05ce96faa728f036d6c51b91701c7
  4.1428 +.P
  4.1429 +In
  4.1430 +.Pn mhlist ,
  4.1431 +the
  4.1432 +.Sw -[no]header
  4.1433 +switches were removed, too.
  4.1434 +.Ci b24f96523aaf60e44e04a3ffb1d22e69a13a602f
  4.1435 +But in this case headers are always printed,
  4.1436 +because the output is not self-explaining.
  4.1437 +.P
  4.1438 +.Pn scan
  4.1439 +also had
  4.1440 +.Sw -[no]header
  4.1441 +switches.
  4.1442 +Printing the header had been sensible until the introduction of
  4.1443 +format strings made it impossible to display the column headings.
  4.1444 +Only the folder name and the current date remained to be printed.
  4.1445 +As this information can be perfectly retrieved by
  4.1446 +.Pn folder
  4.1447 +and
  4.1448 +.Pn date ,
  4.1449 +consequently, the switches were removed.
  4.1450 +.Ci c477dc5d1d03fa6d9a8ab3dd3508c63cbddc044e
  4.1451 +.P
  4.1452 +By removing all
  4.1453 +.Sw -header
  4.1454 +switches, the collision with
  4.1455 +.Sw -help
  4.1456 +on the first two letters was resolved.
  4.1457 +Currently,
  4.1458 +.Sw -h
  4.1459 +evaluates to
  4.1460 +.Sw -help
  4.1461 +for all tools of mmh.
  4.1462 +
  4.1463 +
  4.1464 +.U3 "Suppressing Edits or the WhatNow Shell
  4.1465 +.P
  4.1466 +The
  4.1467 +.Sw -noedit
  4.1468 +switch of
  4.1469 +.Pn comp ,
  4.1470 +.Pn repl ,
  4.1471 +.Pn forw ,
  4.1472 +.Pn dist ,
  4.1473 +and
  4.1474 +.Pn whatnow
  4.1475 +was removed, but it can now be replaced by specifying
  4.1476 +.Sw -editor
  4.1477 +with an empty argument.
  4.1478 +.Ci 75fca31a5b9d5c1a99c74ab14c94438d8852fba9
  4.1479 +(Specifying
  4.1480 +.Cl "-editor true
  4.1481 +is nearly the same, only differing by the previous editor being set.)
  4.1482 +.P
  4.1483 +The more important change is the removal of the
  4.1484 +.Sw -nowhatnowproc
  4.1485 +switch.
  4.1486 +.Ci ee4f43cf2ef0084ec698e4e87159a94c01940622
  4.1487 +This switch had introduced an awkward behavior, as explained in nmh's
  4.1488 +man page for
  4.1489 +.Mp comp (1):
  4.1490 +.QS
  4.1491 +The \-editor editor switch indicates the editor to use for
  4.1492 +the initial edit. Upon exiting from the editor, comp will
  4.1493 +invoke the whatnow program. See whatnow(1) for a discussion
  4.1494 +of available options. The invocation of this program can be
  4.1495 +inhibited by using the \-nowhatnowproc switch. (In truth of
  4.1496 +fact, it is the whatnow program which starts the initial
  4.1497 +edit. Hence, \-nowhatnowproc will prevent any edit from
  4.1498 +occurring.)
  4.1499 +.QE
  4.1500 +.P
  4.1501 +Effectively, the
  4.1502 +.Sw -nowhatnowproc
  4.1503 +switch creates only a draft message.
  4.1504 +As
  4.1505 +.Cl "-whatnowproc true
  4.1506 +causes the same behavior, the
  4.1507 +.Sw -nowhatnowproc
  4.1508 +switch was removed for being redundant.
  4.1509 +Likely, the
  4.1510 +.Sw -nowhatnowproc
  4.1511 +switch was intended to be used by front-ends.
  4.1512 +
  4.1513 +
  4.1514 +.U3 "Compatibility Switches
  4.1515 +.BU
  4.1516 +The hidden
  4.1517 +.Sw -[no]total
  4.1518 +switches of
  4.1519 +.Pn flist .
  4.1520 +They were simply the inverse of the visible
  4.1521 +.Sw -[no]fast
  4.1522 +switches:
  4.1523 +.Sw -total
  4.1524 +was
  4.1525 +.Sw -nofast
  4.1526 +and
  4.1527 +.Sw -nototal
  4.1528 +was
  4.1529 +.Sw -fast .
  4.1530 +I removed the
  4.1531 +.Sw -[no]total
  4.1532 +legacy.
  4.1533 +.Ci ea21fe2c4bd23c639bef251398fae809875732ec
  4.1534 +.BU
  4.1535 +The
  4.1536 +.Sw -subject
  4.1537 +switch of
  4.1538 +.Pn sortm
  4.1539 +existed for compatibility only.
  4.1540 +It can be fully replaced by
  4.1541 +.Cl "-textfield subject
  4.1542 +thus it was removed.
  4.1543 +.Ci 00140a3c86e9def69d98ba2ffd4d6e50ef6326ea
  4.1544 +
  4.1545 +
  4.1546 +.U3 "Various
  4.1547 +.BU
  4.1548 +In order to avoid prefix collisions among switch names, the
  4.1549 +.Sw -version
  4.1550 +switch was renamed to
  4.1551 +.Sw -Version
  4.1552 +(with capital `V').
  4.1553 +.Ci 32b2354dbaf4bf934936eb5b102a4a3d2fdd209a
  4.1554 +Every program has the
  4.1555 +.Sw -version
  4.1556 +switch but its first three letters collided with the
  4.1557 +.Sw -verbose
  4.1558 +switch, present in many programs.
  4.1559 +The rename solved this problem once for all.
  4.1560 +Although this rename breaks a basic interface, having the
  4.1561 +.Sw -V
  4.1562 +abbreviation to display the version information, isn't all too bad.
  4.1563 +.BU
  4.1564 +.Sw -[no]preserve
  4.1565 +of
  4.1566 +.Pn refile
  4.1567 +was removed because what use was it anyway?
  4.1568 +.QS
  4.1569 +Normally when a message is refiled, for each destination
  4.1570 +folder it is assigned the number which is one above the current
  4.1571 +highest message number in that folder. Use of the
  4.1572 +\-preserv [sic!] switch will override this message renaming, and try
  4.1573 +to preserve the number of the message. If a conflict for a
  4.1574 +particular folder occurs when using the \-preserve switch,
  4.1575 +then refile will use the next available message number which
  4.1576 +is above the message number you wish to preserve.
  4.1577 +.QE
  4.1578 +.BU
  4.1579 +The removal of the
  4.1580 +.Sw -[no]reverse
  4.1581 +switches of
  4.1582 +.Pn scan
  4.1583 +.Ci 8edc5aaf86f9f77124664f6801bc6c6cdf258173
  4.1584 +is a bug fix, supported by the comments
  4.1585 +``\-[no]reverse under #ifdef BERK (I really HATE this)''
  4.1586 +by Rose and
  4.1587 +``Lists messages in reverse order with the `\-reverse' switch.
  4.1588 +This should be considered a bug.'' by Romine in the documentation.
  4.1589 +The question remains why neither Rose and Romine had fixed this
  4.1590 +bug in the Eighties when they wrote these comments nor has anyone
  4.1591 +thereafter.
  4.1592 +
  4.1593 +
  4.1594 +.ig
  4.1595 +
  4.1596 +forw: [no]dashstuffing(mhl)
  4.1597 +
  4.1598 +mhshow: [no]pause [no]serialonly
  4.1599 +
  4.1600 +mhmail: resent queued
  4.1601 +inc: snoop, (pop)
  4.1602 +
  4.1603 +mhl: [no]faceproc folder sleep
  4.1604 +	[no]dashstuffing(forw) digest list volume number issue number
  4.1605 +
  4.1606 +prompter: [no]doteof
  4.1607 +
  4.1608 +refile: [no]preserve [no]unlink [no]rmmproc
  4.1609 +
  4.1610 +send: [no]forward [no]mime [no]msgid
  4.1611 +	[no]push split [no]unique (sasl) width snoop [no]dashstuffing
  4.1612 +	attach attachformat
  4.1613 +whatnow: (noedit) attach
  4.1614 +
  4.1615 +slocal: [no]suppressdups
  4.1616 +
  4.1617 +spost: [no]filter [no]backup width [no]push idanno
  4.1618 +	[no]check(whom) whom(whom)
  4.1619 +
  4.1620 +whom: ???
  4.1621 +
  4.1622 +..
  4.1623 +
  4.1624 +
  4.1625 +.ig
  4.1626 +
  4.1627 +.P
  4.1628 +In the best case, all switches are unambiguous on the first character,
  4.1629 +or on the three-letter prefix for the `no' variants.
  4.1630 +Reducing switch prefix collisions, shortens the necessary prefix length
  4.1631 +the user must type.
  4.1632 +Having less switches helps best.
  4.1633 +
  4.1634 +..
  4.1635 +
  4.1636 +
  4.1637 +.\" XXX: whatnow prompt commands
  4.1638 +
  4.1639 +
  4.1640 +
  4.1641 +
  4.1642 +.H1 "Modernizing
  4.1643 +.P
  4.1644 +The code base of mmh originates from the late Seventies.
  4.1645 +Through the Eighties, extensive work had been done on it.
  4.1646 +In the Nineties, it had been partly reorganized and extended.
  4.1647 +Relicts from each decade have gathered in the code base.
  4.1648 +My goal was to modernize the code base.
  4.1649 +
  4.1650 +.P
  4.1651 +FIXME functional aspect only here
  4.1652 +.P
  4.1653 +FIXME ref to `code style' for non-functional aspects.
  4.1654 +
  4.1655 +
  4.1656 +.H2 "Code Relicts
  4.1657 +.P
  4.1658 +My position to drop obsolete functionality of mmh to remove old code
  4.1659 +is much more revolutional than the nmh community likes to have it.
  4.1660 +Working on an experimental version, I was able to quickly drop
  4.1661 +functionality I considered ancient.
  4.1662 +The need for consensus with peers would have slowed this process down.
  4.1663 +Without the need to justify my decisions, I was able to rush forward.
  4.1664 +In Dezember 2011, Paul Vixie motivated the nmh developers to just
  4.1665 +do the work:
  4.1666 +.[
  4.1667 +paul vixie edginess nmh-workers
  4.1668 +.]
  4.1669 +.QS
  4.1670 +let's stop walking on egg shells with this code base. there's no need to
  4.1671 +discuss whether to keep using vfork, just note in [sic!] passing, [...]
  4.1672 +we don't need a separate branch for removing vmh
  4.1673 +or ridding ourselves of #ifdef's or removing posix replacement functions
  4.1674 +or depending on pure ansi/posix "libc".
  4.1675 +.QP
  4.1676 +these things should each be a day or two of work and the "main branch"
  4.1677 +should just be modern. [...]
  4.1678 +let's push forward, aggressively.
  4.1679 +.QE
  4.1680 +.LP
  4.1681 +I did so already in the months before.
  4.1682 +I pushed forward.
  4.1683 +I simply dropped the cruft.
  4.1684 +.P
  4.1685 +The decision to drop a feature was based on literature research and
  4.1686 +careful thinking, but whether having had contact to this particular
  4.1687 +feature within my own computer life served as a rule of thumb.
  4.1688 +My reasons are always made clean in the commit message for the
  4.1689 +version control system.
  4.1690 +Hence, others can comprehend my view and argue for undoing the change
  4.1691 +if I have missed an important aspect.
  4.1692 +
  4.1693 +
  4.1694 +.U3 "Forking
  4.1695 +.P
  4.1696 +In being a tool chest, MH creates many processes.
  4.1697 +In earlier times
  4.1698 +.Fu fork()
  4.1699 +had been an expensive system call, because the process's image needed
  4.1700 +to be duplicated completely at once.
  4.1701 +This was especially painfull in the common case when the image gets
  4.1702 +replaced by a call to
  4.1703 +.Fu exec()
  4.1704 +right after having forked the child process.
  4.1705 +The
  4.1706 +.Fu vfork()
  4.1707 +system call was invented to speed up this particular case.
  4.1708 +It completely omits the duplication of the image.
  4.1709 +On old systems this resulted in significant speed ups.
  4.1710 +Therefore MH used
  4.1711 +.Fu vfork()
  4.1712 +whenever possible.
  4.1713 +.P
  4.1714 +Modern memory management units support copy-on-write semantics, which make
  4.1715 +.Fu fork()
  4.1716 +almost as fast as
  4.1717 +.Fu vfork() .
  4.1718 +The man page of
  4.1719 +.Mp vfork (2)
  4.1720 +in FreeBSD 8.0 states:
  4.1721 +.QS
  4.1722 +This system call will be eliminated when proper system sharing mechanisms
  4.1723 +are implemented. Users should not depend on the memory sharing semantics
  4.1724 +of vfork() as it will, in that case, be made synonymous to fork(2).
  4.1725 +.QE
  4.1726 +.LP
  4.1727 +Vixie supports the removal with the note that ``the last
  4.1728 +system on which fork was so slow that an mh user would notice it, was
  4.1729 +Eunice. that was 1987''.
  4.1730 +.[
  4.1731 +nmh-workers vixie edginess
  4.1732 +.]
  4.1733 +I replaced all calls to
  4.1734 +.Fu vfork()
  4.1735 +with calls to
  4.1736 +.Fu fork() .
  4.1737 +.P
  4.1738 +Related to the costs of
  4.1739 +.Fu fork()
  4.1740 +is the probability of its success.
  4.1741 +In the Eighties on heavy loaded systems, calls to
  4.1742 +.Fu fork()
  4.1743 +were prone to failure.
  4.1744 +Hence, many of the
  4.1745 +.Fu fork()
  4.1746 +calls in the code were wrapped into loops to retry the
  4.1747 +.Fu fork()
  4.1748 +several times, for higher changes to succeed, eventually.
  4.1749 +On modern systems, failing calls to
  4.1750 +.Fu fork()
  4.1751 +are unusual.
  4.1752 +Hence, in the rare case when
  4.1753 +.Fu fork()
  4.1754 +fails, mmh programs simply abort.
  4.1755 +
  4.1756 +
  4.1757 +.U3 "Obsolete Header Fields
  4.1758 +.BU
  4.1759 +The
  4.1760 +.Hd Encrypted
  4.1761 +header field was introduced by RFC\|822,
  4.1762 +but already marked legacy in RFC\|2822.
  4.1763 +OpenPGP provides the basis for standardized exchange of encrypted
  4.1764 +messages [RFC\|4880, RFC\|3156].
  4.1765 +The support for
  4.1766 +.Hd Encrypted
  4.1767 +header fields is removed in mmh.
  4.1768 +.BU
  4.1769 +Native support for
  4.1770 +.Hd Face
  4.1771 +header fields has been removed, as well.
  4.1772 +This feature is similar to the
  4.1773 +.Hd X-Face
  4.1774 +header field in its intent,
  4.1775 +but takes a different approach to store the image.
  4.1776 +Instead of encoding the image data directly into the header field,
  4.1777 +the it contains the hostname and UDP port where the image
  4.1778 +date could be retrieved.
  4.1779 +There is even a third system, invented in 2005.
  4.1780 +Although it re-uses the
  4.1781 +.Hd Face
  4.1782 +header field, it is the successor of
  4.1783 +.Hd X-Face
  4.1784 +with support for colored PNG images.
  4.1785 +None of the Face systems described here is popular today.
  4.1786 +Hence, mmh has no direct support for them.
  4.1787 +.BU
  4.1788 +The
  4.1789 +.Hd Content-MD5
  4.1790 +header field was introduced by RFC\|1864.
  4.1791 +It provides detection of data corruption during the transfer.
  4.1792 +But it can not ensure verbatim end-to-end delivery of the contents
  4.1793 +[RFC\|1864].
  4.1794 +The proper approach to verify content integrity in an
  4.1795 +end-to-end relationship is the use of digital cryptography.
  4.1796 +.\" XXX (RFCs FIXME).
  4.1797 +On the other hand, transfer protocols should detect corruption during
  4.1798 +each transmission. The TCP includes a checksum field therefore.
  4.1799 +These two approaches in combinations render the
  4.1800 +.Hd Content-MD5
  4.1801 +header field superfluous.
  4.1802 +The nmh-workers mailing list archive contains about 4\|200 messages,
  4.1803 +ranging from 1992 until today.
  4.1804 +Not a single one had a
  4.1805 +.Hd Content-MD5
  4.1806 +header field.
  4.1807 +Neither did any of the 60\|000 messages in my personal mail storage.
  4.1808 +Removing the support for this header field,
  4.1809 +removed the last place where MD5 computation was needed.
  4.1810 +Hence, the MD5 code could be removed as well.
  4.1811 +Over 500 lines of code vanished by this one change.
  4.1812 +
  4.1813 +
  4.1814 +.U3 "MMDF maildrop support
  4.1815 +.P
  4.1816 +This type of format is conceptionally similar to the mbox format,
  4.1817 +but uses a different message delimiter (`\fL^A^A^A^A\fP' instead of
  4.1818 +`\fLFrom\0\fP').
  4.1819 +Mbox is the de-facto standard maildrop format on Unix,
  4.1820 +whereas the MMDF maildrop format is hardly still known today.
  4.1821 +I did drop MMDF maildrop format support.
  4.1822 +.P
  4.1823 +The simplifications within the code were only moderate.
  4.1824 +Switches could be removed from
  4.1825 +.L packf
  4.1826 +and
  4.1827 +.L rcvpack ,
  4.1828 +which generate packed mailboxes.
  4.1829 +Only one packed mailbox format remained: mbox.
  4.1830 +The more important changes affected the equally named mail parsing
  4.1831 +routine in
  4.1832 +.Fn sbr/m_getfld.c .
  4.1833 +The MMDF code had been removed there, but as now only one packed mailbox
  4.1834 +format is left, further code structure simplifications may be possible.
  4.1835 +I have not worked on them yet because
  4.1836 +.Fu m_getfld()
  4.1837 +is heavily optimized and thus dangerous to touch.
  4.1838 +The risk of damaging the intricate workings of the optimized code is
  4.1839 +too high.
  4.1840 +.\" XXX: move somewhere else
  4.1841 +This problem is know to the developers of nmh, too.
  4.1842 +They also avoid touching this minefield if possible.
  4.1843 +
  4.1844 +
  4.1845 +.U3 "Prompter's Control Keys
  4.1846 +.P
  4.1847 +The program
  4.1848 +.Pn prompter
  4.1849 +queries the user to fill in a message form.
  4.1850 +When used by
  4.1851 +.Pn comp
  4.1852 +as
  4.1853 +.Cl "comp -editor prompter" ,
  4.1854 +the resulting behavior is similar to
  4.1855 +.Pn mailx .
  4.1856 +Apparently,
  4.1857 +.Pn prompter
  4.1858 +hadn't been touched lately.
  4.1859 +Otherwise it's hardly explainable why it
  4.1860 +still offered the switches
  4.1861 +.Sw -erase
  4.1862 +.Ar chr
  4.1863 +and
  4.1864 +.Sw -kill
  4.1865 +.Ar chr
  4.1866 +to name the characters for command line editing.
  4.1867 +The times when this had been necessary are long time gone.
  4.1868 +Today these things work out-of-the-box, and if not, are configured
  4.1869 +with the standard tool
  4.1870 +.Pn stty .
  4.1871 +The switches are removed now
  4.1872 +.Ci 0bd9750710cdbab80cfb4036dd87af20afe1552f .
  4.1873 +
  4.1874 +
  4.1875 +.U3 "Hardcopy terminal support
  4.1876 +.P
  4.1877 +More of a funny anecdote is a check for printing to a
  4.1878 +hardcopy terminal that remained in the code until Spring 2012,
  4.1879 +when I finally removed it
  4.1880 +.Ci b7764c4a6b71d37918a97594d866258f154017ca .
  4.1881 +I surely would be very happy to see such a terminal in action,
  4.1882 +maybe actually being able to work on it, but I fear my chances are null.
  4.1883 +.P
  4.1884 +The check only prevented a pager to be placed between the outputting
  4.1885 +program (\c
  4.1886 +.Pn mhl )
  4.1887 +and the terminal.
  4.1888 +In nmh, this could have been ensured with the
  4.1889 +.Sw -nomoreproc
  4.1890 +at the command line statically, too.
  4.1891 +In mmh, set the profile entry
  4.1892 +.Pe Pager
  4.1893 +or the environment variable
  4.1894 +.Ev PAGER
  4.1895 +to
  4.1896 +.Pn cat .
  4.1897 +
  4.1898 +
  4.1899 +
  4.1900 +
  4.1901 +.H2 "Attachments
  4.1902 +.P
  4.1903 +The mind model of email attachments is unrelated to MIME.
  4.1904 +Although the MIME RFCs (2045 through 2049) define the technical
  4.1905 +requirements for having attachments, they do not mention the the word
  4.1906 +``attachment''.
  4.1907 +Instead of attachments, MIME talks about ``multi-part message bodies''
  4.1908 +[RFC\|2045], a more general concept.
  4.1909 +Multi-part messages are messages
  4.1910 +``in which one or more different
  4.1911 +sets of data are combined in a single body''
  4.1912 +[RFC\|2046].
  4.1913 +MIME keeps its descriptions generic;
  4.1914 +it does not imply specific usage models.
  4.1915 +In email one usage model became prevalent: attachments.
  4.1916 +The idea is having a main text document with files of arbitrary kind
  4.1917 +attached to it.
  4.1918 +In MIME terms, this is a multi-part message having a text part first
  4.1919 +and parts of arbitray type following.
  4.1920 +.P
  4.1921 +MH's MIME support is a direct implementation of the RFCs.
  4.1922 +The perception of the topic described in the RFCs is clearly visible
  4.1923 +in MH's implementation.
  4.1924 +Thus, MH had all the MIME features but no idea of attachments.
  4.1925 +Today, however, users don't need all the MIME features but they want
  4.1926 +convenient attachment handling.
  4.1927 +
  4.1928 +.U3 "Composing MIME Messages
  4.1929 +.P
  4.1930 +In order to improve the situation on the message composing side,
  4.1931 +Jon Steinhart had added an attachment system to nmh in 2002.
  4.1932 +.Ci 7480dbc14bc90f2d872d434205c0784704213252
  4.1933 +In the file
  4.1934 +.Fn docs/README-ATTACHMENTS ,
  4.1935 +he described his motivation to do so as such:
  4.1936 +.QS
  4.1937 +Although nmh contains the necessary functionality for MIME message handing,
  4.1938 +the interface to this functionality is pretty obtuse.
  4.1939 +There's no way that I'm ever going to convince my partner to write
  4.1940 +.Pn mhbuild
  4.1941 +composition files!
  4.1942 +.QE
  4.1943 +.LP
  4.1944 +With this change, the mind model of attachments entered nmh.
  4.1945 +In the same document:
  4.1946 +.QS
  4.1947 +These changes simplify the task of managing attachments on draft files.
  4.1948 +They allow attachments to be added, listed, and deleted.
  4.1949 +MIME messages are automatically created when drafts with attachments
  4.1950 +are sent.
  4.1951 +.QE
  4.1952 +.LP
  4.1953 +Unfortunately, the attachment system,
  4.1954 +like any new facilities in nmh,
  4.1955 +was deactive by default.
  4.1956 +.P
  4.1957 +During my work in Argentina, I tried to improve the attachment system.
  4.1958 +But, because of great opposition in the nmh community,
  4.1959 +my patch died as a proposal on the mailing list, after long discussions.
  4.1960 +.[
  4.1961 +nmh-workers attachment proposal
  4.1962 +.]
  4.1963 +In Januar 2012, I extended the patch and applied it to mmh.
  4.1964 +.Ci 8ff284ff9167eff8f5349481529332d59ed913b1
  4.1965 +In mmh, the attachment system is active by default.
  4.1966 +Instead of command line switches, the
  4.1967 +.Pe Attachment-Header
  4.1968 +profile entry is used to specify
  4.1969 +the name of the attachment header field.
  4.1970 +It is pre-defined to
  4.1971 +.Hd Attach .
  4.1972 +.P
  4.1973 +To add an attachment to a draft, simply add an attachment header:
  4.1974 +.VS
  4.1975 +To: bob
  4.1976 +Subject: The file you wanted
  4.1977 +Attach: /path/to/the/file-bob-wanted
  4.1978 +--------
  4.1979 +Here it is.
  4.1980 +VE
  4.1981 +The header field can be added to the draft manually in the editor,
  4.1982 +or by using the `attach' command at the WhatNow prompt, or
  4.1983 +non-interactively with
  4.1984 +.Pn anno :
  4.1985 +.VS
  4.1986 +anno -append -nodate -component Attach -text /path/to/attachment
  4.1987 +VE
  4.1988 +Drafts with attachment headers are converted to MIME automatically by
  4.1989 +.Pn send .
  4.1990 +The conversion to MIME is invisible to the user.
  4.1991 +The draft stored in the draft folder is always in source form, with
  4.1992 +attachment headers.
  4.1993 +If the MIMEification fails, for instance because the file to attach
  4.1994 +is not accessible, the original draft is not changed.
  4.1995 +.P
  4.1996 +The attachment system handles the forwarding of messages, too.
  4.1997 +If the attachment header value starts with a plus character (`+'),
  4.1998 +like in
  4.1999 +.Cl "Attach: +bob 30 42" ,
  4.2000 +The given messages in the specified folder will be attached.
  4.2001 +This allowed to simplify
  4.2002 +.Pn forw .
  4.2003 +.Ci f41f04cf4ceca7355232cf7413e59afafccc9550
  4.2004 +.P
  4.2005 +Closely related to attachments is non-ASCII text content,
  4.2006 +because it requires MIME too.
  4.2007 +In nmh, the user needed to call `mime' at the WhatNow prompt
  4.2008 +to have the draft converted to MIME.
  4.2009 +This was necessary whenever the draft contained non-ASCII characters.
  4.2010 +If the user did not call `mime', a broken message would be sent.
  4.2011 +Therefore, the
  4.2012 +.Pe automimeproc
  4.2013 +profile entry could be specified to have the `mime' command invoked
  4.2014 +automatically each time.
  4.2015 +Unfortunately, this approach conflicted with with attachment system
  4.2016 +because the draft would already be in MIME format at the time
  4.2017 +when the attachment system wanted to MIMEify it.
  4.2018 +To use nmh's attachment system, `mime' must not be called at the
  4.2019 +WhatNow prompt and
  4.2020 +.Pe automimeproc
  4.2021 +must not be set in the profile.
  4.2022 +But then the case of non-ASCII text without attachment headers was
  4.2023 +not caught.
  4.2024 +All in all, the solution was complex and irritating.
  4.2025 +My patch from December 2010 would have simplified the situation.
  4.2026 +.P
  4.2027 +Mmh's current solution is even more elaborate.
  4.2028 +Any necessary MIMEification is done automatically.
  4.2029 +There is no `mime' command at the WhatNow prompt anymore.
  4.2030 +The draft will be converted automatically to MIME when either an
  4.2031 +attachment header or non-ASCII text is present.
  4.2032 +Further more, the special meaning of the hash character (`#')
  4.2033 +at line beginnings in the draft message is removed.
  4.2034 +Users need not at all deal with the whole topic.
  4.2035 +.P
  4.2036 +Although the new approach does not anymore support arbitrary MIME
  4.2037 +compositions directly, the full power of
  4.2038 +.Pn mhbuild
  4.2039 +can still be accessed.
  4.2040 +Given no attachment headers are included, the user can create
  4.2041 +.Pn mhbuild
  4.2042 +composition drafts like in nmh.
  4.2043 +Then, at the WhatNow prompt, he needs to invoke
  4.2044 +.Cl "edit mhbuild
  4.2045 +to convert it to MIME.
  4.2046 +Because the resulting draft does neither contain non-aASCII characters
  4.2047 +nor has it attachment headers, the attachment system will not touch it.
  4.2048 +.P
  4.2049 +The approach taken in mmh is taylored towards todays most common case:
  4.2050 +a text part with possibly attachments.
  4.2051 +This case is simplified a lot for users.
  4.2052 +
  4.2053 +.U3 "MIME Type Guessing
  4.2054 +.P
  4.2055 +The use of
  4.2056 +.Pn mhbuild
  4.2057 +composition drafts had one notable advantage over attachment headers
  4.2058 +from the programmer's point of view: The user provides the appropriate
  4.2059 +MIME types for files to include.
  4.2060 +The attachment system needs to find out the correct MIME type itself.
  4.2061 +This is a difficult task, yet it spares the user irritating work.
  4.2062 +Determining the correct MIME type of content is partly mechanical,
  4.2063 +partly intelligent work.
  4.2064 +Forcing the user to find out the correct MIME type,
  4.2065 +forces him to do partly mechanical work.
  4.2066 +Letting the computer do the work, can lead to bad choices for difficult
  4.2067 +content.
  4.2068 +For mmh, the latter option was chosen.
  4.2069 +.P
  4.2070 +Determining the MIME type by the suffix of the file name is a dumb
  4.2071 +approach, yet it is simple to implement and provides good results
  4.2072 +for the common cases.
  4.2073 +Mmh implements this approach in the
  4.2074 +.Pn print-mimetype
  4.2075 +script.
  4.2076 +Using it is the default choice.
  4.2077 +.P
  4.2078 +A far better but less portable approach is the use of
  4.2079 +.Pn file .
  4.2080 +This standard tool tries to determine the type of files.
  4.2081 +Unfortunately, its capabilities and accuracy varies from system to system.
  4.2082 +Additionally, its output was only intended for human beings,
  4.2083 +but not to be used by programs.
  4.2084 +It varies much.
  4.2085 +Nevertheless, modern versions of GNU
  4.2086 +.Pn file ,
  4.2087 +which is prevalent on the popular GNU/Linux systems,
  4.2088 +provides MIME type output in machine-readable form.
  4.2089 +Although this solution is highly system-dependent,
  4.2090 +it solves the difficult problem well.
  4.2091 +On systems where GNU
  4.2092 +.Pn file ,
  4.2093 +version 5.04 or higher, is available it should be used.
  4.2094 +One needs to specify the following profile entry to do so:
  4.2095 +.VS
  4.2096 +Mime-Type-Query: file -b --mime
  4.2097 +VE
  4.2098 +.LP
  4.2099 +Other versions of
  4.2100 +.Pn file
  4.2101 +might possibly be usable with wrapper scripts to reformat the output.
  4.2102 +The diversity among
  4.2103 +.Pn file
  4.2104 +implementations is great; one needs to check the local variant.
  4.2105 +.P
  4.2106 +If no MIME type can be determined, text content gets sent as
  4.2107 +`text/plain' and anything else under the generic fall-back type
  4.2108 +`application/octet-stream'.
  4.2109 +It is not possible in mmh to override the automatic MIME type guessing
  4.2110 +for a specific file.
  4.2111 +To do so, the user would need to know in advance for which file
  4.2112 +the automatic guessing does fail, or the system would require interaction.
  4.2113 +I consider both cases impractical.
  4.2114 +The existing solution should be sufficient.
  4.2115 +If not, the user may always fall back to
  4.2116 +.Pn mhbuild
  4.2117 +composition drafts and ignore the attachment system.
  4.2118 +
  4.2119 +
  4.2120 +.U3 "Storing Attachments
  4.2121 +.P
  4.2122 +FIXME
  4.2123 +
  4.2124 +
  4.2125 +.U3 "Showing MIME Messages
  4.2126 +.P
  4.2127 +FIXME
  4.2128 +
  4.2129 +
  4.2130 +
  4.2131 +.H2 "Digital Cryptography
  4.2132 +.P
  4.2133 +Signing and encryption.
  4.2134 +
  4.2135 +
  4.2136 +
  4.2137 +.H2 "Modern Defaults
  4.2138 +.P
  4.2139 +Just to give one example, for me it took one year of using nmh
  4.2140 +before I became aware of the existence of the attachment system.
  4.2141 +One could argue that this fact disqualifies my reading of the
  4.2142 +documentation.
  4.2143 +If I would have installed nmh from source back then, I could agree.
  4.2144 +Yet I had used a prepackaged version and had expected that it would
  4.2145 +just work.
  4.2146 +
  4.2147 +
  4.2148 +
  4.2149 +.H1 "Code Style
  4.2150 +.P
  4.2151 +foo
  4.2152 +
  4.2153 +
  4.2154 +.H2 "Standard Code
  4.2155 +.P
  4.2156 +POSIX
  4.2157 +
  4.2158 +.U3 "Converting to Standard Code
  4.2159 +.P
  4.2160 +One part of this task was converting obsolete code constructs
  4.2161 +to standard constructs.
  4.2162 +As I'm not even thirty years old and have no more than seven years of
  4.2163 +Unix experience, I needed to learn about the history in retrospective.
  4.2164 +Older people likely have used those ancient constructs themselves
  4.2165 +and have suffered from their incompatibilities and have longed for
  4.2166 +standardization.
  4.2167 +Unfortunately, I have only read that others had done so.
  4.2168 +This put me in a much more difficult positions when working on the old
  4.2169 +code.
  4.2170 +I needed to recherche what other would have known by heart from
  4.2171 +experience.
  4.2172 +All my programming experience comes from a time past ANSI C
  4.2173 +and past POSIX.
  4.2174 +Although I knew about the times before, I took the
  4.2175 +current state implicitly for granted most of the time.
  4.2176 +.P
  4.2177 +Being aware of
  4.2178 +these facts, I rather let people with more historic experience solve the 
  4.2179 +task of converting the ancient code constructs to standardized ones.
  4.2180 +Luckily, Lyndon Nerenberg focused on this task at the nmh project.
  4.2181 +He converted large parts of the code to POSIX constructs, removing
  4.2182 +the conditionals compilation for now standardized features.
  4.2183 +I'm thankful for this task being solved.
  4.2184 +I only pulled the changes into
  4.2185 +mmh.
  4.2186 +
  4.2187 +
  4.2188 +
  4.2189 +
  4.2190 +.H2 "Separation
  4.2191 +
  4.2192 +.U2 "MH Directory Split
  4.2193 +.P
  4.2194 +In MH and nmh, a personal setup had consisted of two parts:
  4.2195 +The MH profile, named
  4.2196 +.Fn \&.mh_profile
  4.2197 +and being located directly in the user's home directory.
  4.2198 +And the MH directory, where all his mail messages and also his personal
  4.2199 +forms, scan formats, other configuration files are stored.
  4.2200 +The location
  4.2201 +of this directory could be user-chosen.
  4.2202 +The default was to name it
  4.2203 +.Fn Mail
  4.2204 +and have it directly in the home directory.
  4.2205 +.P
  4.2206 +I've never liked the data storage and the configuration to be intermixed.
  4.2207 +They are different kinds of data.
  4.2208 +One part, are the messages,
  4.2209 +which are the data to operate on.
  4.2210 +The other part, are the personal
  4.2211 +configuration files, which are able to change the behavior of the operations.
  4.2212 +The actual operations are defined in the profile, however.
  4.2213 +.P
  4.2214 +When storing data, one should try to group data by its type.
  4.2215 +There's sense in the Unix file system hierarchy, where configuration
  4.2216 +file are stored separate (\c
  4.2217 +.Fn /etc )
  4.2218 +to the programs (\c
  4.2219 +.Fn /bin
  4.2220 +and
  4.2221 +.Fn /usr/bin )
  4.2222 +to their sources (\c
  4.2223 +.Fn /usr/src ).
  4.2224 +Such separation eases the backup management, for instance.
  4.2225 +.P
  4.2226 +In mmh, I've reorganized the file locations.
  4.2227 +Still there are two places:
  4.2228 +There's the mail storage directory, which, like in MH, contains all the
  4.2229 +messages, but, unlike in MH, nothing else.
  4.2230 +Its location still is user-chosen, with the default name
  4.2231 +.Fn Mail ,
  4.2232 +in the user's home directory.
  4.2233 +This is much similar to the case in nmh.
  4.2234 +The configuration files, however, are grouped together in the new directory
  4.2235 +.Fn \&.mmh
  4.2236 +in the user's home directory.
  4.2237 +The user's profile now is a file, named
  4.2238 +.Fn profile ,
  4.2239 +in this mmh directory.
  4.2240 +Consistently, the context file and all the personal forms, scan formats,
  4.2241 +and the like, are also there.
  4.2242 +.P
  4.2243 +The naming changed with the relocation.
  4.2244 +The directory where everything, except the profile, had been stored (\c
  4.2245 +.Fn $HOME/Mail ),
  4.2246 +used to be called \fIMH directory\fP.
  4.2247 +Now, this directory is called the
  4.2248 +user's \fImail storage\fP.
  4.2249 +The name \fImmh directory\fP is now given to
  4.2250 +the new directory
  4.2251 +(\c
  4.2252 +.Fn $HOME/.mmh ),
  4.2253 +containing all the personal configuration files.
  4.2254 +.P
  4.2255 +The separation of the files by type of content is logical and convenient.
  4.2256 +There are no functional differences as any possible setup known to me
  4.2257 +can be implemented with both approaches, although likely a bit easier
  4.2258 +with the new approach.
  4.2259 +The main goal of the change had been to provide
  4.2260 +sensible storage locations for any type of personal mmh file.
  4.2261 +.P
  4.2262 +In order for one user to have multiple MH setups, he can use the
  4.2263 +environment variable
  4.2264 +.Ev MH
  4.2265 +the point to a different profile file.
  4.2266 +The MH directory (mail storage plus personal configuration files) is
  4.2267 +defined by the
  4.2268 +.Pe Path
  4.2269 +profile entry.
  4.2270 +The context file could be defined by the
  4.2271 +.Pe context
  4.2272 +profile entry or by the
  4.2273 +.Ev MHCONTEXT
  4.2274 +environment variable.
  4.2275 +The latter is useful to have a distinct context (e.g. current folders)
  4.2276 +in each terminal window, for instance.
  4.2277 +In mmh, there are three environment variables now.
  4.2278 +.Ev MMH
  4.2279 +may be used to change the location of the mmh directory.
  4.2280 +.Ev MMHP
  4.2281 +and
  4.2282 +.Ev MMHC
  4.2283 +change the profile and context files, respectively.
  4.2284 +Besides providing a more consistent feel (which simply is the result
  4.2285 +of being designed anew), the set of personal configuration files can
  4.2286 +be chosen independently from the profile (including mail storage location)
  4.2287 +and context, now.
  4.2288 +Being it relevant for practical use or not, it
  4.2289 +de-facto is an improvement.
  4.2290 +However, the main achievement is the
  4.2291 +split between mail storage and personal configuration files.
  4.2292 +
  4.2293 +
  4.2294 +.H2 "Modularization
  4.2295 +.P
  4.2296 +whatnowproc
  4.2297 +.P
  4.2298 +The \fIMH library\fP
  4.2299 +.Fn libmh.a
  4.2300 +collects a bunch of standard functions that many of the MH tools need,
  4.2301 +like reading the profile or context files.
  4.2302 +This doesn't hurt the separation.
  4.2303 +
  4.2304 +
  4.2305 +.H2 "Style
  4.2306 +.P
  4.2307 +Code layout, goto, ...
  4.2308 +
  4.2309 +.P
  4.2310 +anno rework
  4.2311 +
  4.2312 +
  4.2313 +
  4.2314 +
  4.2315 +.H1 "Concept Exploitation/Homogeneity
  4.2316 +
  4.2317 +
  4.2318 +.H2 "Draft Folder
  4.2319 +.P
  4.2320 +Historically, MH provided exactly one draft message, named
  4.2321 +.Fn draft
  4.2322 +and
  4.2323 +being located in the MH directory.
  4.2324 +When starting to compose another message
  4.2325 +before the former one was sent, the user had been questioned whether to use,
  4.2326 +refile or replace the old draft.
  4.2327 +Working on multiple drafts at the same time
  4.2328 +was impossible.
  4.2329 +One could only work on them in alteration by refiling the
  4.2330 +previous one to some directory and fetching some other one for reediting.
  4.2331 +This manual draft management needed to be done each time the user wanted
  4.2332 +to switch between editing one draft to editing another.
  4.2333 +.P
  4.2334 +To allow true parallel editing of drafts, in a straight forward way, the
  4.2335 +draft folder facility exists.
  4.2336 +It had been introduced already in July 1984
  4.2337 +by Marshall T. Rose.
  4.2338 +The facility was deactivated by default.
  4.2339 +Even in nmh, the draft folder facility remained deactivated by default.
  4.2340 +At least, Richard Coleman added the man page
  4.2341 +.Mp mh-draft(5)
  4.2342 +to document
  4.2343 +the feature well.
  4.2344 +.P
  4.2345 +The only advantage of not using the draft folder facility is the static
  4.2346 +name of the draft file.
  4.2347 +This could be an issue for MH front-ends like mh-e.
  4.2348 +But as they likely want to provide working on multiple drafts in parallel,
  4.2349 +the issue is only concerning compatibility.
  4.2350 +The aim of nmh to stay compatible
  4.2351 +prevented the default activation of the draft folder facility.
  4.2352 +.P
  4.2353 +On the other hand, a draft folder is the much more natural concept than
  4.2354 +a draft message.
  4.2355 +MH's mail storage consists of folders and messages,
  4.2356 +the messages named with ascending numbers.
  4.2357 +A draft message breaks with this
  4.2358 +concept by introducing a message in a file named
  4.2359 +.Fn draft .
  4.2360 +This draft
  4.2361 +message is special.
  4.2362 +It can not be simply listed with the available tools,
  4.2363 +but instead requires special switches.
  4.2364 +I.e. corner-cases were
  4.2365 +introduced.
  4.2366 +A draft folder, in contrast, does not introduce such
  4.2367 +corner-cases.
  4.2368 +The available tools can operate on the messages within that
  4.2369 +folder like on any messages within any mail folders.
  4.2370 +The only difference
  4.2371 +is the fact that the default folder for
  4.2372 +.Pn send
  4.2373 +is the draft folder,
  4.2374 +instead of the current folder, like for all other tools.
  4.2375 +.P
  4.2376 +The trivial part of the change was activating the draft folder facility
  4.2377 +by default and setting a default name for this folder.
  4.2378 +Obviously, I chose
  4.2379 +the name
  4.2380 +.Fn +drafts .
  4.2381 +This made the
  4.2382 +.Sw -draftfolder
  4.2383 +and
  4.2384 +.Sw -draftmessage
  4.2385 +switches useless, and I could remove them.
  4.2386 +The more difficult but also the part that showed the real improvement,
  4.2387 +was updating the tools to the new concept.
  4.2388 +.Sw -draft
  4.2389 +switches could
  4.2390 +be dropped, as operating on a draft message became indistinguishable to
  4.2391 +operating on any other message for the tools.
  4.2392 +.Pn comp
  4.2393 +still has its
  4.2394 +.Sw -use
  4.2395 +switch for switching between its two modes: (1) Compose a new
  4.2396 +draft, possibly by taking some existing message as a form.
  4.2397 +(2) Modify
  4.2398 +an existing draft.
  4.2399 +In either case, the behavior of
  4.2400 +.Pn comp is
  4.2401 +deterministic.
  4.2402 +There is no more need to query the user.
  4.2403 +I consider this
  4.2404 +a major improvement.
  4.2405 +By making
  4.2406 +.Pn send
  4.2407 +simply operate on the current
  4.2408 +message in the draft folder by default, with message and folder both
  4.2409 +overridable by specifying them on the command line, it is now possible
  4.2410 +to send a draft anywhere within the storage by simply specifying its folder
  4.2411 +and name.
  4.2412 +.P
  4.2413 +All theses changes converted special cases to regular cases, thus
  4.2414 +simplifying the tools and increasing the flexibility.
  4.2415 +
  4.2416 +
  4.2417 +.H2 "Trash Folder
  4.2418 +.P
  4.2419 +Similar to the situation for drafts is the situation for removed messages.
  4.2420 +Historically, a message was deleted by renaming.
  4.2421 +A specific
  4.2422 +\fIbackup prefix\fP, often comma (\c
  4.2423 +.Fn , )
  4.2424 +or hash (\c
  4.2425 +.Fn # ),
  4.2426 +being prepended to the file name.
  4.2427 +Thus, MH wouldn't recognize the file
  4.2428 +as a message anymore, as only files whose name consists of digits only
  4.2429 +are treated as messages.
  4.2430 +The removed messages remained as files in the
  4.2431 +same directory and needed some maintenance job to truly delete them after
  4.2432 +some grace time.
  4.2433 +Usually, by running a command similar to
  4.2434 +.VS
  4.2435 +find /home/user/Mail -ctime +7 -name ',*' | xargs rm
  4.2436 +VE
  4.2437 +in a cron job.
  4.2438 +Within the grace time interval
  4.2439 +the original message could be restored by stripping the
  4.2440 +the backup prefix from the file name.
  4.2441 +If however, the last message of
  4.2442 +a folder is been removed \(en say message
  4.2443 +.Fn 6
  4.2444 +becomes file
  4.2445 +.Fn ,6
  4.2446 +\(en and a new message enters the same folder, thus the same
  4.2447 +numbered being given again \(en in our case
  4.2448 +.Fn 6
  4.2449 +\(en, if that one
  4.2450 +is removed too, then the backup of the former message gets overwritten.
  4.2451 +Thus, the ability to restore removed messages does not only depend on
  4.2452 +the ``sweeping cron job'' but also on the removing of further messages.
  4.2453 +This is undesirable, because the real mechanism is hidden from the user
  4.2454 +and the consequences of further removals are not always obvious.
  4.2455 +Further more, the backup files are scattered within the whole mail
  4.2456 +storage, instead of being collected at one place.
  4.2457 +.P
  4.2458 +To improve the situation, the profile entry
  4.2459 +.Pe rmmproc
  4.2460 +(previously named
  4.2461 +.Pe Delete-Prog )
  4.2462 +was introduced, very early.
  4.2463 +It could be set to any command, which would care for the mail removal
  4.2464 +instead of taking the default action, described above.
  4.2465 +Refiling the to-be-removed files to some garbage folder was a common
  4.2466 +example.
  4.2467 +Nmh's man page
  4.2468 +.Mp rmm(1)
  4.2469 +proposes
  4.2470 +.Cl "refile +d
  4.2471 +to move messages to the garbage folder and
  4.2472 +.Cl "rm `mhpath +d all`
  4.2473 +the empty the garbage folder.
  4.2474 +Managing the message removal this way is a sane approach.
  4.2475 +It keeps
  4.2476 +the removed messages in one place, makes it easy to remove the backup
  4.2477 +files, and, most important, enables the user to use the tools of MH
  4.2478 +itself to operate on the removed messages.
  4.2479 +One can
  4.2480 +.Pn scan
  4.2481 +them,
  4.2482 +.Pn show
  4.2483 +them, and restore them with
  4.2484 +.Pn refile .
  4.2485 +There's no more
  4.2486 +need to use
  4.2487 +.Pn mhpath
  4.2488 +to switch over from MH tools to Unix tools \(en MH can do it all itself.
  4.2489 +.P
  4.2490 +This approach matches perfect with the concepts of MH, thus making
  4.2491 +it powerful.
  4.2492 +Hence, I made it the default.
  4.2493 +And even more, I also
  4.2494 +removed the old backup prefix approach, as it is clearly less powerful.
  4.2495 +Keeping unused alternative in the code is a bad choice as they likely
  4.2496 +gather bugs, by not being constantly tested.
  4.2497 +Also, the increased code
  4.2498 +size and more conditions crease the maintenance costs.
  4.2499 +By strictly
  4.2500 +converting to the trash folder approach, I simplified the code base.
  4.2501 +.Pn rmm
  4.2502 +calls
  4.2503 +.Pn refile
  4.2504 +internally to move the to-be-removed
  4.2505 +message to the trash folder (\c
  4.2506 +.Fn +trash
  4.2507 +by default).
  4.2508 +Messages
  4.2509 +there can be operated on like on any other message in the storage.
  4.2510 +The sweep clean, one can use
  4.2511 +.Cl "rmm -unlink +trash a" ,
  4.2512 +where the
  4.2513 +.Sw -unlink
  4.2514 +switch causes the files to be truly unliked instead
  4.2515 +of moved to the trash folder.
  4.2516 +
  4.2517 +
  4.2518 +.H2 "Path Notations
  4.2519 +.P
  4.2520 +foo
  4.2521 +
  4.2522 +
  4.2523 +.H2 "MIME Integration
  4.2524 +.P
  4.2525 +user-visible access to whole messages and MIME parts are inherently
  4.2526 +different
  4.2527 +
  4.2528 +
  4.2529 +.H2 "Of One Cast
  4.2530 +.P
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/intro.roff	Sat Jun 23 22:12:14 2012 +0200
     5.3 @@ -0,0 +1,394 @@
     5.4 +.RN 1
     5.5 +
     5.6 +.H0 "Introduction
     5.7 +.P
     5.8 +MH is a set of mail handling tools with a common concept, similar to
     5.9 +the Unix tool chest, which is a set of file handling tools with a common
    5.10 +concept. \fInmh\fP is the currently most popular implementation of an
    5.11 +MH-like mail handling system.
    5.12 +This thesis describes an experimental version of nmh, named \fImmh\fP.
    5.13 +.P
    5.14 +This chapter introduces MH, its history, concepts and how it is used.
    5.15 +It describes nmh's code base and community to give the reader
    5.16 +a better understanding of the state of mmh when it started off.
    5.17 +Further more, this chapter outlines the mmh project itself,
    5.18 +describing the motivation for it and its goals.
    5.19 +
    5.20 +
    5.21 +.H1 "MH \(en the Mail Handler
    5.22 +.P
    5.23 +MH is a conceptual email system design and its concrete implementation.
    5.24 +Notably, MH had started as a design proposal at RAND Corporation,
    5.25 +where the first implementation followed later.
    5.26 +In spirit, MH is similar to Unix, which
    5.27 +influenced the world more in being a set of system design concepts
    5.28 +than in being a specific software product.
    5.29 +The ideas behind Unix are summarized in the \fIUnix philosophy\fP.
    5.30 +MH follows this philosophy.
    5.31 +
    5.32 +.U2 "History
    5.33 +.P
    5.34 +In 1977 at RAND Corporation, Norman Shapiro and Stockton Gaines
    5.35 +proposed the design
    5.36 +of a new mail handling system, called ``Mail Handler'' (MH),
    5.37 +to superseed RAND's old monolithic ``Mail System'' (MS).
    5.38 +Two years later, in 1979, Bruce Borden took the proposal and implemented a
    5.39 +prototype of MH.
    5.40 +Before the prototype's existence, the concept was
    5.41 +believed to be practically unusable.
    5.42 +But the prototype proved successful and replaced MS thereafter.
    5.43 +In replacing MS, MH grew to an all-in-one mail system.
    5.44 +.P
    5.45 +In the early eighties,
    5.46 +the University of California at Irvine (UCI) started to use MH.
    5.47 +Marshall T. Rose and John L. Romine then became the driving force.
    5.48 +They took over the development and pushed MH forward.
    5.49 +RAND had put the code into the public domain by then.
    5.50 +MH was developed at UCI at the time when the Internet appeared,
    5.51 +when UCB implemented the TCP/IP stack, and when Allman wrote Sendmail.
    5.52 +MH was extended as emailing became more featured.
    5.53 +The development of MH was closely related to the development of email
    5.54 +RFCs. In the advent of MIME, MH was the first implementation of this new
    5.55 +email standard.
    5.56 +.P
    5.57 +In the nineties, the Internet had become popular and in December 1996,
    5.58 +Richard Coleman initiated the ``New Mail Handler'' (nmh) project.
    5.59 +Nmh is a fork of MH 6.8.3 and bases strongly on the
    5.60 +\fILBL changes\fP by Van Jacobson, Mike Karels and Craig Leres.
    5.61 +Colman intended to modernize MH and improve its portability and
    5.62 +MIME handling capabilities.
    5.63 +This should be done openly within the Internet community.
    5.64 +The development of MH at UCI stopped after the 6.8.4 release in
    5.65 +February 1996, soon after the development of nmh had started.
    5.66 +Today, nmh has almost completely replaced the original MH.
    5.67 +Some systems might still provide old MH, but mainly for historical reasons.
    5.68 +.P
    5.69 +In the last years, the work on nmh was mostly maintenance work.
    5.70 +However, development was revived in December 2011
    5.71 +and stayed busy since then.
    5.72 +
    5.73 +.U2 "Concepts
    5.74 +.P
    5.75 +MH consists of a set of tools, each covering a specific task of
    5.76 +email handling, like composing a message, replying to a message,
    5.77 +refiling a message to a different folder, listing the messages in a folder.
    5.78 +All of the programs operate on a common mail storage.
    5.79 +.P
    5.80 +The mail storage consists of \fImail folders\fP (directories) and
    5.81 +\fPmessages\fP (regular files).
    5.82 +Each message is stored in a separate file in the format it was
    5.83 +received (i.e. transfer format).
    5.84 +The files are named with ascending numbers in each folder.
    5.85 +The specific format of the mail storage characterizes MH in the same way
    5.86 +as the format of the file system characterizes Unix.
    5.87 +.P
    5.88 +MH tools maintain a \fIcontext\fP, which includes the current mail folder.
    5.89 +Processes in Unix have a similar context, containing the current working
    5.90 +directory, for instance. In contrast, the process context is maintained
    5.91 +by the Unix kernel automatically, whereas MH tools need to maintain the MH
    5.92 +context themselves.
    5.93 +The user can have one MH context or multiple ones; he can even share it
    5.94 +with others.
    5.95 +.P
    5.96 +Messages are named by their numeric filename, but they can have symbolic names,
    5.97 +too. These are either automatically updated
    5.98 +position names such as the next or the last message,
    5.99 +or user-settable group names for arbitrary sets of messages.
   5.100 +These names are called sequences.
   5.101 +Sequences can be bound to the containing folder or to the context.
   5.102 +.P
   5.103 +The user's \fIprofile\fP is a file that contains his MH configuration.
   5.104 +Default switches for the individual tools can be specified to
   5.105 +adjust them to the user's personal preferences.
   5.106 +Multiple versions of the same command with different
   5.107 +default values can also be created very easily.
   5.108 +Form templates for new messages or for replies are easily changeable,
   5.109 +and output is adjustable with format files.
   5.110 +Almost every part of the system can be adjusted to personal preference.
   5.111 +.P
   5.112 +The system is well scriptable and extensible.
   5.113 +New MH tools are built out of or on top of existing ones quickly.
   5.114 +Further more, MH encourages the user to tailor, extend and automate the system.
   5.115 +As the MH tool chest was modeled after the Unix tool chest, the
   5.116 +properties of the latter apply to the former as well.
   5.117 +
   5.118 +
   5.119 +.ig \"XXX
   5.120 +
   5.121 +.P
   5.122 +To ease typing, the switches can be abbreviated as much as the remaining
   5.123 +prefix remains unambiguous.
   5.124 +If in our example no other switch would start with the letter `t', then
   5.125 +.Cl "-truncate" ,
   5.126 +.Cl "-trunc" ,
   5.127 +.Cl "-tr" ,
   5.128 +and
   5.129 +.Cl "-t
   5.130 +would all be the same.
   5.131 +As a result, switches can neither be grouped (as in
   5.132 +.Cl "ls -ltr" )
   5.133 +nor can switch arguments be appended directly to the switch (as in
   5.134 +.Cl "sendmail -q30m" ).
   5.135 +.P
   5.136 +Many switches have negating counter-parts, which start with `no'.
   5.137 +For example
   5.138 +.Cl "-notruncate
   5.139 +inverts the
   5.140 +.Cl "-truncate
   5.141 +switch.
   5.142 +They exist to undo the effect of default switches in the profile.
   5.143 +If the user has chosen to change the default behavior of some tool
   5.144 +by adding a default switch to the profile,
   5.145 +he can still undo this change in behavior by specifying the inverse
   5.146 +switch on the command line.
   5.147 +
   5.148 +..
   5.149 +
   5.150 +
   5.151 +.U2 "Using MH
   5.152 +.P
   5.153 +It is strongly recommended to have a look at the MH Book,
   5.154 +which offers a thorough introduction to using MH.
   5.155 +.[ [
   5.156 +peek mh book
   5.157 +.], Part II]
   5.158 +Rose and Romine provide a deeper and more technical
   5.159 +though slightly outdated introduction in only about two dozens pages.
   5.160 +.[
   5.161 +rose romine real work
   5.162 +.]
   5.163 +.P
   5.164 +Following is an example mail handling session.
   5.165 +It uses mmh but is mostly compatible with nmh and old MH.
   5.166 +Details might vary but the look and feel is the same.
   5.167 +
   5.168 +.VF input/mh-session
   5.169 +
   5.170 +
   5.171 +.H1 "nmh: Code and Community
   5.172 +.P
   5.173 +In order to understand the condition, goals and dynamics of a project,
   5.174 +one needs to know the reasons behind them.
   5.175 +This section explains the background.
   5.176 +.P
   5.177 +MH predates the Internet; it comes from times before networking was universal,
   5.178 +it comes from times when emailing was small, short and simple.
   5.179 +Then it grew, spread and adapted to the changes email went through.
   5.180 +Its core-concepts, however, remained the same.
   5.181 +During the eighties, students at UCI actively worked on MH.
   5.182 +They added new features and optimized the code for the then popular systems.
   5.183 +All this still was in times before POSIX and ANSI C.
   5.184 +As large parts of the code stem from this time, today's nmh source code
   5.185 +still contains many ancient parts.
   5.186 +BSD-specific code and constructs tailored for hardware of that time
   5.187 +are frequent.
   5.188 +.P
   5.189 +Nmh started about a decade after the POSIX and ANSI C standards were
   5.190 +established. A more modern coding style entered the code base, but still
   5.191 +a part of the developers came from ``the old days''. The developer
   5.192 +base became more diverse, thus broadening the range of different
   5.193 +coding styles.
   5.194 +Programming practices from different decades merged in the project.
   5.195 +As several peers added code, the system became more a conglomeration
   5.196 +of single tools rather than a homogeneous of-one-cast mail system.
   5.197 +Still, the existing basic concepts held it together.
   5.198 +They were mostly untouched throughout the years.
   5.199 +.P
   5.200 +Despite the separation of the tool chest approach at the surface
   5.201 +\(en a collection of small, separate programs \(en
   5.202 +on the source code level, it is much more interweaved.
   5.203 +Several separate components were compiled into one program
   5.204 +for efficiency reasons.
   5.205 +This led to intricate innards.
   5.206 +While clearly separated on the outside,
   5.207 +the programs turned out to be fairly interweaved inside.
   5.208 +.\" XXX FIXME rewrite...
   5.209 +.\" Unfortunately, the clear separation on the outside turned out to be
   5.210 +.\" fairly interweaved inside.
   5.211 +.P
   5.212 +The advent of MIME raised the complexity of email by a magnitude.
   5.213 +This is visible in nmh. The MIME-related parts are the most complex ones.
   5.214 +It is also visible that MIME support was added on top of the old MH core.
   5.215 +MH's tool chest style made this easily possible and encourages
   5.216 +such approaches, but unfortunately, it led to duplicated functions
   5.217 +and half-hearted implementation of the concepts.
   5.218 +.P
   5.219 +To provide backward-compatibility, it is a common understanding to not
   5.220 +change the default settings.
   5.221 +In consequence, the user needs to activate modern features explicitly
   5.222 +to be able to use them.
   5.223 +This puts a burden on new users, because out-of-the-box nmh remains
   5.224 +in the same ancient style.
   5.225 +If nmh is seen to be a back-end, then this compatibility surely is important.
   5.226 +However, in the same go, new users have difficulties using nmh for modern
   5.227 +emailing.
   5.228 +The small but mature community around nmh needs few change
   5.229 +as they have had their convenient setups for decades.
   5.230 +
   5.231 +
   5.232 +.H1 "mmh
   5.233 +.P
   5.234 +I started to work on my experimental version in October 2011,
   5.235 +at a time when there had been no more than three commits to nmh
   5.236 +since the beginning of the year.
   5.237 +In December, when I announced my work in progress on the
   5.238 +nmh-workers mailing list,
   5.239 +.[
   5.240 +nmh-workers mmh announce December
   5.241 +.]
   5.242 +nmh's community became active, too.
   5.243 +This movement was heavily pushed by Paul Vixie's ``edginess'' comment.
   5.244 +.[
   5.245 +nmh-workers vixie edginess
   5.246 +.]
   5.247 +After long years of stagnation, nmh became actively developed again.
   5.248 +Hence, while I was working on mmh, the community was once more working
   5.249 +on nmh, in parallel.
   5.250 +.P
   5.251 +The name \fImmh\fP may stand for \fImodern mail handler\fP,
   5.252 +because the project tries to modernize nmh.
   5.253 +Personally however, I prefer to call mmh \fImeillo's mail handler\fP,
   5.254 +emphasizing that the project follows my visions and preferences.
   5.255 +(My login name is \fImeillo\fP.)
   5.256 +This project model was inspired by \fIdwm\fP,
   5.257 +which is Anselm Garbe's personal window manager \(en
   5.258 +targeted to satisfy Garbe's personal needs whenever conflicts appear.
   5.259 +Dwm had retained its lean elegance and its focused character, whereas
   5.260 +its community-driven predecessor \fIwmii\fP had grown fat over time.
   5.261 +The development of mmh should remain focused.
   5.262 +
   5.263 +
   5.264 +.U2 "Motivation
   5.265 +.P
   5.266 +MH is the most important of very few command line tool chest email systems.
   5.267 +Tool chests are powerful because they can be perfectly automated and
   5.268 +extended. They allow arbitrary kinds of front-ends to be
   5.269 +implemented on top of them quickly and without internal knowledge.
   5.270 +Additionally, tool chests are easier to maintain than monolithic
   5.271 +programs.
   5.272 +As there are few tool chests for emailing and as MH-like ones are the most
   5.273 +popular among them, they should be developed further.
   5.274 +This keeps their
   5.275 +conceptional elegance and unique scripting qualities available to users.
   5.276 +Mmh creates a modern and convenient entry point to MH-like systems
   5.277 +for new and interested users.
   5.278 +.P
   5.279 +The mmh project is motivated by deficits of nmh and
   5.280 +my wish for general changes, combined
   5.281 +with the nmh community's reluctancy to change.
   5.282 +.P
   5.283 +At that time, nmh had not adjusted to modern emailing needs well enough.
   5.284 +The default setup was completely unusable for modern emailing.
   5.285 +Too much setup work was required.
   5.286 +Several modern features were already available but the community
   5.287 +did not want to have them as default.
   5.288 +Mmh is a way to change this.
   5.289 +.P
   5.290 +In my eyes, MH's concepts could be exploited even better and
   5.291 +the style of the tools could be improved. Both would simplify
   5.292 +and generalize the system, providing cleaner interfaces and more
   5.293 +software leverage at the same time.
   5.294 +Mmh is a way to demonstrate this.
   5.295 +.P
   5.296 +In providing several parts of an email system, nmh can hardly
   5.297 +compete with the large specialized projects that focus
   5.298 +on only one of the components.
   5.299 +The situation can be improved by concentrating the development power
   5.300 +on the most unique part of MH and letting the user pick his preferred
   5.301 +set of other mail components.
   5.302 +Today's pre-packaged software components encourage this model.
   5.303 +Mmh is a way to go for this approach.
   5.304 +.P
   5.305 +It is worthwhile to fork nmh for the development of mmh, because
   5.306 +the two projects focus on different goals and differ in fundamental questions.
   5.307 +The nmh community's reluctance regarding change conflicts
   5.308 +with my strong desire for it.
   5.309 +In developing a separate experimental version new approaches can
   5.310 +easily be tried out without the need to discuss changes beforehand.
   5.311 +In fact, revolutionary changes are hardly possible otherwise.
   5.312 +.P
   5.313 +The mmh project implements and demonstrates the listed ideas
   5.314 +without the need to change nmh or its community.
   5.315 +Of course, the results of the mmh project shall improve nmh, in the end.
   5.316 +
   5.317 +.U2 "Target Field
   5.318 +.P
   5.319 +Any effort needs to be targeted towards a specific goal
   5.320 +in order to be successful.
   5.321 +Following is a description of the imagined typical mmh user.
   5.322 +mmh should satisfy his needs.
   5.323 +.\" XXX  Remove the next sentence?
   5.324 +Actually, as mmh is my personal version of MH, this is a description
   5.325 +of myself.
   5.326 +.P
   5.327 +The target user of mmh likes Unix and its philosophy.
   5.328 +He likes to use programs that are conceptionally appealing.
   5.329 +He's familiar with the command line and enjoys its power.
   5.330 +He is at least capable of shell scripting and wants to improve his
   5.331 +productivity by scripting the mail system.
   5.332 +He naturally uses modern email features, like attachments,
   5.333 +non-ASCII text, and digital cryptography.
   5.334 +He is able to setup email system components besides mmh,
   5.335 +and actually likes the choice to pick the ones he prefers.
   5.336 +He has a reasonably modern system that complies to standards,
   5.337 +like POSIX and ANSI C.
   5.338 +.P
   5.339 +The typical user invokes mmh commands directly in an interactive
   5.340 +shell session, but as well, he uses them to automate mail handling tasks.
   5.341 +Likely, he runs his mail setup on a server machine, to which he connects
   5.342 +via ssh. He might also have local mmh installations on his workstations,
   5.343 +but does rather not rely on graphical front-ends. He definitely wants
   5.344 +to be flexible and thus be able to change his setup to suite his needs.
   5.345 +.P
   5.346 +The typical mmh user is a programmer himself.
   5.347 +He likes to, occasionally, take the opportunity of Free Software to put
   5.348 +hands on and get involved in the software he uses.
   5.349 +Hence, he likes small and clean code bases and he cares for code quality.
   5.350 +In general, he believes that:
   5.351 +.BU
   5.352 +Elegance \(en i.e. simplicity, clarity and generality \(en
   5.353 +is most important.
   5.354 +.BU
   5.355 +Concepts are more important than the concrete implementation.
   5.356 +.BU
   5.357 +Code optimizations for anything but readability should be avoided
   5.358 +if possible.
   5.359 +.BU
   5.360 +Having a lot of choice is bad.
   5.361 +.BU
   5.362 +Removed code is debugged code.
   5.363 +
   5.364 +.U2 "Goals
   5.365 +.P
   5.366 +The general goals for the mmh project are the following:
   5.367 +.IP "Stream-lining
   5.368 +Mmh should be stripped down to its core, which is the user agent (MUA).
   5.369 +The feature set should be distilled to the ones really needed,
   5.370 +effectively removing corner-cases.
   5.371 +Parts that don't add to the main task of being a conceptionally
   5.372 +appealing MUA should be removed.
   5.373 +This includes, the mail submission and mail retrieval facilities.
   5.374 +Choice should be reduced to the main options.
   5.375 +.IP "Modernizing
   5.376 +Mmh's feature set needs to become more modern.
   5.377 +Better support for attachment and digital cryptography needs to be added.
   5.378 +MIME support needs to be integrated deeper and more naturally.
   5.379 +The modern email features need to be readily available, out-of-the-box.
   5.380 +And on the other hand,
   5.381 +bulletin board support and similar obsolete facilities need to be dropped
   5.382 +out.
   5.383 +Likewise, ancient technologies, like hardcopy terminals, should not
   5.384 +be supported any further.
   5.385 +.IP "Code style
   5.386 +Mmh's source code needs to be updated to modern standards.
   5.387 +Standardized library functions should replace non-standard versions
   5.388 +whenever possible.
   5.389 +Code should be separated into distinct modules when possible.
   5.390 +Time and space optimizations should to be replaced by
   5.391 +clear and readable code.
   5.392 +A uniform programming style should prevail.
   5.393 +.IP "Homogeneity
   5.394 +The available concepts need to be expanded as far as possible.
   5.395 +A small set of concepts should prevail thoroughly throughout the system.
   5.396 +The whole system should appear to be of-one-style.
   5.397 +It should feel like being cast as one.
     6.1 --- a/makefile	Sat Jun 23 22:08:17 2012 +0200
     6.2 +++ b/makefile	Sat Jun 23 22:12:14 2012 +0200
     6.3 @@ -1,6 +1,6 @@
     6.4  NAME = thesis
     6.5  CHAPS = style front.roff dedication.roff abstract.roff toc.roff \
     6.6 -	preface.roff ch*.roff refs.roff
     6.7 +	preface.roff intro.roff discussion.roff summary.roff refs.roff
     6.8  PDFFLAGS = -sPAPERSIZE=a4 -dPDFSETTINGS=/prepress
     6.9  
    6.10  all: $(NAME).ps
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/summary.roff	Sat Jun 23 22:12:14 2012 +0200
     7.3 @@ -0,0 +1,16 @@
     7.4 +.H0 "Summary
     7.5 +
     7.6 +.P
     7.7 +Because of several circumstances, my experimental version is rather
     7.8 +a fork today, although this may change again in the future.
     7.9 +
    7.10 +.P
    7.11 +Although mmh bases on nmh, it is likely seen as a step backward.
    7.12 +I agree.
    7.13 +However, this step backward actually is a step forward,
    7.14 +although in a different direction.
    7.15 +
    7.16 +.P
    7.17 +.\" Top candidate for the final sentence:
    7.18 +This enabled me to follow my vision straightly and thus produce
    7.19 +a result of greater pureness.