docs/master

diff discussion.roff @ 107:9f672d3a25f9

Renamed the chapters to speaking names.
author markus schnalke <meillo@marmaro.de>
date Sat, 23 Jun 2012 22:12:14 +0200
parents ch03.roff@9ff356d84c57
children dd5620bf8659
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/discussion.roff	Sat Jun 23 22:12:14 2012 +0200
     1.3 @@ -0,0 +1,2527 @@
     1.4 +.H0 "Discussion
     1.5 +.P
     1.6 +This main chapter discusses the practical work done in the mmh project.
     1.7 +It is structured along the goals to achieve.
     1.8 +The concrete work done
     1.9 +is described in the examples of how the general goals were achieved.
    1.10 +The discussion compares the current version of mmh with the state of
    1.11 +nmh just before the mmh project started, i.e. Fall 2011.
    1.12 +Current changes of nmh will be mentioned only as side notes.
    1.13 +.\" XXX where do I discuss the parallel development of nmh?
    1.14 +
    1.15 +
    1.16 +
    1.17 +.H1 "Stream-Lining
    1.18 +
    1.19 +.P
    1.20 +MH had been considered an all-in-one system for mail handling.
    1.21 +The community around nmh has a similar understanding.
    1.22 +In fundamental difference, mmh shall be a MUA only.
    1.23 +I believe that the development of all-in-one mail systems is obsolete.
    1.24 +Today, email is too complex to be fully covered by single projects.
    1.25 +Such a project won't be able to excel in all aspects.
    1.26 +Instead, the aspects of email should be covered my multiple projects,
    1.27 +which then can be combined to form a complete system.
    1.28 +Excellent implementations for the various aspects of email exist already.
    1.29 +Just to name three examples: Postfix is a specialized MTA,
    1.30 +Procmail is a specialized MDA, and Fetchmail is a specialized MRA.
    1.31 +I believe that it is best to use such specialized tools instead of
    1.32 +providing the same function again as a side-component in the project.
    1.33 +.P
    1.34 +Doing something well, requires to focus on a small set of specific aspects.
    1.35 +Under the assumption that focused development produces better results
    1.36 +in the particular area, specialized projects will be superior
    1.37 +in their field of focus.
    1.38 +Hence, all-in-one mail system projects \(en no matter if monolithic
    1.39 +or modular \(en will never be the best choice in any of the fields.
    1.40 +Even in providing the best consistent all-in-one system they are likely
    1.41 +to be beaten by projects that focus only on integrating existing mail
    1.42 +components to a homogeneous system.
    1.43 +.P
    1.44 +The limiting resource in Free Software community development
    1.45 +is usually man power.
    1.46 +If the development power is spread over a large development area,
    1.47 +it becomes even more difficult to compete with the specialists in the
    1.48 +various fields.
    1.49 +The concrete situation for MH-based mail systems is even tougher,
    1.50 +given the small and aged community, including both developers and users,
    1.51 +it has.
    1.52 +.P
    1.53 +In consequence, I believe that the available development resources
    1.54 +should focus on the point where MH is most unique.
    1.55 +This is clearly the user interface \(en the MUA.
    1.56 +Peripheral parts should be removed to stream-line mmh for the MUA task.
    1.57 +
    1.58 +
    1.59 +.H2 "Mail Transfer Facilities
    1.60 +.P
    1.61 +In contrast to nmh, which also provides mail submission and mail retrieval
    1.62 +agents, mmh is a MUA only.
    1.63 +This general difference initiated the development of mmh.
    1.64 +Removing the mail transfer facilities had been the first work task
    1.65 +in the mmh project.
    1.66 +.P
    1.67 +Focusing on one mail agent role only is motivated by Eric Allman's
    1.68 +experience with Sendmail.
    1.69 +He identified limiting Sendmail the MTA task had be one reason for
    1.70 +its success:
    1.71 +.[ [
    1.72 +costales sendmail
    1.73 +.], p. xviii]
    1.74 +.QS
    1.75 +Second, I limited myself to the routing function \(en
    1.76 +I wouldn't write user agents or delivery backends.
    1.77 +This was a departure of the dominant through of the time,
    1.78 +in which routing logic, local delivery, and often the network code
    1.79 +were incorporated directly into the user agents.
    1.80 +.QE
    1.81 +.P
    1.82 +In mmh, the Mail Submission Agent (MSA) is called
    1.83 +\fIMessage Transfer Service\fP (MTS).
    1.84 +This facility, implemented by the
    1.85 +.Pn post
    1.86 +command, established network connections and spoke SMTP to submit
    1.87 +messages for relay to the outside world.
    1.88 +The changes in email demanded changes in this part of nmh too.
    1.89 +Encryption and authentication for network connections
    1.90 +needed to be supported, hence TLS and SASL were introduced into nmh.
    1.91 +This added complexity to nmh without improving it in its core functions.
    1.92 +Also, keeping up with recent developments in the field of
    1.93 +mail transfer requires development power and specialists.
    1.94 +In mmh this whole facility was simply cut off.
    1.95 +.Ci f6aa95b724fd8c791164abe7ee5468bf5c34f226
    1.96 +.Ci fecd5d34f65597a4dfa16aeabea7d74b191532c3
    1.97 +.Ci 156d35f6425bea4c1ed3c4c79783dc613379c65b
    1.98 +Instead, mmh depends on an external MSA.
    1.99 +The only outgoing interface available to mmh is the
   1.100 +.Pn sendmail
   1.101 +command, which almost any MSA provides.
   1.102 +If not, a wrapper program can be written.
   1.103 +It must read the message from the standard input, extract the
   1.104 +recipient addresses from the message header, and hand the message
   1.105 +over to the MSA.
   1.106 +For example, a wrapper script for qmail would be:
   1.107 +.VS
   1.108 +#!/bin/sh
   1.109 +# ignore command line arguments
   1.110 +exec qmail-inject
   1.111 +VE
   1.112 +The requirement to parse the recipient addresses out of the message header 
   1.113 +is likely to be removed in the future.
   1.114 +Then mmh would give the recipient addresses as command line arguments.
   1.115 +This appears to be the better interface.
   1.116 +.\" XXX implement it
   1.117 +.P
   1.118 +To retrieve mail, the
   1.119 +.Pn inc
   1.120 +command acted as Mail Retrieval Agent (MRA).
   1.121 +It established network connections
   1.122 +and spoke POP3 to retrieve mail from remote servers.
   1.123 +As with mail submission, the network connections required encryption and
   1.124 +authentication, thus TLS and SASL were added.
   1.125 +Support for message retrieval through IMAP will become necessary
   1.126 +to be added soon, too, and likewise for any other changes in mail transfer.
   1.127 +Not so for mmh because it has dropped the support for retrieving mail
   1.128 +from remote locations.
   1.129 +.Ci ab7b48411962d26439f92f35ed084d3d6275459c
   1.130 +Instead, it depends on an external tool to cover this task.
   1.131 +In mmh exist two paths for messages to enter mmh's mail storage:
   1.132 +(1) Mail can be incorporated with
   1.133 +.Pn inc
   1.134 +from the system maildrop, or (2) with
   1.135 +.Pn rcvstore
   1.136 +by reading them, one at a time, from the standard input.
   1.137 +.P
   1.138 +With the removal of the MSA and MRA, mmh converted from an all-in-one
   1.139 +mail system to being a MUA only.
   1.140 +Now, of course, mmh depends on third-party software.
   1.141 +An external MSA is required to transfer mail to the outside world;
   1.142 +an external MRA is required to retrieve mail from remote machines.
   1.143 +There exist excellent implementations of such software,
   1.144 +which do this specific task likely better than the internal
   1.145 +versions had done it.
   1.146 +Also, the best suiting programs can be freely chosen.
   1.147 +.P
   1.148 +As it had already been possible to use an external MSA or MRA,
   1.149 +why not keep the internal version for convenience?
   1.150 +The question whether there is sense in having a fall-back pager in all
   1.151 +the command line tools, for the cases when
   1.152 +.Pn more
   1.153 +or
   1.154 +.Pn less
   1.155 +aren't available, appears to be ridiculous.
   1.156 +Of course, MSAs and MRAs are more complex than text pagers
   1.157 +and not necessarily available but still the concept of orthogonal
   1.158 +design holds: ``Write programs that do one thing and do it well.''
   1.159 +.[
   1.160 +mcilroy unix phil
   1.161 +p. 53
   1.162 +.]
   1.163 +.[
   1.164 +mcilroy bstj foreword
   1.165 +.]
   1.166 +Here, this part of the Unix philosophy was applied not only
   1.167 +to the programs but to the project itself.
   1.168 +In other words:
   1.169 +``Develop projects that focus on one thing and do it well.''
   1.170 +Projects grown complex should be split for the same reasons programs grown
   1.171 +complex should be split.
   1.172 +If it is conceptionally more elegant to have the MSA and MRA as
   1.173 +separate projects then they should be separated.
   1.174 +This is the case here, in my opinion.
   1.175 +The RFCs propose this separation by clearly distinguishing the different
   1.176 +mail handling tasks.
   1.177 +.[
   1.178 +rfc 821
   1.179 +.]
   1.180 +The small interfaces between the mail agents support the separation.
   1.181 +.P
   1.182 +In the beginning, email had been small and simple.
   1.183 +At that time,
   1.184 +.Pn /bin/mail
   1.185 +had covered anything there was to email and still had been small
   1.186 +and simple.
   1.187 +Later, the essential complexity of email increased.
   1.188 +(Essential complexity is the complexity defined by the problem itself.\0
   1.189 +.[[
   1.190 +brooks no silver bullet
   1.191 +.]])
   1.192 +Email systems reacted to this change: They grew.
   1.193 +RFCs started to introduce the concept of mail agents to separate the
   1.194 +various tasks because they became more extensive and new tasks appeared.
   1.195 +As the mail systems grew even more, parts were split off.
   1.196 +In nmh, for instance, the POP server, which was included in the original
   1.197 +MH, was removed.
   1.198 +Now is the time to go one step further and split the MSA and MRA off, too.
   1.199 +Not only does this decrease the code size of the project,
   1.200 +but, more important, it unburdens mmh of the whole field of
   1.201 +message transfer with all its implications for the project.
   1.202 +There is no more need to concern with changes in network transfer.
   1.203 +This independence is received by depending on an external program
   1.204 +that covers the field.
   1.205 +Today, this is a reasonable exchange.
   1.206 +.P
   1.207 +Functionality can be added in three different ways:
   1.208 +.BU
   1.209 +Implementing the function originally in the project.
   1.210 +.BU
   1.211 +Depending on a library that provides the function.
   1.212 +.BU
   1.213 +Depending on a program that provides the function.
   1.214 +.P
   1.215 +Whereas adding the function originally to the project increases the
   1.216 +code size most and requires most maintenance and development work,
   1.217 +it makes the project most independent of other software.
   1.218 +Using libraries or external programs require less maintenance work
   1.219 +but introduces dependencies on external software.
   1.220 +Programs have the smallest interfaces and provide the best separation
   1.221 +but possibly limit the information exchange.
   1.222 +External libraries are stronger connected than external programs,
   1.223 +thus information can be exchanged more flexible.
   1.224 +Adding code to a project increases maintenance work.
   1.225 +.\" XXX ref
   1.226 +Implementing complex functions originally in the project adds
   1.227 +a lot of code.
   1.228 +This should be avoided if possible.
   1.229 +Hence, the dependencies only change in kind, not in their existence.
   1.230 +In mmh, library dependencies on
   1.231 +.Pn libsasl2
   1.232 +and
   1.233 +.Pn libcrypto /\c
   1.234 +.Pn libssl
   1.235 +were treated against program dependencies on an MSA and an MRA.
   1.236 +This also meant treating build-time dependencies against run-time
   1.237 +dependencies.
   1.238 +Besides program dependencies providing the stronger separation
   1.239 +and being more flexible, they also allowed
   1.240 +over 6\|000 lines of code to be removed from mmh.
   1.241 +This made mmh's code base about 12\|% smaller.
   1.242 +Reducing the project's code size by such an amount without actually
   1.243 +losing functionality is a convincing argument.
   1.244 +Actually, as external MSAs and MRAs are likely superior to the
   1.245 +project's internal versions, the common user even gains functionality.
   1.246 +.P
   1.247 +Users of MH should not have problems to set up an external MSA and MRA.
   1.248 +Also, the popular MSAs and MRAs have large communities and a lot
   1.249 +of documentation available.
   1.250 +Choices for MSAs range from full-featured MTAs like
   1.251 +.I Postfix
   1.252 +over mid-size MTAs like
   1.253 +.I masqmail
   1.254 +and
   1.255 +.I dma
   1.256 +to small forwarders like
   1.257 +.I ssmtp
   1.258 +and
   1.259 +.I nullmailer .
   1.260 +Choices for MRAs include
   1.261 +.I fetchmail ,
   1.262 +.I getmail ,
   1.263 +.I mpop
   1.264 +and
   1.265 +.I fdm .
   1.266 +
   1.267 +
   1.268 +.H2 "Non-MUA Tools
   1.269 +.P
   1.270 +One goal of mmh is to remove the tools that are not part of the MUA's task.
   1.271 +Further more, any tools that don't improve the MUA's job significantly
   1.272 +should be removed.
   1.273 +Loosely related and rarely used tools distract from the lean appearance.
   1.274 +They require maintenance work without adding much to the core task.
   1.275 +By removing these tools, the project shall become more stream-lined
   1.276 +and focused.
   1.277 +In mmh the following tools are not available anymore:
   1.278 +.BU
   1.279 +.Pn conflict
   1.280 +was removed
   1.281 +.Ci 8b235097cbd11d728c07b966cf131aa7133ce5a9
   1.282 +because it is a mail system maintenance tool that is not MUA-related.
   1.283 +It even checked
   1.284 +.Fn /etc/passwd
   1.285 +and
   1.286 +.Fn /etc/group
   1.287 +for consistency, which is completely unrelated to email.
   1.288 +A tool like
   1.289 +.Pn conflict
   1.290 +is surely useful, but it should not be shipped with mmh.
   1.291 +.\" XXX historic reasons?
   1.292 +.BU
   1.293 +.Pn rcvtty
   1.294 +was removed
   1.295 +.Ci 14767c94b3827be7c867196467ed7aea5f6f49b0
   1.296 +because its use case of writing to the user's terminal
   1.297 +on receiving of mail is obsolete.
   1.298 +If users like to be informed of new mail, the shell's
   1.299 +.Ev MAILPATH
   1.300 +variable or graphical notifications are technically more appealing.
   1.301 +Writing directly to terminals is hardly ever wanted today.
   1.302 +If though one wants to have it this way, the standard tool
   1.303 +.Pn write
   1.304 +can be used in a way similar to:
   1.305 +.VS
   1.306 +scan -file - | write `id -un`
   1.307 +VE
   1.308 +.BU
   1.309 +.Pn viamail
   1.310 +was removed
   1.311 +.Ci eda72d6a7a7c20ff123043fb7f19c509ea01f932
   1.312 +when the new attachment system was activated, because
   1.313 +.Pn forw
   1.314 +could then cover the task itself.
   1.315 +The program
   1.316 +.Pn sendfiles
   1.317 +was rewritten as a shell script wrapper around
   1.318 +.Pn forw .
   1.319 +.Ci 0e82199cf3c991a173e0ac8aa776efdb3ded61e6
   1.320 +.BU
   1.321 +.Pn msgchk
   1.322 +was removed
   1.323 +.Ci bb9360ead7eb7a3fedcce2eeedfc660014e41dbe ,
   1.324 +because it lost its use case when POP support was removed.
   1.325 +A call to
   1.326 +.Pn msgchk
   1.327 +provided hardly more information than:
   1.328 +.VS
   1.329 +ls -l /var/mail/meillo
   1.330 +VE
   1.331 +It did distinguish between old and new mail, but
   1.332 +this detail information can be retrieved with
   1.333 +.Pn stat (1),
   1.334 +too.
   1.335 +A small shell script could be written to print the information
   1.336 +in a similar way, if truly necessary.
   1.337 +As mmh's
   1.338 +.Pn inc
   1.339 +only incorporates mail from the user's local maildrop,
   1.340 +and thus no data transfers over slow networks are involved,
   1.341 +there's hardly any need to check for new mail before incorporating it.
   1.342 +.BU
   1.343 +.Pn msh
   1.344 +was removed
   1.345 +.Ci 916690191222433a6923a4be54b0d8f6ac01bd02
   1.346 +because the tool was in conflict with the philosophy of MH.
   1.347 +It provided an interactive shell to access the features of MH,
   1.348 +but it wasn't just a shell, tailored to the needs of mail handling.
   1.349 +Instead it was one large program that had several MH tools built in.
   1.350 +This conflicts with the major feature of MH of being a tool chest.
   1.351 +.Pn msh 's
   1.352 +main use case had been accessing Bulletin Boards, which have seized to
   1.353 +be popular.
   1.354 +.P
   1.355 +Removing
   1.356 +.Pn msh ,
   1.357 +together with the truly archaic code relicts
   1.358 +.Pn vmh
   1.359 +and
   1.360 +.Pn wmh ,
   1.361 +saved more than 7\|000 lines of C code \(en
   1.362 +about 15\|% of the project's original source code amount.
   1.363 +Having less code \(en with equal readability, of course \(en
   1.364 +for the same functionality is an advantage.
   1.365 +Less code means less bugs and less maintenance work.
   1.366 +As
   1.367 +.Pn rcvtty
   1.368 +and
   1.369 +.Pn msgchk
   1.370 +are assumed to be rarely used and can be implemented in different ways,
   1.371 +why should one keep them?
   1.372 +Removing them stream-lines mmh.
   1.373 +.Pn viamail 's
   1.374 +use case is now partly obsolete and partly covered by
   1.375 +.Pn forw ,
   1.376 +hence there's no reason to still maintain it.
   1.377 +.Pn conflict
   1.378 +is not related to the mail client, and
   1.379 +.Pn msh
   1.380 +conflicts with the basic concept of MH.
   1.381 +Theses two tools might still be useful, but they should not be part of mmh.
   1.382 +.P
   1.383 +Finally, there's
   1.384 +.Pn slocal .
   1.385 +.Pn slocal
   1.386 +is an MDA and thus not directly MUA-related.
   1.387 +It should be removed from mmh, because including it conflicts with
   1.388 +the idea that mmh is a MUA only.
   1.389 +.Pn slocal
   1.390 +should rather become a separate project.
   1.391 +However,
   1.392 +.Pn slocal
   1.393 +provides rule-based processing of messages, like filing them into
   1.394 +different folders, which is otherwise not available in mmh.
   1.395 +Although
   1.396 +.Pn slocal
   1.397 +does neither pull in dependencies nor does it include a separate
   1.398 +technical area (cf. Sec. XXX), still,
   1.399 +it accounts for about 1\|000 lines of code that need to be maintained.
   1.400 +As
   1.401 +.Pn slocal
   1.402 +is almost self-standing, it should be split off into a separate project.
   1.403 +This would cut the strong connection between the MUA mmh and the MDA
   1.404 +.Pn slocal .
   1.405 +For anyone not using MH,
   1.406 +.Pn slocal
   1.407 +would become yet another independent MDA, like
   1.408 +.I procmail .
   1.409 +Then
   1.410 +.Pn slocal
   1.411 +could be installed without the complete MH system.
   1.412 +Likewise, mmh users could decide to use
   1.413 +.I procmail
   1.414 +without having a second, unused MDA,
   1.415 +.Pn slocal ,
   1.416 +installed.
   1.417 +That appears to be conceptionally the best solution.
   1.418 +Yet,
   1.419 +.Pn slocal
   1.420 +is not split off.
   1.421 +I defer the decision over
   1.422 +.Pn slocal
   1.423 +in need for deeper investigation.
   1.424 +In the meanwhile, it remains part of mmh.
   1.425 +That does not hurt because
   1.426 +.Pn slocal
   1.427 +is unrelated to the rest of the project.
   1.428 +
   1.429 +
   1.430 +.H2 "\fLshow\fP and \fPmhshow\fP
   1.431 +.P
   1.432 +Since the very beginning \(en already in the first concept paper \(en
   1.433 +.Pn show
   1.434 +had been MH's message display program.
   1.435 +.Pn show
   1.436 +mapped message numbers and sequences to files and invoked
   1.437 +.Pn mhl
   1.438 +to have the files formatted.
   1.439 +With MIME, this approach wasn't sufficient anymore.
   1.440 +MIME messages can consist of multiple parts. Some parts are not
   1.441 +directly displayable and text content might be encoded in
   1.442 +foreign charsets.
   1.443 +.Pn show 's
   1.444 +understanding of messages and
   1.445 +.Pn mhl 's
   1.446 +display capabilities couldn't cope with the task any longer.
   1.447 +.P
   1.448 +Instead of extending these tools, additional tools were written from
   1.449 +scratch and added to the MH tool chest.
   1.450 +Doing so is encouraged by the tool chest approach.
   1.451 +Modular design is a great advantage for extending a system,
   1.452 +as new tools can be added without interfering with existing ones.
   1.453 +First, the new MIME features were added in form of the single program
   1.454 +.Pn mhn .
   1.455 +The command
   1.456 +.Cl "mhn -show 42
   1.457 +would show the MIME message numbered 42.
   1.458 +With the 1.0 release of nmh in February 1999, Richard Coleman finished
   1.459 +the split of
   1.460 +.Pn mhn
   1.461 +into a set of specialized tools, which together covered the
   1.462 +multiple aspects of MIME.
   1.463 +One of them was
   1.464 +.Pn mhshow ,
   1.465 +which replaced
   1.466 +.Cl "mhn -show" .
   1.467 +It was capable of displaying MIME messages appropriately.
   1.468 +.P
   1.469 +From then on, two message display tools were part of nmh,
   1.470 +.Pn show
   1.471 +and
   1.472 +.Pn mhshow .
   1.473 +To ease the life of users,
   1.474 +.Pn show
   1.475 +was extended to automatically hand the job over to
   1.476 +.Pn mhshow
   1.477 +if displaying the message would be beyond
   1.478 +.Pn show 's
   1.479 +abilities.
   1.480 +In consequence, the user would simply invoke
   1.481 +.Pn show
   1.482 +(possibly through
   1.483 +.Pn next
   1.484 +or
   1.485 +.Pn prev )
   1.486 +and get the message printed with either
   1.487 +.Pn show
   1.488 +or
   1.489 +.Pn mhshow ,
   1.490 +whatever was more appropriate.
   1.491 +.P
   1.492 +Having two similar tools for essentially the same task is redundant.
   1.493 +Usually,
   1.494 +users wouldn't distinguish between
   1.495 +.Pn show
   1.496 +and
   1.497 +.Pn mhshow
   1.498 +in their daily mail reading.
   1.499 +Having two separate display programs was therefore mainly unnecessary
   1.500 +from a user's point of view.
   1.501 +Besides, the development of both programs needed to be in sync,
   1.502 +to ensure that the programs behaved in a similar way,
   1.503 +because they were used like a single tool.
   1.504 +Different behavior would have surprised the user.
   1.505 +.P
   1.506 +Today, non-MIME messages are rather seen to be a special case of
   1.507 +MIME messages, although it is the other way round.
   1.508 +As
   1.509 +.Pn mhshow
   1.510 +had already be able to display non-MIME messages, it appeared natural
   1.511 +to drop
   1.512 +.Pn show
   1.513 +in favor of using
   1.514 +.Pn mhshow
   1.515 +exclusively.
   1.516 +.Ci 4c1efddfd499300c7e74263e57d8aa137e84c853
   1.517 +Removing
   1.518 +.Pn show
   1.519 +is no loss in function, because functionally
   1.520 +.Pn mhshow
   1.521 +covers it completely.
   1.522 +The old behavior of
   1.523 +.Pn show
   1.524 +can still be emulated with the simple command line:
   1.525 +.VS
   1.526 +mhl `mhpath c`
   1.527 +VE
   1.528 +.P
   1.529 +For convenience,
   1.530 +.Pn mhshow
   1.531 +was renamed to
   1.532 +.Pn show
   1.533 +after
   1.534 +.Pn show
   1.535 +was gone.
   1.536 +It is clear that such a rename may confuse future developers when
   1.537 +trying to understand the history.
   1.538 +Nevertheless, I consider the convenience on the user's side,
   1.539 +to call
   1.540 +.Pn show
   1.541 +when they want a message to be displayed, to outweigh the inconvenience
   1.542 +on the developer's side when understanding the project history.
   1.543 +.P
   1.544 +To prepare for the transition,
   1.545 +.Pn mhshow
   1.546 +was reworked to behave more like
   1.547 +.Pn show
   1.548 +first.
   1.549 +(cf. Sec. XXX)
   1.550 +Once the tools behaved more alike, the replacing appeared to be
   1.551 +even more natural.
   1.552 +Today, mmh's new
   1.553 +.Pn show
   1.554 +became the one single message display program again, with the difference
   1.555 +that today it handles MIME messages as well as non-MIME messages.
   1.556 +The outcome of the transition is one program less to maintain,
   1.557 +no second display program for users to deal with,
   1.558 +and less system complexity.
   1.559 +.P
   1.560 +Still, removing the old
   1.561 +.Pn show
   1.562 +hurts in one regard: It had been such a simple program.
   1.563 +Its lean elegance is missing to the new
   1.564 +.Pn show .
   1.565 +But there is no chance;
   1.566 +supporting MIME demands for higher essential complexity.
   1.567 +
   1.568 +
   1.569 +.H2 "Configure Options
   1.570 +.P
   1.571 +Customization is a double-edged sword.
   1.572 +It allows better suiting setups, but not for free.
   1.573 +There is the cost of code complexity to be able to customize.
   1.574 +There is the cost of less tested setups, because there are
   1.575 +more possible setups and especially corner-cases.
   1.576 +And, there is the cost of choice itself.
   1.577 +The code complexity directly affects the developers.
   1.578 +Less tested code affects both, users and developers.
   1.579 +The problem of choice affects the users, for once by having to
   1.580 +choose, but also by more complex interfaces that require more documentation.
   1.581 +Whenever options add little advantages, they should be considered for
   1.582 +removal.
   1.583 +I have reduced the number of project-specific configure options from 
   1.584 +fifteen to three.
   1.585 +
   1.586 +.U3 "Mail Transfer Facilities
   1.587 +.P
   1.588 +With the removal of the mail transfer facilities five configure
   1.589 +options vanished:
   1.590 +.P
   1.591 +The switches
   1.592 +.Sw --with-tls
   1.593 +and
   1.594 +.Sw --with-cyrus-sasl
   1.595 +had activated the support for transfer encryption and authentication.
   1.596 +This is not needed anymore.
   1.597 +.Ci fecd5d34f65597a4dfa16aeabea7d74b191532c3
   1.598 +.Ci 156d35f6425bea4c1ed3c4c79783dc613379c65b
   1.599 +.P
   1.600 +The configure switch
   1.601 +.Sw --enable-pop
   1.602 +activated the message retrieval facility.
   1.603 +The code area that would be conditionally compiled in for TLS and SASL
   1.604 +support had been small.
   1.605 +The conditionally compiled code area for POP support had been much larger.
   1.606 +Whereas the code base changes would only slightly change on toggling
   1.607 +TLS or SASL support, it changed much on toggling POP support.
   1.608 +The changes in the code base could hardly be overviewed.
   1.609 +By having POP support togglable a second code base had been created,
   1.610 +one that needed to be tested.
   1.611 +This situation is basically similar for the conditional TLS and SASL  
   1.612 +code, but there the changes are minor and can yet be overviewed.
   1.613 +Still, conditional compilation of a code base creates variations
   1.614 +of the original program.
   1.615 +More variations require more testing and maintenance work.
   1.616 +.P
   1.617 +Two other options only specified default configuration values:
   1.618 +.Sw --with-mts
   1.619 +defined the default transport service, either
   1.620 +.Ar smtp
   1.621 +or
   1.622 +.Ar sendmail .
   1.623 +In mmh this fixed to
   1.624 +.Ar sendmail .
   1.625 +.Ci f6aa95b724fd8c791164abe7ee5468bf5c34f226
   1.626 +With
   1.627 +.Sw --with-smtpservers
   1.628 +default SMTP servers for the
   1.629 +.Ar smtp
   1.630 +transport service could be specified.
   1.631 +.Ci 128545e06224233b7e91fc4c83f8830252fe16c9
   1.632 +Both of them became irrelevant.
   1.633 +
   1.634 +.U3 "Backup Prefix
   1.635 +.P
   1.636 +The backup prefix is the string that was prepended to message
   1.637 +filenames to tag them as deleted.
   1.638 +By default it had been the comma character `\f(CW,\fP'.
   1.639 +In July 2000, Kimmo Suominen introduced
   1.640 +the configure option
   1.641 +.Sw --with-hash-backup
   1.642 +to change the default to the hash symbol `\f(CW#\fP'.
   1.643 +The choice was probably personal preference, because first, the
   1.644 +option was named
   1.645 +.Sw --with-backup-prefix.
   1.646 +and had the prefix symbol as argument.
   1.647 +But giving the hash symbol as argument caused too many problems
   1.648 +for Autoconf,
   1.649 +thus the option was limited to use the hash symbol as the default prefix.
   1.650 +This supports the assumption, that the choice for the hash was
   1.651 +personal preference only.
   1.652 +Being related or not, words that start with the hash symbol
   1.653 +introduce a comment in the Unix shell.
   1.654 +Thus, the command line
   1.655 +.Cl "rm #13 #15
   1.656 +calls
   1.657 +.Pn rm
   1.658 +without arguments because the first hash symbol starts the comment
   1.659 +that reaches until the end of the line.
   1.660 +To delete the backup files,
   1.661 +.Cl "rm ./#13 ./#15"
   1.662 +needs to be used.
   1.663 +Using the hash as backup prefix can be seen as a precaution against
   1.664 +data loss.
   1.665 +.P
   1.666 +I removed the configure option but added the profile entry
   1.667 +.Pe backup-prefix ,
   1.668 +which allows to specify an arbitrary string as backup prefix.
   1.669 +.Ci 6c40d481d661d532dd527eaf34cebb6d3f8ed086
   1.670 +Profile entries are the common method to change mmh's behavior.
   1.671 +This change did not remove the choice but moved it to a location where
   1.672 +it suited better.
   1.673 +.P
   1.674 +Eventually, however, the new trash folder concept
   1.675 +.Cf "Sec. XXX
   1.676 +obsoleted the concept of the backup prefix completely.
   1.677 +.Ci 8edc5aaf86f9f77124664f6801bc6c6cdf258173
   1.678 +.\" (Well, there still are corner-cases to remove until the backup
   1.679 +.\" prefix can be laid to rest, eventually.)
   1.680 +.\" FIXME: Do this work in the code!
   1.681 +
   1.682 +.U3 "Editor and Pager
   1.683 +.P
   1.684 +The two configure options
   1.685 +.CW --with-editor=EDITOR
   1.686 +.CW --with-pager=PAGER
   1.687 +were used to specify the default editor and pager at configure time.
   1.688 +Doing so at configure time made sense in the Eighties,
   1.689 +when the set of available editors and pagers varied much across
   1.690 +different systems.
   1.691 +Today, the situation is more homogeneous.
   1.692 +The programs
   1.693 +.Pn vi
   1.694 +and
   1.695 +.Pn more
   1.696 +can be expected to be available on every Unix system,
   1.697 +as they are specified by POSIX since two decades.
   1.698 +(The specifications for
   1.699 +.Pn vi
   1.700 +and
   1.701 +.Pn more
   1.702 +appeared in
   1.703 +.[
   1.704 +posix 1987
   1.705 +.]
   1.706 +and,
   1.707 +.[
   1.708 +posix 1992
   1.709 +.]
   1.710 +respectively.)
   1.711 +As a first step, these two tools were hard-coded as defaults.
   1.712 +.Ci 5d43a99db70c12a673028c7758c20cbe3e13ef5f
   1.713 +Not changed were the
   1.714 +.Pe editor
   1.715 +and
   1.716 +.Pe moreproc
   1.717 +profile entries, which allowed the user to override the system defaults.
   1.718 +Later, the concept was reworked to respect the standard environment
   1.719 +variables
   1.720 +.Ev VISUAL
   1.721 +and
   1.722 +.Ev PAGER
   1.723 +if they are set.
   1.724 +Today, mmh determines the editor to use in the following order,
   1.725 +taking the first available and non-empty item:
   1.726 +.IP (1)
   1.727 +Environment variable
   1.728 +.Ev MMHEDITOR
   1.729 +.IP (2)
   1.730 +Profile entry
   1.731 +.Pe Editor
   1.732 +.IP (3)
   1.733 +Environment variable
   1.734 +.Ev VISUAL
   1.735 +.IP (4)
   1.736 +Environment variable
   1.737 +.Ev EDITOR
   1.738 +.IP (5)
   1.739 +Command
   1.740 +.Pn vi .
   1.741 +.P
   1.742 +.Ci f85f4b7ae62e3d05a945dcd46ead51f0a2a89a9b
   1.743 +.P
   1.744 +The pager to use is determined in a similar order,
   1.745 +also taking the first available and non-empty item:
   1.746 +.IP (1)
   1.747 +Environment variable
   1.748 +.Ev MMHPAGER
   1.749 +.IP (2)
   1.750 +Profile entry
   1.751 +.Pe Pager
   1.752 +(replaces
   1.753 +.Pe moreproc )
   1.754 +.IP (3)
   1.755 +Environment variable
   1.756 +.Ev PAGER
   1.757 +.IP (4)
   1.758 +Command
   1.759 +.Pn more .
   1.760 +.P
   1.761 +.Ci 0c4214ea2aec6497d0d67b436bbee9bc1d225f1e
   1.762 +.P
   1.763 +By respecting the
   1.764 +.Ev VISUAL /\c
   1.765 +.Ev EDITOR
   1.766 +and
   1.767 +.Ev PAGER
   1.768 +environment variables,
   1.769 +the new behavior confirms better to the common style on Unix systems.
   1.770 +Additionally, the new approach is more uniform and clearer to users.
   1.771 +
   1.772 +
   1.773 +.U3 "ndbm
   1.774 +.P
   1.775 +.Pn slocal
   1.776 +used to depend on
   1.777 +.I ndbm ,
   1.778 +a database library.
   1.779 +The database is used to store the `\fLMessage-ID\fP's of all
   1.780 +messages delivered.
   1.781 +This enables
   1.782 +.Pn slocal
   1.783 +to suppress delivering the same message to the same user twice.
   1.784 +(This features was enabled by the
   1.785 +.Sw -suppressdup
   1.786 +switch.)
   1.787 +.P
   1.788 +A variety of versions of the database library exist.
   1.789 +.[
   1.790 +wolter unix incompat notes dbm
   1.791 +.]
   1.792 +Complicated autoconf code was needed to detect them correctly.
   1.793 +Further more, the configure switches
   1.794 +.Sw --with-ndbm=ARG
   1.795 +and
   1.796 +.Sw --with-ndbmheader=ARG
   1.797 +were added to help with difficult setups that would
   1.798 +not be detected automatically or correctly.
   1.799 +.P
   1.800 +By removing the suppress duplicates feature of
   1.801 +.Pn slocal ,
   1.802 +the dependency on
   1.803 +.I ndbm
   1.804 +vanished and 120 lines of complex autoconf code could be saved.
   1.805 +.Ci ecd6d6a20cb7a1507e3a20d6c4cb3a1cf14c6bbf
   1.806 +The change removed functionality too, but that is minor to the
   1.807 +improvement by dropping the dependency and the complex autoconf code.
   1.808 +
   1.809 +.U3 "mh-e Support
   1.810 +.P
   1.811 +The configure option
   1.812 +.Sw --disable-mhe
   1.813 +was removed when the mh-e support was reworked. 
   1.814 +Mh-e is the Emacs front-end to MH.
   1.815 +It requires MH to provide minor additional functions.
   1.816 +The
   1.817 +.Sw --disable-mhe
   1.818 +configure option could switch these extensions off.
   1.819 +After removing the support for old versions of mh-e,
   1.820 +only the
   1.821 +.Sw -build
   1.822 +switches of
   1.823 +.Pn forw
   1.824 +and
   1.825 +.Pn repl
   1.826 +are left to be mh-e extensions.
   1.827 +They are now always built in because they add little code and complexity.
   1.828 +In consequence, the
   1.829 +.Sw --disable-mhe
   1.830 +configure option was removed
   1.831 +.Ci a7ce7b4a580d77b6c2c4d980812beb589aa4c643
   1.832 +Removing the option removed a second code setup that would have
   1.833 +needed to be tested.
   1.834 +This change was first done in nmh and thereafter merged into mmh.
   1.835 +.P
   1.836 +The interface changes in mmh require mh-e to be adjusted in order
   1.837 +to be able to use mmh as back-end.
   1.838 +This will require minor changes to mh-e, but removing the
   1.839 +.Sw -build
   1.840 +switches would require more rework.
   1.841 +
   1.842 +.U3 "Masquerading
   1.843 +.P
   1.844 +The configure option
   1.845 +.Sw --enable-masquerade
   1.846 +could take up to three arguments:
   1.847 +`draft_from', `mmailid', and `username_extension'.
   1.848 +They activated different types of address masquerading.
   1.849 +All of them were implemented in the SMTP-speaking
   1.850 +.Pn post
   1.851 +command, which provided an MSA.
   1.852 +Address masquerading is an MTA's task and mmh does not cover
   1.853 +this field anymore.
   1.854 +Hence, true masquerading needs to be implemented in the external MTA.
   1.855 +.P
   1.856 +The
   1.857 +.I mmailid
   1.858 +masquerading type is the oldest one of the three and the only one
   1.859 +available in the original MH.
   1.860 +It provided a
   1.861 +.I username
   1.862 +to
   1.863 +.I fakeusername
   1.864 +mapping, based on the password file's GECOS field.
   1.865 +The man page
   1.866 +.Mp mh-tailor(5)
   1.867 +described the use case as being the following:
   1.868 +.QS
   1.869 +This is useful if you want the messages you send to always
   1.870 +appear to come from the name of an MTA alias rather than your
   1.871 +actual account name.  For instance, many organizations set up
   1.872 +`First.Last' sendmail aliases for all users.  If this is
   1.873 +the case, the GECOS field for each user should look like:
   1.874 +``First [Middle] Last <First.Last>''
   1.875 +.QE
   1.876 +.P
   1.877 +As mmh sends outgoing mail via the local MTA only,
   1.878 +the best location to do such global rewrites is there.
   1.879 +Besides, the MTA is conceptionally the right location because it
   1.880 +does the reverse mapping for incoming mail (aliasing), too.
   1.881 +Further more, masquerading set up there is readily available for all
   1.882 +mail software on the system.
   1.883 +Hence, mmailid masquerading was removed.
   1.884 +.Ci 0836c8000ccb34b59410ef1c15b1b7feac70ce5f
   1.885 +.P
   1.886 +The
   1.887 +.I username_extension
   1.888 +masquerading type did not replace the username but would append a suffix,
   1.889 +specified by the
   1.890 +.Ev USERNAME_EXTENSION
   1.891 +environment variable, to it.
   1.892 +This provided support for the
   1.893 +.I user-extension
   1.894 +feature of qmail and the similar
   1.895 +.I "plussed user
   1.896 +processing of sendmail.
   1.897 +The decision to remove this username_extension masquerading was
   1.898 +motivated by the fact that
   1.899 +.Pn spost
   1.900 +hadn't supported it already.
   1.901 +.Ci 2abae0bfd0ad5bf898461e50aa4b466d641f23d9
   1.902 +Username extensions are possible in mmh, but less convenient to use.
   1.903 +.\" XXX format file %(getenv USERNAME_EXTENSION)
   1.904 +.P
   1.905 +The
   1.906 +.I draft_from
   1.907 +masquerading type instructed
   1.908 +.Pn post
   1.909 +to use the value of the
   1.910 +.Hd From
   1.911 +header field as SMTP envelope sender.
   1.912 +Sender addresses could be replaced completely.
   1.913 +.Ci b14ea6073f77b4359aaf3fddd0e105989db9
   1.914 +Mmh offers a kind of masquerading similar in effect, but
   1.915 +with technical differences.
   1.916 +As mmh does not transfer messages itself, the local MTA has final control
   1.917 +over the sender's address. Any masquerading mmh introduces may be reverted
   1.918 +by the MTA.
   1.919 +In times of pedantic spam checking, an MTA will take care to use
   1.920 +sensible envelope sender addresses to keep its own reputation up.
   1.921 +Nonetheless, the MUA can set the
   1.922 +.Hd From
   1.923 +header field and thereby propose
   1.924 +a sender address to the MTA.
   1.925 +The MTA may then decide to take that one or generate the canonical sender
   1.926 +address for use as envelope sender address.
   1.927 +.P
   1.928 +In mmh, the MTA will always extract the recipient and sender from the
   1.929 +message header (\c
   1.930 +.Pn sendmail 's
   1.931 +.Sw -t
   1.932 +switch).
   1.933 +The
   1.934 +.Hd From
   1.935 +header field of the draft may be set arbitrary by the user.
   1.936 +If it is missing, the canonical sender address will be generated by the MTA.
   1.937 +
   1.938 +.U3 "Remaining Options
   1.939 +.P
   1.940 +Two configure options remain in mmh.
   1.941 +One is the locking method to use:
   1.942 +.Sw --with-locking=[dot|fcntl|flock|lockf] .
   1.943 +The idea of removing all methods except the portable dot locking
   1.944 +and having that one as the default is appealing, but this change
   1.945 +requires deeper technical investigation into the topic.
   1.946 +The other option,
   1.947 +.Sw --enable-debug ,
   1.948 +compiles the programs with debugging symbols and does not strip them.
   1.949 +This option is likely to stay.
   1.950 +
   1.951 +
   1.952 +
   1.953 +
   1.954 +.H2 "Command Line Switches
   1.955 +.P
   1.956 +The command line switches of MH tools follow the X Window style.
   1.957 +They are words, introduced by a single dash.
   1.958 +For example:
   1.959 +.Cl "-truncate" .
   1.960 +Every program in mmh has two generic switches:
   1.961 +.Sw -help ,
   1.962 +to print a short message on how to use the program, and 
   1.963 +.Sw -Version ,
   1.964 +to tell what version of mmh the program belongs to.
   1.965 +.P
   1.966 +Switches change the behavior of programs.
   1.967 +Programs that do one thing in one way require no switches.
   1.968 +In most cases, doing something in exactly one way is too limiting.
   1.969 +If there is basically one task to accomplish, but it should be done
   1.970 +in various ways, switches are a good approach to alter the behavior
   1.971 +of a program.
   1.972 +Changing the behavior of programs provides flexibility and customization
   1.973 +to users, but at the same time it complicates the code, documentation and
   1.974 +usage of the program.
   1.975 +.\" XXX: Ref
   1.976 +Therefore, the number of switches should be kept small.
   1.977 +A small set of well-chosen switches does no harm.
   1.978 +But usually, the number of switches increases over time.
   1.979 +Already in 1985, Rose and Romine have identified this as a major
   1.980 +problem of MH:
   1.981 +.[ [
   1.982 +rose romine real work
   1.983 +.], p. 12]
   1.984 +.QS
   1.985 +A complaint often heard about systems which undergo substantial development
   1.986 +by many people over a number of years, is that more and more options are
   1.987 +introduced which add little to the functionality but greatly increase the
   1.988 +amount of information a user needs to know in order to get useful work done.
   1.989 +This is usually referred to as creeping featurism.
   1.990 +.QP
   1.991 +Unfortunately MH, having undergone six years of off-and-on development by
   1.992 +ten or so well-meaning programmers (the present authors included),
   1.993 +suffers mightily from this.
   1.994 +.QE
   1.995 +.P
   1.996 +Being reluctant to adding new switches \(en or `options',
   1.997 +as Rose and Romine call them \(en is one part of a counter-action,
   1.998 +the other part is removing hardly used switches.
   1.999 +Nmh's tools had lots of switches already implemented,
  1.1000 +hence, cleaning up by removing some of them was the more important part
  1.1001 +of the counter-action.
  1.1002 +Removing existing functionality is always difficult because it
  1.1003 +breaks programs that use these functions.
  1.1004 +Also, for every obsolete feature, there'll always be someone who still
  1.1005 +uses it and thus opposes its removal.
  1.1006 +This puts the developer into the position,
  1.1007 +where sensible improvements to style are regarded as destructive acts.
  1.1008 +Yet, living with the featurism is far worse, in my eyes, because
  1.1009 +future needs will demand adding further features,
  1.1010 +worsening the situation more and more.
  1.1011 +Rose and Romine added in a footnote,
  1.1012 +``[...]
  1.1013 +.Pn send
  1.1014 +will no doubt acquire an endless number of switches in the years to come.''
  1.1015 +Although clearly humorous, the comment points to the nature of the problem.
  1.1016 +Refusing to add any new switches would encounter the problem at its root,
  1.1017 +but this is not practical.
  1.1018 +New needs will require new switches and it would be unwise to block
  1.1019 +them strictly.
  1.1020 +Nevertheless, removing obsolete switches still is an effective approach
  1.1021 +to deal with the problem.
  1.1022 +Working on an experimental branch without an established user base,
  1.1023 +eased my work because I did not offend users when I removed existing
  1.1024 +funtions.
  1.1025 +.P
  1.1026 +Rose and Romine counted 24 visible and 9 more hidden switches for
  1.1027 +.Pn send .
  1.1028 +In nmh, they increased up to 32 visible and 12 hidden ones.
  1.1029 +At the time of writing, no more than 7 visible switches and 1 hidden switch
  1.1030 +have remained in mmh's
  1.1031 +.Pn send .
  1.1032 +(These numbers include two generic switches, help and version.)
  1.1033 +.P
  1.1034 +Fig. XXX
  1.1035 +.\" XXX Ref
  1.1036 +displays the number of switches for each of the tools that is available
  1.1037 +in both, nmh and mmh.
  1.1038 +The tools are sorted by the number of switches they had in nmh.
  1.1039 +Visible and hidden switches were counted,
  1.1040 +but not the generic help and version switches.
  1.1041 +Whereas in the beginning of the project, the average tool had 11 switches,
  1.1042 +now it has no more than 5 \(en only half as many.
  1.1043 +If the `no' switches and similar inverse variant are folded onto
  1.1044 +their counter-parts, the average tool had 8 switches in pre-mmh times and
  1.1045 +has 4 now.
  1.1046 +The total number of functional switches in mmh dropped from 465
  1.1047 +to 234.
  1.1048 +
  1.1049 +.KS
  1.1050 +.in 1c
  1.1051 +.so input/switches.grap
  1.1052 +.KE
  1.1053 +
  1.1054 +.P
  1.1055 +A part of the switches vanished after functions were removed.
  1.1056 +This was the case for network mail transfer, for instance.
  1.1057 +Sometimes, however, the work flow was the other way:
  1.1058 +I looked through the
  1.1059 +.Mp mh-chart (7)
  1.1060 +man page to identify the tools with apparently too many switches.
  1.1061 +Then considering the value of each of the switches by examining
  1.1062 +the tool's man page and source code, aided by recherche and testing.
  1.1063 +This way, the removal of functions was suggested by the aim to reduce
  1.1064 +the number of switches per command.
  1.1065 +
  1.1066 +
  1.1067 +.U3 "Draft Folder Facility
  1.1068 +.P
  1.1069 +A change early in the project was the complete transition from
  1.1070 +the single draft message to the draft folder facility.
  1.1071 +.Ci 337338b404931f06f0db2119c9e145e8ca5a9860
  1.1072 +The draft folder facility was introduced in the mid-Eighties, when
  1.1073 +Rose and Romine called it a ``relatively new feature''.
  1.1074 +.[
  1.1075 +rose romine real work
  1.1076 +.]
  1.1077 +Since then, the facility had existed but was deactivated by default.
  1.1078 +The default activation and the related rework of the tools made it
  1.1079 +possible to remove the
  1.1080 +.Sw -[no]draftfolder ,
  1.1081 +and
  1.1082 +.Sw -draftmessage
  1.1083 +switches from
  1.1084 +.Pn comp ,
  1.1085 +.Pn repl ,
  1.1086 +.Pn forw ,
  1.1087 +.Pn dist ,
  1.1088 +.Pn whatnow ,
  1.1089 +and
  1.1090 +.Pn send .
  1.1091 +.Ci 337338b404931f06f0db2119c9e145e8ca5a9860
  1.1092 +The only flexibility removed with this change is having multiple
  1.1093 +draft folders within one profile.
  1.1094 +I consider this a theoretical problem only.
  1.1095 +In the same go, the
  1.1096 +.Sw -draft
  1.1097 +switch of
  1.1098 +.Pn anno ,
  1.1099 +.Pn refile ,
  1.1100 +and
  1.1101 +.Pn send
  1.1102 +was removed.
  1.1103 +The special-casing of `the' draft message became irrelevant after
  1.1104 +the rework of the draft system.
  1.1105 +(See Sec. XXX.)
  1.1106 +Equally,
  1.1107 +.Pn comp
  1.1108 +lost its
  1.1109 +.Sw -file
  1.1110 +switch.
  1.1111 +The draft folder facility, together with the
  1.1112 +.Sw -form
  1.1113 +switch, are sufficient.
  1.1114 +
  1.1115 +
  1.1116 +.U3 "In Place Editing
  1.1117 +.P
  1.1118 +.Pn anno
  1.1119 +had the switches
  1.1120 +.Sw -[no]inplace
  1.1121 +to either annotate the message in place and thus preserve hard links,
  1.1122 +or annotate a copy to replace the original message, breaking hard links.
  1.1123 +Following the assumption that linked messages should truly be the
  1.1124 +same message, and annotating it should not break the link, the
  1.1125 +.Sw -[no]inplace
  1.1126 +switches were removed and the previous default
  1.1127 +.Sw -inplace
  1.1128 +was made the only behavior.
  1.1129 +.Ci c8195849d2e366c569271abb0f5f60f4ebf0b4d0
  1.1130 +The
  1.1131 +.Sw -[no]inplace
  1.1132 +switches of
  1.1133 +.Pn repl ,
  1.1134 +.Pn forw ,
  1.1135 +and
  1.1136 +.Pn dist
  1.1137 +could be removed, too, as they were simply passed through to
  1.1138 +.Pn anno .
  1.1139 +.P
  1.1140 +.Pn burst
  1.1141 +also had
  1.1142 +.Sw -[no]inplace
  1.1143 +switches, but with different meaning.
  1.1144 +With
  1.1145 +.Sw -inplace ,
  1.1146 +the digest had been replaced by the table of contents (i.e. the
  1.1147 +introduction text) and the bursted messages were placed right
  1.1148 +after this message, renumbering all following messages.
  1.1149 +Also, any trailing text of the digest was lost, though,
  1.1150 +in practice, it usually consists of an end-of-digest marker only.
  1.1151 +Nontheless, this behavior appeared less elegant than the
  1.1152 +.Sw -noinplace
  1.1153 +behavior, which already had been the default.
  1.1154 +Nmh's
  1.1155 +.Mp burst (1)
  1.1156 +man page reads:
  1.1157 +.sp \n(PDu
  1.1158 +.QS
  1.1159 +If -noinplace is given, each digest is preserved, no table
  1.1160 +of contents is produced, and the messages contained within
  1.1161 +the digest are placed at the end of the folder. Other messages
  1.1162 +are not tampered with in any way.
  1.1163 +.QE
  1.1164 +.LP
  1.1165 +The decision to drop the
  1.1166 +.Sw -inplace
  1.1167 +behavior was supported by the code complexity and the possible data loss
  1.1168 +it caused.
  1.1169 +.Sw -noinplace
  1.1170 +was chosen to be the definitive behavior.
  1.1171 +.Ci 68a686adeb39223a5e1ad35e4a24890ec053679d
  1.1172 +
  1.1173 +
  1.1174 +.U3 "Forms and Format Strings
  1.1175 +.P
  1.1176 +Historically, the tools that had
  1.1177 +.Sw -form
  1.1178 +switches to supply a form file had
  1.1179 +.Sw -format
  1.1180 +switches as well to supply the contents of a form file as a string
  1.1181 +on the command line directly.
  1.1182 +In consequence, the following two lines equaled:
  1.1183 +.VS
  1.1184 +scan -form scan.mailx
  1.1185 +scan -format "`cat .../scan.mailx`"
  1.1186 +VE
  1.1187 +The
  1.1188 +.Sw -format
  1.1189 +switches were dropped in favor for extending the
  1.1190 +.Sw -form
  1.1191 +switches.
  1.1192 +.Ci f51956be123db66b00138f80464d06f030dbb88d
  1.1193 +If their argument starts with an equal sign (`='),
  1.1194 +then the rest of the argument is taken as a format string,
  1.1195 +otherwise the arguments is treated as the name of a format file.
  1.1196 +Thus, now the following two lines equal:
  1.1197 +.VS
  1.1198 +scan -form scan.mailx
  1.1199 +scan -form "=`cat .../scan.mailx`"
  1.1200 +VE
  1.1201 +This rework removed the prefix collision between
  1.1202 +.Sw -form
  1.1203 +and
  1.1204 +.Sw -format .
  1.1205 +Now, typing
  1.1206 +.Sw -fo
  1.1207 +suffices to specify form or format string.
  1.1208 +.P
  1.1209 +The different meaning of
  1.1210 +.Sw -format
  1.1211 +for
  1.1212 +.Pn repl
  1.1213 +and
  1.1214 +.Pn forw
  1.1215 +was removed in mmh.
  1.1216 +.Pn forw
  1.1217 +was completely switched to MIME-type forwarding, thus removing the
  1.1218 +.Sw -[no]format .
  1.1219 +.Ci 6e271608b7b9c23771523f88d23a4d3593010cf1
  1.1220 +For
  1.1221 +.Pn repl ,
  1.1222 +the
  1.1223 +.Sw -[no]format
  1.1224 +switches were reworked to
  1.1225 +.Sw -[no]filter
  1.1226 +switches.
  1.1227 +.Ci 67411b1f95d6ec987b4c732459e1ba8a8ac192c6
  1.1228 +The
  1.1229 +.Sw -format
  1.1230 +switches of
  1.1231 +.Pn send
  1.1232 +and
  1.1233 +.Pn post ,
  1.1234 +which had a third meaning,
  1.1235 +were removed likewise.
  1.1236 +.Ci f3cb7cde0e6f10451b6848678d95860d512224b9
  1.1237 +Eventually, the ambiguity of the
  1.1238 +.Sw -format
  1.1239 +switches was resolved by not anymore having any such switch in mmh.
  1.1240 +
  1.1241 +
  1.1242 +.U3 "MIME Tools
  1.1243 +.P
  1.1244 +The MIME tools, which were once part of
  1.1245 +.Pn mhn
  1.1246 +[sic!],
  1.1247 +had several switches that added little practical value to the programs.
  1.1248 +The
  1.1249 +.Sw -[no]realsize
  1.1250 +switches of
  1.1251 +.Pn mhbuild
  1.1252 +and
  1.1253 +.Pn mhlist
  1.1254 +were removed, doing real size calculations always now
  1.1255 +.Ci 8d8f1c3abc586c005c904e52c4adbfe694d2201c ,
  1.1256 +as
  1.1257 +``This provides an accurate count at the expense of a small delay.''
  1.1258 +This small delay is not noticable on modern systems.
  1.1259 +.P
  1.1260 +The
  1.1261 +.Sw -[no]check
  1.1262 +switches were removed together with the support for
  1.1263 +.Hd Content-MD5
  1.1264 +header fields.
  1.1265 +.[
  1.1266 +rfc 1864
  1.1267 +.]
  1.1268 +.Ci 31dc797eb5178970d68962ca8939da3fd9a8efda
  1.1269 +(See Sec. XXX)
  1.1270 +.P
  1.1271 +The
  1.1272 +.Sw -[no]ebcdicsafe
  1.1273 +and
  1.1274 +.Sw -[no]rfc934mode
  1.1275 +switches of
  1.1276 +.Pn mhbuild
  1.1277 +were removed because they are considered obsolete.
  1.1278 +.Ci 01a3480928da485b4d6109d36d751dfa71799d58
  1.1279 +.Ci 3363e2624dce0eb8164cf8b3f1ab385c8ff72e88
  1.1280 +.P
  1.1281 +Content caching of external MIME parts, activated with the
  1.1282 +.Sw -rcache
  1.1283 +and
  1.1284 +.Sw -wcache
  1.1285 +switches was completely removed.
  1.1286 +.Ci d1fefd9f614e4dc3cda16da6c69133c1b2005269
  1.1287 +External MIME parts are rare today, having a caching facility
  1.1288 +for them is appears to be unnecessary.
  1.1289 +.P
  1.1290 +In pre-MIME times,
  1.1291 +.Pn mhl
  1.1292 +had covered many tasks that are part of MIME handling today.
  1.1293 +Therefore,
  1.1294 +.Pn mhl
  1.1295 +could be simplified to a large extend, reducing the number of its
  1.1296 +switches from 21 to 6.
  1.1297 +.Ci 350ad6d3542a07639213cf2a4fe524e829c1e7b6
  1.1298 +.Ci 0e46503be3c855bddaeae3843e1b659279c35d70
  1.1299 +
  1.1300 +
  1.1301 +.U3 "Mail Transfer Switches
  1.1302 +.P
  1.1303 +With the removal of the mail transfer facilities, a lot of switches
  1.1304 +vanished automatically.
  1.1305 +.Pn inc
  1.1306 +lost 9 switches, namely
  1.1307 +.Sw -host ,
  1.1308 +.Sw -port ,
  1.1309 +.Sw -user ,
  1.1310 +.Sw -proxy ,
  1.1311 +.Sw -snoop ,
  1.1312 +.Sw -[no]pack ,
  1.1313 +as well as
  1.1314 +.Sw -sasl
  1.1315 +and
  1.1316 +.Sw -saslmech .
  1.1317 +.Pn send
  1.1318 +and
  1.1319 +.Pn post 
  1.1320 +lost 11 switches each, namely
  1.1321 +.Sw -server ,
  1.1322 +.Sw -port ,
  1.1323 +.Sw -client ,
  1.1324 +.Sw -user ,
  1.1325 +.Sw -mail ,
  1.1326 +.Sw -saml ,
  1.1327 +.Sw -send ,
  1.1328 +.Sw -soml ,
  1.1329 +.Sw -snoop ,
  1.1330 +as well as
  1.1331 +.Sw -sasl ,
  1.1332 +.Sw -saslmech ,
  1.1333 +and
  1.1334 +.Sw -tls .
  1.1335 +.Pn send
  1.1336 +had the switches only to pass them further to
  1.1337 +.Pn post ,
  1.1338 +because the user would invoke
  1.1339 +.Pn post
  1.1340 +not directly, but through
  1.1341 +.Pn send .
  1.1342 +All these switches, except
  1.1343 +.Sw -snoop
  1.1344 +were usually defined as default switches in the user's profile,
  1.1345 +but hardly given in interactive usage.
  1.1346 +.P
  1.1347 +Of course, those switches did not really ``vanish'', but the configuration
  1.1348 +they did was handed over to external MSAs and MRAs.
  1.1349 +Instead of setting up the mail transfer in mmh, it is set up in
  1.1350 +external tools.
  1.1351 +Yet, this simplifies mmh.
  1.1352 +Specialized external tools will likely have simple configuration files.
  1.1353 +Hence, instead of having one complicated central configuration file,
  1.1354 +the configuration of each domain is separate.
  1.1355 +Although the user needs to learn to configure each of the tools,
  1.1356 +each configuration is likely much simpler.
  1.1357 +
  1.1358 +
  1.1359 +.U3 "Maildrop Formats
  1.1360 +.P
  1.1361 +With the removal of MMDF maildrop format support,
  1.1362 +.Pn packf
  1.1363 +and
  1.1364 +.Pn rcvpack
  1.1365 +no longer needed their
  1.1366 +.Sw -mbox
  1.1367 +and
  1.1368 +.Sw -mmdf
  1.1369 +switches.
  1.1370 +.Sw -mbox
  1.1371 +is the sole  behavior now.
  1.1372 +.Ci 3916ab66ad5d183705ac12357621ea8661afd3c0
  1.1373 +In the same go,
  1.1374 +.Pn packf
  1.1375 +and
  1.1376 +.Pn rcvpack
  1.1377 +were reworked (see Sec. XXX) and their
  1.1378 +.Sw -file
  1.1379 +switch became unnecessary.
  1.1380 +.Ci ca1023716d4c2ab890696f3e41fa0d94267a940e
  1.1381 +
  1.1382 +
  1.1383 +.U3 "Terminal Magic
  1.1384 +.P
  1.1385 +Mmh's tools will no longer clear the screen (\c
  1.1386 +.Pn scan 's
  1.1387 +and
  1.1388 +.Pn mhl 's
  1.1389 +.Sw -[no]clear
  1.1390 +switches
  1.1391 +.Ci e57b17343dcb3ff373ef4dd089fbe778f0c7c270
  1.1392 +.Ci 943765e7ac5693ae177fd8d2b5a2440e53ce816e ).
  1.1393 +Neither will
  1.1394 +.Pn mhl
  1.1395 +ring the bell (\c
  1.1396 +.Sw -[no]bell
  1.1397 +.Ci e11983f44e59d8de236affa5b0d0d3067c192e24 )
  1.1398 +nor page the output itself (\c
  1.1399 +.Sw -length
  1.1400 +.Ci 5b9d883db0318ed2b84bb82dee880d7381f99188 ).
  1.1401 +.P
  1.1402 +Generally, the pager to use is no longer specified with the
  1.1403 +.Sw -[no]moreproc
  1.1404 +command line switches for
  1.1405 +.Pn mhl
  1.1406 +and
  1.1407 +.Pn show /\c
  1.1408 +.Pn mhshow .
  1.1409 +.Ci 39e87a75b5c2d3572ec72e717720b44af291e88a
  1.1410 +.P
  1.1411 +.Pn prompter
  1.1412 +lost its
  1.1413 +.Sw -erase
  1.1414 +and
  1.1415 +.Sw -kill
  1.1416 +switches because today the terminal cares for the line editing keys.
  1.1417 +
  1.1418 +
  1.1419 +.U3 "Header Printing
  1.1420 +.P
  1.1421 +.Pn folder 's
  1.1422 +data output is self-explaining enough that
  1.1423 +displaying the header line makes few sense.
  1.1424 +Hence, the
  1.1425 +.Sw -[no]header
  1.1426 +switch was removed and headers are never printed.
  1.1427 +.Ci 601cc73d1fa05ce96faa728f036d6c51b91701c7
  1.1428 +.P
  1.1429 +In
  1.1430 +.Pn mhlist ,
  1.1431 +the
  1.1432 +.Sw -[no]header
  1.1433 +switches were removed, too.
  1.1434 +.Ci b24f96523aaf60e44e04a3ffb1d22e69a13a602f
  1.1435 +But in this case headers are always printed,
  1.1436 +because the output is not self-explaining.
  1.1437 +.P
  1.1438 +.Pn scan
  1.1439 +also had
  1.1440 +.Sw -[no]header
  1.1441 +switches.
  1.1442 +Printing the header had been sensible until the introduction of
  1.1443 +format strings made it impossible to display the column headings.
  1.1444 +Only the folder name and the current date remained to be printed.
  1.1445 +As this information can be perfectly retrieved by
  1.1446 +.Pn folder
  1.1447 +and
  1.1448 +.Pn date ,
  1.1449 +consequently, the switches were removed.
  1.1450 +.Ci c477dc5d1d03fa6d9a8ab3dd3508c63cbddc044e
  1.1451 +.P
  1.1452 +By removing all
  1.1453 +.Sw -header
  1.1454 +switches, the collision with
  1.1455 +.Sw -help
  1.1456 +on the first two letters was resolved.
  1.1457 +Currently,
  1.1458 +.Sw -h
  1.1459 +evaluates to
  1.1460 +.Sw -help
  1.1461 +for all tools of mmh.
  1.1462 +
  1.1463 +
  1.1464 +.U3 "Suppressing Edits or the WhatNow Shell
  1.1465 +.P
  1.1466 +The
  1.1467 +.Sw -noedit
  1.1468 +switch of
  1.1469 +.Pn comp ,
  1.1470 +.Pn repl ,
  1.1471 +.Pn forw ,
  1.1472 +.Pn dist ,
  1.1473 +and
  1.1474 +.Pn whatnow
  1.1475 +was removed, but it can now be replaced by specifying
  1.1476 +.Sw -editor
  1.1477 +with an empty argument.
  1.1478 +.Ci 75fca31a5b9d5c1a99c74ab14c94438d8852fba9
  1.1479 +(Specifying
  1.1480 +.Cl "-editor true
  1.1481 +is nearly the same, only differing by the previous editor being set.)
  1.1482 +.P
  1.1483 +The more important change is the removal of the
  1.1484 +.Sw -nowhatnowproc
  1.1485 +switch.
  1.1486 +.Ci ee4f43cf2ef0084ec698e4e87159a94c01940622
  1.1487 +This switch had introduced an awkward behavior, as explained in nmh's
  1.1488 +man page for
  1.1489 +.Mp comp (1):
  1.1490 +.QS
  1.1491 +The \-editor editor switch indicates the editor to use for
  1.1492 +the initial edit. Upon exiting from the editor, comp will
  1.1493 +invoke the whatnow program. See whatnow(1) for a discussion
  1.1494 +of available options. The invocation of this program can be
  1.1495 +inhibited by using the \-nowhatnowproc switch. (In truth of
  1.1496 +fact, it is the whatnow program which starts the initial
  1.1497 +edit. Hence, \-nowhatnowproc will prevent any edit from
  1.1498 +occurring.)
  1.1499 +.QE
  1.1500 +.P
  1.1501 +Effectively, the
  1.1502 +.Sw -nowhatnowproc
  1.1503 +switch creates only a draft message.
  1.1504 +As
  1.1505 +.Cl "-whatnowproc true
  1.1506 +causes the same behavior, the
  1.1507 +.Sw -nowhatnowproc
  1.1508 +switch was removed for being redundant.
  1.1509 +Likely, the
  1.1510 +.Sw -nowhatnowproc
  1.1511 +switch was intended to be used by front-ends.
  1.1512 +
  1.1513 +
  1.1514 +.U3 "Compatibility Switches
  1.1515 +.BU
  1.1516 +The hidden
  1.1517 +.Sw -[no]total
  1.1518 +switches of
  1.1519 +.Pn flist .
  1.1520 +They were simply the inverse of the visible
  1.1521 +.Sw -[no]fast
  1.1522 +switches:
  1.1523 +.Sw -total
  1.1524 +was
  1.1525 +.Sw -nofast
  1.1526 +and
  1.1527 +.Sw -nototal
  1.1528 +was
  1.1529 +.Sw -fast .
  1.1530 +I removed the
  1.1531 +.Sw -[no]total
  1.1532 +legacy.
  1.1533 +.Ci ea21fe2c4bd23c639bef251398fae809875732ec
  1.1534 +.BU
  1.1535 +The
  1.1536 +.Sw -subject
  1.1537 +switch of
  1.1538 +.Pn sortm
  1.1539 +existed for compatibility only.
  1.1540 +It can be fully replaced by
  1.1541 +.Cl "-textfield subject
  1.1542 +thus it was removed.
  1.1543 +.Ci 00140a3c86e9def69d98ba2ffd4d6e50ef6326ea
  1.1544 +
  1.1545 +
  1.1546 +.U3 "Various
  1.1547 +.BU
  1.1548 +In order to avoid prefix collisions among switch names, the
  1.1549 +.Sw -version
  1.1550 +switch was renamed to
  1.1551 +.Sw -Version
  1.1552 +(with capital `V').
  1.1553 +.Ci 32b2354dbaf4bf934936eb5b102a4a3d2fdd209a
  1.1554 +Every program has the
  1.1555 +.Sw -version
  1.1556 +switch but its first three letters collided with the
  1.1557 +.Sw -verbose
  1.1558 +switch, present in many programs.
  1.1559 +The rename solved this problem once for all.
  1.1560 +Although this rename breaks a basic interface, having the
  1.1561 +.Sw -V
  1.1562 +abbreviation to display the version information, isn't all too bad.
  1.1563 +.BU
  1.1564 +.Sw -[no]preserve
  1.1565 +of
  1.1566 +.Pn refile
  1.1567 +was removed because what use was it anyway?
  1.1568 +.QS
  1.1569 +Normally when a message is refiled, for each destination
  1.1570 +folder it is assigned the number which is one above the current
  1.1571 +highest message number in that folder. Use of the
  1.1572 +\-preserv [sic!] switch will override this message renaming, and try
  1.1573 +to preserve the number of the message. If a conflict for a
  1.1574 +particular folder occurs when using the \-preserve switch,
  1.1575 +then refile will use the next available message number which
  1.1576 +is above the message number you wish to preserve.
  1.1577 +.QE
  1.1578 +.BU
  1.1579 +The removal of the
  1.1580 +.Sw -[no]reverse
  1.1581 +switches of
  1.1582 +.Pn scan
  1.1583 +.Ci 8edc5aaf86f9f77124664f6801bc6c6cdf258173
  1.1584 +is a bug fix, supported by the comments
  1.1585 +``\-[no]reverse under #ifdef BERK (I really HATE this)''
  1.1586 +by Rose and
  1.1587 +``Lists messages in reverse order with the `\-reverse' switch.
  1.1588 +This should be considered a bug.'' by Romine in the documentation.
  1.1589 +The question remains why neither Rose and Romine had fixed this
  1.1590 +bug in the Eighties when they wrote these comments nor has anyone
  1.1591 +thereafter.
  1.1592 +
  1.1593 +
  1.1594 +.ig
  1.1595 +
  1.1596 +forw: [no]dashstuffing(mhl)
  1.1597 +
  1.1598 +mhshow: [no]pause [no]serialonly
  1.1599 +
  1.1600 +mhmail: resent queued
  1.1601 +inc: snoop, (pop)
  1.1602 +
  1.1603 +mhl: [no]faceproc folder sleep
  1.1604 +	[no]dashstuffing(forw) digest list volume number issue number
  1.1605 +
  1.1606 +prompter: [no]doteof
  1.1607 +
  1.1608 +refile: [no]preserve [no]unlink [no]rmmproc
  1.1609 +
  1.1610 +send: [no]forward [no]mime [no]msgid
  1.1611 +	[no]push split [no]unique (sasl) width snoop [no]dashstuffing
  1.1612 +	attach attachformat
  1.1613 +whatnow: (noedit) attach
  1.1614 +
  1.1615 +slocal: [no]suppressdups
  1.1616 +
  1.1617 +spost: [no]filter [no]backup width [no]push idanno
  1.1618 +	[no]check(whom) whom(whom)
  1.1619 +
  1.1620 +whom: ???
  1.1621 +
  1.1622 +..
  1.1623 +
  1.1624 +
  1.1625 +.ig
  1.1626 +
  1.1627 +.P
  1.1628 +In the best case, all switches are unambiguous on the first character,
  1.1629 +or on the three-letter prefix for the `no' variants.
  1.1630 +Reducing switch prefix collisions, shortens the necessary prefix length
  1.1631 +the user must type.
  1.1632 +Having less switches helps best.
  1.1633 +
  1.1634 +..
  1.1635 +
  1.1636 +
  1.1637 +.\" XXX: whatnow prompt commands
  1.1638 +
  1.1639 +
  1.1640 +
  1.1641 +
  1.1642 +.H1 "Modernizing
  1.1643 +.P
  1.1644 +The code base of mmh originates from the late Seventies.
  1.1645 +Through the Eighties, extensive work had been done on it.
  1.1646 +In the Nineties, it had been partly reorganized and extended.
  1.1647 +Relicts from each decade have gathered in the code base.
  1.1648 +My goal was to modernize the code base.
  1.1649 +
  1.1650 +.P
  1.1651 +FIXME functional aspect only here
  1.1652 +.P
  1.1653 +FIXME ref to `code style' for non-functional aspects.
  1.1654 +
  1.1655 +
  1.1656 +.H2 "Code Relicts
  1.1657 +.P
  1.1658 +My position to drop obsolete functionality of mmh to remove old code
  1.1659 +is much more revolutional than the nmh community likes to have it.
  1.1660 +Working on an experimental version, I was able to quickly drop
  1.1661 +functionality I considered ancient.
  1.1662 +The need for consensus with peers would have slowed this process down.
  1.1663 +Without the need to justify my decisions, I was able to rush forward.
  1.1664 +In Dezember 2011, Paul Vixie motivated the nmh developers to just
  1.1665 +do the work:
  1.1666 +.[
  1.1667 +paul vixie edginess nmh-workers
  1.1668 +.]
  1.1669 +.QS
  1.1670 +let's stop walking on egg shells with this code base. there's no need to
  1.1671 +discuss whether to keep using vfork, just note in [sic!] passing, [...]
  1.1672 +we don't need a separate branch for removing vmh
  1.1673 +or ridding ourselves of #ifdef's or removing posix replacement functions
  1.1674 +or depending on pure ansi/posix "libc".
  1.1675 +.QP
  1.1676 +these things should each be a day or two of work and the "main branch"
  1.1677 +should just be modern. [...]
  1.1678 +let's push forward, aggressively.
  1.1679 +.QE
  1.1680 +.LP
  1.1681 +I did so already in the months before.
  1.1682 +I pushed forward.
  1.1683 +I simply dropped the cruft.
  1.1684 +.P
  1.1685 +The decision to drop a feature was based on literature research and
  1.1686 +careful thinking, but whether having had contact to this particular
  1.1687 +feature within my own computer life served as a rule of thumb.
  1.1688 +My reasons are always made clean in the commit message for the
  1.1689 +version control system.
  1.1690 +Hence, others can comprehend my view and argue for undoing the change
  1.1691 +if I have missed an important aspect.
  1.1692 +
  1.1693 +
  1.1694 +.U3 "Forking
  1.1695 +.P
  1.1696 +In being a tool chest, MH creates many processes.
  1.1697 +In earlier times
  1.1698 +.Fu fork()
  1.1699 +had been an expensive system call, because the process's image needed
  1.1700 +to be duplicated completely at once.
  1.1701 +This was especially painfull in the common case when the image gets
  1.1702 +replaced by a call to
  1.1703 +.Fu exec()
  1.1704 +right after having forked the child process.
  1.1705 +The
  1.1706 +.Fu vfork()
  1.1707 +system call was invented to speed up this particular case.
  1.1708 +It completely omits the duplication of the image.
  1.1709 +On old systems this resulted in significant speed ups.
  1.1710 +Therefore MH used
  1.1711 +.Fu vfork()
  1.1712 +whenever possible.
  1.1713 +.P
  1.1714 +Modern memory management units support copy-on-write semantics, which make
  1.1715 +.Fu fork()
  1.1716 +almost as fast as
  1.1717 +.Fu vfork() .
  1.1718 +The man page of
  1.1719 +.Mp vfork (2)
  1.1720 +in FreeBSD 8.0 states:
  1.1721 +.QS
  1.1722 +This system call will be eliminated when proper system sharing mechanisms
  1.1723 +are implemented. Users should not depend on the memory sharing semantics
  1.1724 +of vfork() as it will, in that case, be made synonymous to fork(2).
  1.1725 +.QE
  1.1726 +.LP
  1.1727 +Vixie supports the removal with the note that ``the last
  1.1728 +system on which fork was so slow that an mh user would notice it, was
  1.1729 +Eunice. that was 1987''.
  1.1730 +.[
  1.1731 +nmh-workers vixie edginess
  1.1732 +.]
  1.1733 +I replaced all calls to
  1.1734 +.Fu vfork()
  1.1735 +with calls to
  1.1736 +.Fu fork() .
  1.1737 +.P
  1.1738 +Related to the costs of
  1.1739 +.Fu fork()
  1.1740 +is the probability of its success.
  1.1741 +In the Eighties on heavy loaded systems, calls to
  1.1742 +.Fu fork()
  1.1743 +were prone to failure.
  1.1744 +Hence, many of the
  1.1745 +.Fu fork()
  1.1746 +calls in the code were wrapped into loops to retry the
  1.1747 +.Fu fork()
  1.1748 +several times, for higher changes to succeed, eventually.
  1.1749 +On modern systems, failing calls to
  1.1750 +.Fu fork()
  1.1751 +are unusual.
  1.1752 +Hence, in the rare case when
  1.1753 +.Fu fork()
  1.1754 +fails, mmh programs simply abort.
  1.1755 +
  1.1756 +
  1.1757 +.U3 "Obsolete Header Fields
  1.1758 +.BU
  1.1759 +The
  1.1760 +.Hd Encrypted
  1.1761 +header field was introduced by RFC\|822,
  1.1762 +but already marked legacy in RFC\|2822.
  1.1763 +OpenPGP provides the basis for standardized exchange of encrypted
  1.1764 +messages [RFC\|4880, RFC\|3156].
  1.1765 +The support for
  1.1766 +.Hd Encrypted
  1.1767 +header fields is removed in mmh.
  1.1768 +.BU
  1.1769 +Native support for
  1.1770 +.Hd Face
  1.1771 +header fields has been removed, as well.
  1.1772 +This feature is similar to the
  1.1773 +.Hd X-Face
  1.1774 +header field in its intent,
  1.1775 +but takes a different approach to store the image.
  1.1776 +Instead of encoding the image data directly into the header field,
  1.1777 +the it contains the hostname and UDP port where the image
  1.1778 +date could be retrieved.
  1.1779 +There is even a third system, invented in 2005.
  1.1780 +Although it re-uses the
  1.1781 +.Hd Face
  1.1782 +header field, it is the successor of
  1.1783 +.Hd X-Face
  1.1784 +with support for colored PNG images.
  1.1785 +None of the Face systems described here is popular today.
  1.1786 +Hence, mmh has no direct support for them.
  1.1787 +.BU
  1.1788 +The
  1.1789 +.Hd Content-MD5
  1.1790 +header field was introduced by RFC\|1864.
  1.1791 +It provides detection of data corruption during the transfer.
  1.1792 +But it can not ensure verbatim end-to-end delivery of the contents
  1.1793 +[RFC\|1864].
  1.1794 +The proper approach to verify content integrity in an
  1.1795 +end-to-end relationship is the use of digital cryptography.
  1.1796 +.\" XXX (RFCs FIXME).
  1.1797 +On the other hand, transfer protocols should detect corruption during
  1.1798 +each transmission. The TCP includes a checksum field therefore.
  1.1799 +These two approaches in combinations render the
  1.1800 +.Hd Content-MD5
  1.1801 +header field superfluous.
  1.1802 +The nmh-workers mailing list archive contains about 4\|200 messages,
  1.1803 +ranging from 1992 until today.
  1.1804 +Not a single one had a
  1.1805 +.Hd Content-MD5
  1.1806 +header field.
  1.1807 +Neither did any of the 60\|000 messages in my personal mail storage.
  1.1808 +Removing the support for this header field,
  1.1809 +removed the last place where MD5 computation was needed.
  1.1810 +Hence, the MD5 code could be removed as well.
  1.1811 +Over 500 lines of code vanished by this one change.
  1.1812 +
  1.1813 +
  1.1814 +.U3 "MMDF maildrop support
  1.1815 +.P
  1.1816 +This type of format is conceptionally similar to the mbox format,
  1.1817 +but uses a different message delimiter (`\fL^A^A^A^A\fP' instead of
  1.1818 +`\fLFrom\0\fP').
  1.1819 +Mbox is the de-facto standard maildrop format on Unix,
  1.1820 +whereas the MMDF maildrop format is hardly still known today.
  1.1821 +I did drop MMDF maildrop format support.
  1.1822 +.P
  1.1823 +The simplifications within the code were only moderate.
  1.1824 +Switches could be removed from
  1.1825 +.L packf
  1.1826 +and
  1.1827 +.L rcvpack ,
  1.1828 +which generate packed mailboxes.
  1.1829 +Only one packed mailbox format remained: mbox.
  1.1830 +The more important changes affected the equally named mail parsing
  1.1831 +routine in
  1.1832 +.Fn sbr/m_getfld.c .
  1.1833 +The MMDF code had been removed there, but as now only one packed mailbox
  1.1834 +format is left, further code structure simplifications may be possible.
  1.1835 +I have not worked on them yet because
  1.1836 +.Fu m_getfld()
  1.1837 +is heavily optimized and thus dangerous to touch.
  1.1838 +The risk of damaging the intricate workings of the optimized code is
  1.1839 +too high.
  1.1840 +.\" XXX: move somewhere else
  1.1841 +This problem is know to the developers of nmh, too.
  1.1842 +They also avoid touching this minefield if possible.
  1.1843 +
  1.1844 +
  1.1845 +.U3 "Prompter's Control Keys
  1.1846 +.P
  1.1847 +The program
  1.1848 +.Pn prompter
  1.1849 +queries the user to fill in a message form.
  1.1850 +When used by
  1.1851 +.Pn comp
  1.1852 +as
  1.1853 +.Cl "comp -editor prompter" ,
  1.1854 +the resulting behavior is similar to
  1.1855 +.Pn mailx .
  1.1856 +Apparently,
  1.1857 +.Pn prompter
  1.1858 +hadn't been touched lately.
  1.1859 +Otherwise it's hardly explainable why it
  1.1860 +still offered the switches
  1.1861 +.Sw -erase
  1.1862 +.Ar chr
  1.1863 +and
  1.1864 +.Sw -kill
  1.1865 +.Ar chr
  1.1866 +to name the characters for command line editing.
  1.1867 +The times when this had been necessary are long time gone.
  1.1868 +Today these things work out-of-the-box, and if not, are configured
  1.1869 +with the standard tool
  1.1870 +.Pn stty .
  1.1871 +The switches are removed now
  1.1872 +.Ci 0bd9750710cdbab80cfb4036dd87af20afe1552f .
  1.1873 +
  1.1874 +
  1.1875 +.U3 "Hardcopy terminal support
  1.1876 +.P
  1.1877 +More of a funny anecdote is a check for printing to a
  1.1878 +hardcopy terminal that remained in the code until Spring 2012,
  1.1879 +when I finally removed it
  1.1880 +.Ci b7764c4a6b71d37918a97594d866258f154017ca .
  1.1881 +I surely would be very happy to see such a terminal in action,
  1.1882 +maybe actually being able to work on it, but I fear my chances are null.
  1.1883 +.P
  1.1884 +The check only prevented a pager to be placed between the outputting
  1.1885 +program (\c
  1.1886 +.Pn mhl )
  1.1887 +and the terminal.
  1.1888 +In nmh, this could have been ensured with the
  1.1889 +.Sw -nomoreproc
  1.1890 +at the command line statically, too.
  1.1891 +In mmh, set the profile entry
  1.1892 +.Pe Pager
  1.1893 +or the environment variable
  1.1894 +.Ev PAGER
  1.1895 +to
  1.1896 +.Pn cat .
  1.1897 +
  1.1898 +
  1.1899 +
  1.1900 +
  1.1901 +.H2 "Attachments
  1.1902 +.P
  1.1903 +The mind model of email attachments is unrelated to MIME.
  1.1904 +Although the MIME RFCs (2045 through 2049) define the technical
  1.1905 +requirements for having attachments, they do not mention the the word
  1.1906 +``attachment''.
  1.1907 +Instead of attachments, MIME talks about ``multi-part message bodies''
  1.1908 +[RFC\|2045], a more general concept.
  1.1909 +Multi-part messages are messages
  1.1910 +``in which one or more different
  1.1911 +sets of data are combined in a single body''
  1.1912 +[RFC\|2046].
  1.1913 +MIME keeps its descriptions generic;
  1.1914 +it does not imply specific usage models.
  1.1915 +In email one usage model became prevalent: attachments.
  1.1916 +The idea is having a main text document with files of arbitrary kind
  1.1917 +attached to it.
  1.1918 +In MIME terms, this is a multi-part message having a text part first
  1.1919 +and parts of arbitray type following.
  1.1920 +.P
  1.1921 +MH's MIME support is a direct implementation of the RFCs.
  1.1922 +The perception of the topic described in the RFCs is clearly visible
  1.1923 +in MH's implementation.
  1.1924 +Thus, MH had all the MIME features but no idea of attachments.
  1.1925 +Today, however, users don't need all the MIME features but they want
  1.1926 +convenient attachment handling.
  1.1927 +
  1.1928 +.U3 "Composing MIME Messages
  1.1929 +.P
  1.1930 +In order to improve the situation on the message composing side,
  1.1931 +Jon Steinhart had added an attachment system to nmh in 2002.
  1.1932 +.Ci 7480dbc14bc90f2d872d434205c0784704213252
  1.1933 +In the file
  1.1934 +.Fn docs/README-ATTACHMENTS ,
  1.1935 +he described his motivation to do so as such:
  1.1936 +.QS
  1.1937 +Although nmh contains the necessary functionality for MIME message handing,
  1.1938 +the interface to this functionality is pretty obtuse.
  1.1939 +There's no way that I'm ever going to convince my partner to write
  1.1940 +.Pn mhbuild
  1.1941 +composition files!
  1.1942 +.QE
  1.1943 +.LP
  1.1944 +With this change, the mind model of attachments entered nmh.
  1.1945 +In the same document:
  1.1946 +.QS
  1.1947 +These changes simplify the task of managing attachments on draft files.
  1.1948 +They allow attachments to be added, listed, and deleted.
  1.1949 +MIME messages are automatically created when drafts with attachments
  1.1950 +are sent.
  1.1951 +.QE
  1.1952 +.LP
  1.1953 +Unfortunately, the attachment system,
  1.1954 +like any new facilities in nmh,
  1.1955 +was deactive by default.
  1.1956 +.P
  1.1957 +During my work in Argentina, I tried to improve the attachment system.
  1.1958 +But, because of great opposition in the nmh community,
  1.1959 +my patch died as a proposal on the mailing list, after long discussions.
  1.1960 +.[
  1.1961 +nmh-workers attachment proposal
  1.1962 +.]
  1.1963 +In Januar 2012, I extended the patch and applied it to mmh.
  1.1964 +.Ci 8ff284ff9167eff8f5349481529332d59ed913b1
  1.1965 +In mmh, the attachment system is active by default.
  1.1966 +Instead of command line switches, the
  1.1967 +.Pe Attachment-Header
  1.1968 +profile entry is used to specify
  1.1969 +the name of the attachment header field.
  1.1970 +It is pre-defined to
  1.1971 +.Hd Attach .
  1.1972 +.P
  1.1973 +To add an attachment to a draft, simply add an attachment header:
  1.1974 +.VS
  1.1975 +To: bob
  1.1976 +Subject: The file you wanted
  1.1977 +Attach: /path/to/the/file-bob-wanted
  1.1978 +--------
  1.1979 +Here it is.
  1.1980 +VE
  1.1981 +The header field can be added to the draft manually in the editor,
  1.1982 +or by using the `attach' command at the WhatNow prompt, or
  1.1983 +non-interactively with
  1.1984 +.Pn anno :
  1.1985 +.VS
  1.1986 +anno -append -nodate -component Attach -text /path/to/attachment
  1.1987 +VE
  1.1988 +Drafts with attachment headers are converted to MIME automatically by
  1.1989 +.Pn send .
  1.1990 +The conversion to MIME is invisible to the user.
  1.1991 +The draft stored in the draft folder is always in source form, with
  1.1992 +attachment headers.
  1.1993 +If the MIMEification fails, for instance because the file to attach
  1.1994 +is not accessible, the original draft is not changed.
  1.1995 +.P
  1.1996 +The attachment system handles the forwarding of messages, too.
  1.1997 +If the attachment header value starts with a plus character (`+'),
  1.1998 +like in
  1.1999 +.Cl "Attach: +bob 30 42" ,
  1.2000 +The given messages in the specified folder will be attached.
  1.2001 +This allowed to simplify
  1.2002 +.Pn forw .
  1.2003 +.Ci f41f04cf4ceca7355232cf7413e59afafccc9550
  1.2004 +.P
  1.2005 +Closely related to attachments is non-ASCII text content,
  1.2006 +because it requires MIME too.
  1.2007 +In nmh, the user needed to call `mime' at the WhatNow prompt
  1.2008 +to have the draft converted to MIME.
  1.2009 +This was necessary whenever the draft contained non-ASCII characters.
  1.2010 +If the user did not call `mime', a broken message would be sent.
  1.2011 +Therefore, the
  1.2012 +.Pe automimeproc
  1.2013 +profile entry could be specified to have the `mime' command invoked
  1.2014 +automatically each time.
  1.2015 +Unfortunately, this approach conflicted with with attachment system
  1.2016 +because the draft would already be in MIME format at the time
  1.2017 +when the attachment system wanted to MIMEify it.
  1.2018 +To use nmh's attachment system, `mime' must not be called at the
  1.2019 +WhatNow prompt and
  1.2020 +.Pe automimeproc
  1.2021 +must not be set in the profile.
  1.2022 +But then the case of non-ASCII text without attachment headers was
  1.2023 +not caught.
  1.2024 +All in all, the solution was complex and irritating.
  1.2025 +My patch from December 2010 would have simplified the situation.
  1.2026 +.P
  1.2027 +Mmh's current solution is even more elaborate.
  1.2028 +Any necessary MIMEification is done automatically.
  1.2029 +There is no `mime' command at the WhatNow prompt anymore.
  1.2030 +The draft will be converted automatically to MIME when either an
  1.2031 +attachment header or non-ASCII text is present.
  1.2032 +Further more, the special meaning of the hash character (`#')
  1.2033 +at line beginnings in the draft message is removed.
  1.2034 +Users need not at all deal with the whole topic.
  1.2035 +.P
  1.2036 +Although the new approach does not anymore support arbitrary MIME
  1.2037 +compositions directly, the full power of
  1.2038 +.Pn mhbuild
  1.2039 +can still be accessed.
  1.2040 +Given no attachment headers are included, the user can create
  1.2041 +.Pn mhbuild
  1.2042 +composition drafts like in nmh.
  1.2043 +Then, at the WhatNow prompt, he needs to invoke
  1.2044 +.Cl "edit mhbuild
  1.2045 +to convert it to MIME.
  1.2046 +Because the resulting draft does neither contain non-aASCII characters
  1.2047 +nor has it attachment headers, the attachment system will not touch it.
  1.2048 +.P
  1.2049 +The approach taken in mmh is taylored towards todays most common case:
  1.2050 +a text part with possibly attachments.
  1.2051 +This case is simplified a lot for users.
  1.2052 +
  1.2053 +.U3 "MIME Type Guessing
  1.2054 +.P
  1.2055 +The use of
  1.2056 +.Pn mhbuild
  1.2057 +composition drafts had one notable advantage over attachment headers
  1.2058 +from the programmer's point of view: The user provides the appropriate
  1.2059 +MIME types for files to include.
  1.2060 +The attachment system needs to find out the correct MIME type itself.
  1.2061 +This is a difficult task, yet it spares the user irritating work.
  1.2062 +Determining the correct MIME type of content is partly mechanical,
  1.2063 +partly intelligent work.
  1.2064 +Forcing the user to find out the correct MIME type,
  1.2065 +forces him to do partly mechanical work.
  1.2066 +Letting the computer do the work, can lead to bad choices for difficult
  1.2067 +content.
  1.2068 +For mmh, the latter option was chosen.
  1.2069 +.P
  1.2070 +Determining the MIME type by the suffix of the file name is a dumb
  1.2071 +approach, yet it is simple to implement and provides good results
  1.2072 +for the common cases.
  1.2073 +Mmh implements this approach in the
  1.2074 +.Pn print-mimetype
  1.2075 +script.
  1.2076 +Using it is the default choice.
  1.2077 +.P
  1.2078 +A far better but less portable approach is the use of
  1.2079 +.Pn file .
  1.2080 +This standard tool tries to determine the type of files.
  1.2081 +Unfortunately, its capabilities and accuracy varies from system to system.
  1.2082 +Additionally, its output was only intended for human beings,
  1.2083 +but not to be used by programs.
  1.2084 +It varies much.
  1.2085 +Nevertheless, modern versions of GNU
  1.2086 +.Pn file ,
  1.2087 +which is prevalent on the popular GNU/Linux systems,
  1.2088 +provides MIME type output in machine-readable form.
  1.2089 +Although this solution is highly system-dependent,
  1.2090 +it solves the difficult problem well.
  1.2091 +On systems where GNU
  1.2092 +.Pn file ,
  1.2093 +version 5.04 or higher, is available it should be used.
  1.2094 +One needs to specify the following profile entry to do so:
  1.2095 +.VS
  1.2096 +Mime-Type-Query: file -b --mime
  1.2097 +VE
  1.2098 +.LP
  1.2099 +Other versions of
  1.2100 +.Pn file
  1.2101 +might possibly be usable with wrapper scripts to reformat the output.
  1.2102 +The diversity among
  1.2103 +.Pn file
  1.2104 +implementations is great; one needs to check the local variant.
  1.2105 +.P
  1.2106 +If no MIME type can be determined, text content gets sent as
  1.2107 +`text/plain' and anything else under the generic fall-back type
  1.2108 +`application/octet-stream'.
  1.2109 +It is not possible in mmh to override the automatic MIME type guessing
  1.2110 +for a specific file.
  1.2111 +To do so, the user would need to know in advance for which file
  1.2112 +the automatic guessing does fail, or the system would require interaction.
  1.2113 +I consider both cases impractical.
  1.2114 +The existing solution should be sufficient.
  1.2115 +If not, the user may always fall back to
  1.2116 +.Pn mhbuild
  1.2117 +composition drafts and ignore the attachment system.
  1.2118 +
  1.2119 +
  1.2120 +.U3 "Storing Attachments
  1.2121 +.P
  1.2122 +FIXME
  1.2123 +
  1.2124 +
  1.2125 +.U3 "Showing MIME Messages
  1.2126 +.P
  1.2127 +FIXME
  1.2128 +
  1.2129 +
  1.2130 +
  1.2131 +.H2 "Digital Cryptography
  1.2132 +.P
  1.2133 +Signing and encryption.
  1.2134 +
  1.2135 +
  1.2136 +
  1.2137 +.H2 "Modern Defaults
  1.2138 +.P
  1.2139 +Just to give one example, for me it took one year of using nmh
  1.2140 +before I became aware of the existence of the attachment system.
  1.2141 +One could argue that this fact disqualifies my reading of the
  1.2142 +documentation.
  1.2143 +If I would have installed nmh from source back then, I could agree.
  1.2144 +Yet I had used a prepackaged version and had expected that it would
  1.2145 +just work.
  1.2146 +
  1.2147 +
  1.2148 +
  1.2149 +.H1 "Code Style
  1.2150 +.P
  1.2151 +foo
  1.2152 +
  1.2153 +
  1.2154 +.H2 "Standard Code
  1.2155 +.P
  1.2156 +POSIX
  1.2157 +
  1.2158 +.U3 "Converting to Standard Code
  1.2159 +.P
  1.2160 +One part of this task was converting obsolete code constructs
  1.2161 +to standard constructs.
  1.2162 +As I'm not even thirty years old and have no more than seven years of
  1.2163 +Unix experience, I needed to learn about the history in retrospective.
  1.2164 +Older people likely have used those ancient constructs themselves
  1.2165 +and have suffered from their incompatibilities and have longed for
  1.2166 +standardization.
  1.2167 +Unfortunately, I have only read that others had done so.
  1.2168 +This put me in a much more difficult positions when working on the old
  1.2169 +code.
  1.2170 +I needed to recherche what other would have known by heart from
  1.2171 +experience.
  1.2172 +All my programming experience comes from a time past ANSI C
  1.2173 +and past POSIX.
  1.2174 +Although I knew about the times before, I took the
  1.2175 +current state implicitly for granted most of the time.
  1.2176 +.P
  1.2177 +Being aware of
  1.2178 +these facts, I rather let people with more historic experience solve the 
  1.2179 +task of converting the ancient code constructs to standardized ones.
  1.2180 +Luckily, Lyndon Nerenberg focused on this task at the nmh project.
  1.2181 +He converted large parts of the code to POSIX constructs, removing
  1.2182 +the conditionals compilation for now standardized features.
  1.2183 +I'm thankful for this task being solved.
  1.2184 +I only pulled the changes into
  1.2185 +mmh.
  1.2186 +
  1.2187 +
  1.2188 +
  1.2189 +
  1.2190 +.H2 "Separation
  1.2191 +
  1.2192 +.U2 "MH Directory Split
  1.2193 +.P
  1.2194 +In MH and nmh, a personal setup had consisted of two parts:
  1.2195 +The MH profile, named
  1.2196 +.Fn \&.mh_profile
  1.2197 +and being located directly in the user's home directory.
  1.2198 +And the MH directory, where all his mail messages and also his personal
  1.2199 +forms, scan formats, other configuration files are stored.
  1.2200 +The location
  1.2201 +of this directory could be user-chosen.
  1.2202 +The default was to name it
  1.2203 +.Fn Mail
  1.2204 +and have it directly in the home directory.
  1.2205 +.P
  1.2206 +I've never liked the data storage and the configuration to be intermixed.
  1.2207 +They are different kinds of data.
  1.2208 +One part, are the messages,
  1.2209 +which are the data to operate on.
  1.2210 +The other part, are the personal
  1.2211 +configuration files, which are able to change the behavior of the operations.
  1.2212 +The actual operations are defined in the profile, however.
  1.2213 +.P
  1.2214 +When storing data, one should try to group data by its type.
  1.2215 +There's sense in the Unix file system hierarchy, where configuration
  1.2216 +file are stored separate (\c
  1.2217 +.Fn /etc )
  1.2218 +to the programs (\c
  1.2219 +.Fn /bin
  1.2220 +and
  1.2221 +.Fn /usr/bin )
  1.2222 +to their sources (\c
  1.2223 +.Fn /usr/src ).
  1.2224 +Such separation eases the backup management, for instance.
  1.2225 +.P
  1.2226 +In mmh, I've reorganized the file locations.
  1.2227 +Still there are two places:
  1.2228 +There's the mail storage directory, which, like in MH, contains all the
  1.2229 +messages, but, unlike in MH, nothing else.
  1.2230 +Its location still is user-chosen, with the default name
  1.2231 +.Fn Mail ,
  1.2232 +in the user's home directory.
  1.2233 +This is much similar to the case in nmh.
  1.2234 +The configuration files, however, are grouped together in the new directory
  1.2235 +.Fn \&.mmh
  1.2236 +in the user's home directory.
  1.2237 +The user's profile now is a file, named
  1.2238 +.Fn profile ,
  1.2239 +in this mmh directory.
  1.2240 +Consistently, the context file and all the personal forms, scan formats,
  1.2241 +and the like, are also there.
  1.2242 +.P
  1.2243 +The naming changed with the relocation.
  1.2244 +The directory where everything, except the profile, had been stored (\c
  1.2245 +.Fn $HOME/Mail ),
  1.2246 +used to be called \fIMH directory\fP.
  1.2247 +Now, this directory is called the
  1.2248 +user's \fImail storage\fP.
  1.2249 +The name \fImmh directory\fP is now given to
  1.2250 +the new directory
  1.2251 +(\c
  1.2252 +.Fn $HOME/.mmh ),
  1.2253 +containing all the personal configuration files.
  1.2254 +.P
  1.2255 +The separation of the files by type of content is logical and convenient.
  1.2256 +There are no functional differences as any possible setup known to me
  1.2257 +can be implemented with both approaches, although likely a bit easier
  1.2258 +with the new approach.
  1.2259 +The main goal of the change had been to provide
  1.2260 +sensible storage locations for any type of personal mmh file.
  1.2261 +.P
  1.2262 +In order for one user to have multiple MH setups, he can use the
  1.2263 +environment variable
  1.2264 +.Ev MH
  1.2265 +the point to a different profile file.
  1.2266 +The MH directory (mail storage plus personal configuration files) is
  1.2267 +defined by the
  1.2268 +.Pe Path
  1.2269 +profile entry.
  1.2270 +The context file could be defined by the
  1.2271 +.Pe context
  1.2272 +profile entry or by the
  1.2273 +.Ev MHCONTEXT
  1.2274 +environment variable.
  1.2275 +The latter is useful to have a distinct context (e.g. current folders)
  1.2276 +in each terminal window, for instance.
  1.2277 +In mmh, there are three environment variables now.
  1.2278 +.Ev MMH
  1.2279 +may be used to change the location of the mmh directory.
  1.2280 +.Ev MMHP
  1.2281 +and
  1.2282 +.Ev MMHC
  1.2283 +change the profile and context files, respectively.
  1.2284 +Besides providing a more consistent feel (which simply is the result
  1.2285 +of being designed anew), the set of personal configuration files can
  1.2286 +be chosen independently from the profile (including mail storage location)
  1.2287 +and context, now.
  1.2288 +Being it relevant for practical use or not, it
  1.2289 +de-facto is an improvement.
  1.2290 +However, the main achievement is the
  1.2291 +split between mail storage and personal configuration files.
  1.2292 +
  1.2293 +
  1.2294 +.H2 "Modularization
  1.2295 +.P
  1.2296 +whatnowproc
  1.2297 +.P
  1.2298 +The \fIMH library\fP
  1.2299 +.Fn libmh.a
  1.2300 +collects a bunch of standard functions that many of the MH tools need,
  1.2301 +like reading the profile or context files.
  1.2302 +This doesn't hurt the separation.
  1.2303 +
  1.2304 +
  1.2305 +.H2 "Style
  1.2306 +.P
  1.2307 +Code layout, goto, ...
  1.2308 +
  1.2309 +.P
  1.2310 +anno rework
  1.2311 +
  1.2312 +
  1.2313 +
  1.2314 +
  1.2315 +.H1 "Concept Exploitation/Homogeneity
  1.2316 +
  1.2317 +
  1.2318 +.H2 "Draft Folder
  1.2319 +.P
  1.2320 +Historically, MH provided exactly one draft message, named
  1.2321 +.Fn draft
  1.2322 +and
  1.2323 +being located in the MH directory.
  1.2324 +When starting to compose another message
  1.2325 +before the former one was sent, the user had been questioned whether to use,
  1.2326 +refile or replace the old draft.
  1.2327 +Working on multiple drafts at the same time
  1.2328 +was impossible.
  1.2329 +One could only work on them in alteration by refiling the
  1.2330 +previous one to some directory and fetching some other one for reediting.
  1.2331 +This manual draft management needed to be done each time the user wanted
  1.2332 +to switch between editing one draft to editing another.
  1.2333 +.P
  1.2334 +To allow true parallel editing of drafts, in a straight forward way, the
  1.2335 +draft folder facility exists.
  1.2336 +It had been introduced already in July 1984
  1.2337 +by Marshall T. Rose.
  1.2338 +The facility was deactivated by default.
  1.2339 +Even in nmh, the draft folder facility remained deactivated by default.
  1.2340 +At least, Richard Coleman added the man page
  1.2341 +.Mp mh-draft(5)
  1.2342 +to document
  1.2343 +the feature well.
  1.2344 +.P
  1.2345 +The only advantage of not using the draft folder facility is the static
  1.2346 +name of the draft file.
  1.2347 +This could be an issue for MH front-ends like mh-e.
  1.2348 +But as they likely want to provide working on multiple drafts in parallel,
  1.2349 +the issue is only concerning compatibility.
  1.2350 +The aim of nmh to stay compatible
  1.2351 +prevented the default activation of the draft folder facility.
  1.2352 +.P
  1.2353 +On the other hand, a draft folder is the much more natural concept than
  1.2354 +a draft message.
  1.2355 +MH's mail storage consists of folders and messages,
  1.2356 +the messages named with ascending numbers.
  1.2357 +A draft message breaks with this
  1.2358 +concept by introducing a message in a file named
  1.2359 +.Fn draft .
  1.2360 +This draft
  1.2361 +message is special.
  1.2362 +It can not be simply listed with the available tools,
  1.2363 +but instead requires special switches.
  1.2364 +I.e. corner-cases were
  1.2365 +introduced.
  1.2366 +A draft folder, in contrast, does not introduce such
  1.2367 +corner-cases.
  1.2368 +The available tools can operate on the messages within that
  1.2369 +folder like on any messages within any mail folders.
  1.2370 +The only difference
  1.2371 +is the fact that the default folder for
  1.2372 +.Pn send
  1.2373 +is the draft folder,
  1.2374 +instead of the current folder, like for all other tools.
  1.2375 +.P
  1.2376 +The trivial part of the change was activating the draft folder facility
  1.2377 +by default and setting a default name for this folder.
  1.2378 +Obviously, I chose
  1.2379 +the name
  1.2380 +.Fn +drafts .
  1.2381 +This made the
  1.2382 +.Sw -draftfolder
  1.2383 +and
  1.2384 +.Sw -draftmessage
  1.2385 +switches useless, and I could remove them.
  1.2386 +The more difficult but also the part that showed the real improvement,
  1.2387 +was updating the tools to the new concept.
  1.2388 +.Sw -draft
  1.2389 +switches could
  1.2390 +be dropped, as operating on a draft message became indistinguishable to
  1.2391 +operating on any other message for the tools.
  1.2392 +.Pn comp
  1.2393 +still has its
  1.2394 +.Sw -use
  1.2395 +switch for switching between its two modes: (1) Compose a new
  1.2396 +draft, possibly by taking some existing message as a form.
  1.2397 +(2) Modify
  1.2398 +an existing draft.
  1.2399 +In either case, the behavior of
  1.2400 +.Pn comp is
  1.2401 +deterministic.
  1.2402 +There is no more need to query the user.
  1.2403 +I consider this
  1.2404 +a major improvement.
  1.2405 +By making
  1.2406 +.Pn send
  1.2407 +simply operate on the current
  1.2408 +message in the draft folder by default, with message and folder both
  1.2409 +overridable by specifying them on the command line, it is now possible
  1.2410 +to send a draft anywhere within the storage by simply specifying its folder
  1.2411 +and name.
  1.2412 +.P
  1.2413 +All theses changes converted special cases to regular cases, thus
  1.2414 +simplifying the tools and increasing the flexibility.
  1.2415 +
  1.2416 +
  1.2417 +.H2 "Trash Folder
  1.2418 +.P
  1.2419 +Similar to the situation for drafts is the situation for removed messages.
  1.2420 +Historically, a message was deleted by renaming.
  1.2421 +A specific
  1.2422 +\fIbackup prefix\fP, often comma (\c
  1.2423 +.Fn , )
  1.2424 +or hash (\c
  1.2425 +.Fn # ),
  1.2426 +being prepended to the file name.
  1.2427 +Thus, MH wouldn't recognize the file
  1.2428 +as a message anymore, as only files whose name consists of digits only
  1.2429 +are treated as messages.
  1.2430 +The removed messages remained as files in the
  1.2431 +same directory and needed some maintenance job to truly delete them after
  1.2432 +some grace time.
  1.2433 +Usually, by running a command similar to
  1.2434 +.VS
  1.2435 +find /home/user/Mail -ctime +7 -name ',*' | xargs rm
  1.2436 +VE
  1.2437 +in a cron job.
  1.2438 +Within the grace time interval
  1.2439 +the original message could be restored by stripping the
  1.2440 +the backup prefix from the file name.
  1.2441 +If however, the last message of
  1.2442 +a folder is been removed \(en say message
  1.2443 +.Fn 6
  1.2444 +becomes file
  1.2445 +.Fn ,6
  1.2446 +\(en and a new message enters the same folder, thus the same
  1.2447 +numbered being given again \(en in our case
  1.2448 +.Fn 6
  1.2449 +\(en, if that one
  1.2450 +is removed too, then the backup of the former message gets overwritten.
  1.2451 +Thus, the ability to restore removed messages does not only depend on
  1.2452 +the ``sweeping cron job'' but also on the removing of further messages.
  1.2453 +This is undesirable, because the real mechanism is hidden from the user
  1.2454 +and the consequences of further removals are not always obvious.
  1.2455 +Further more, the backup files are scattered within the whole mail
  1.2456 +storage, instead of being collected at one place.
  1.2457 +.P
  1.2458 +To improve the situation, the profile entry
  1.2459 +.Pe rmmproc
  1.2460 +(previously named
  1.2461 +.Pe Delete-Prog )
  1.2462 +was introduced, very early.
  1.2463 +It could be set to any command, which would care for the mail removal
  1.2464 +instead of taking the default action, described above.
  1.2465 +Refiling the to-be-removed files to some garbage folder was a common
  1.2466 +example.
  1.2467 +Nmh's man page
  1.2468 +.Mp rmm(1)
  1.2469 +proposes
  1.2470 +.Cl "refile +d
  1.2471 +to move messages to the garbage folder and
  1.2472 +.Cl "rm `mhpath +d all`
  1.2473 +the empty the garbage folder.
  1.2474 +Managing the message removal this way is a sane approach.
  1.2475 +It keeps
  1.2476 +the removed messages in one place, makes it easy to remove the backup
  1.2477 +files, and, most important, enables the user to use the tools of MH
  1.2478 +itself to operate on the removed messages.
  1.2479 +One can
  1.2480 +.Pn scan
  1.2481 +them,
  1.2482 +.Pn show
  1.2483 +them, and restore them with
  1.2484 +.Pn refile .
  1.2485 +There's no more
  1.2486 +need to use
  1.2487 +.Pn mhpath
  1.2488 +to switch over from MH tools to Unix tools \(en MH can do it all itself.
  1.2489 +.P
  1.2490 +This approach matches perfect with the concepts of MH, thus making
  1.2491 +it powerful.
  1.2492 +Hence, I made it the default.
  1.2493 +And even more, I also
  1.2494 +removed the old backup prefix approach, as it is clearly less powerful.
  1.2495 +Keeping unused alternative in the code is a bad choice as they likely
  1.2496 +gather bugs, by not being constantly tested.
  1.2497 +Also, the increased code
  1.2498 +size and more conditions crease the maintenance costs.
  1.2499 +By strictly
  1.2500 +converting to the trash folder approach, I simplified the code base.
  1.2501 +.Pn rmm
  1.2502 +calls
  1.2503 +.Pn refile
  1.2504 +internally to move the to-be-removed
  1.2505 +message to the trash folder (\c
  1.2506 +.Fn +trash
  1.2507 +by default).
  1.2508 +Messages
  1.2509 +there can be operated on like on any other message in the storage.
  1.2510 +The sweep clean, one can use
  1.2511 +.Cl "rmm -unlink +trash a" ,
  1.2512 +where the
  1.2513 +.Sw -unlink
  1.2514 +switch causes the files to be truly unliked instead
  1.2515 +of moved to the trash folder.
  1.2516 +
  1.2517 +
  1.2518 +.H2 "Path Notations
  1.2519 +.P
  1.2520 +foo
  1.2521 +
  1.2522 +
  1.2523 +.H2 "MIME Integration
  1.2524 +.P
  1.2525 +user-visible access to whole messages and MIME parts are inherently
  1.2526 +different
  1.2527 +
  1.2528 +
  1.2529 +.H2 "Of One Cast
  1.2530 +.P