meillo@58: .H0 "Discussion meillo@0: .P meillo@58: This main chapter discusses the practical work done in the mmh project. meillo@58: It is structured along the goals to achieve. The concrete work done meillo@58: is described in the examples of how the general goals were achieved. meillo@87: The discussion compares the current version of mmh with the state of meillo@87: nmh just before the mmh project started, i.e. Fall 2011. meillo@87: Current changes of nmh will be mentioned only as side notes. meillo@87: .\" XXX where do I discuss the parallel development of nmh? meillo@58: meillo@58: meillo@58: meillo@58: .H1 "Stream-lining meillo@58: meillo@0: .P meillo@58: MH had been considered an all-in-one system for mail handling. meillo@58: The community around nmh has a similar understanding. meillo@87: In fundamental difference, mmh shall be a MUA only. meillo@87: I believe that the development of all-in-one mail systems is obsolete. meillo@87: Today, email is too complex to be fully covered by single projects. meillo@87: Such a project won't be able to excel in all aspects. meillo@87: Instead, the aspects of email should be covered my multiple projects, meillo@87: which then can be combined to form a complete system. meillo@87: Excellent implementations for the various aspects of email exist already. meillo@87: Just to name three examples: Postfix is a specialized MTA, meillo@87: Procmail is a specialized MDA, and Fetchmail is a specialized MRA. meillo@87: I believe that it is best to use such specilized tools instead of meillo@87: providing the same function again as a side-component in the project. meillo@58: .P meillo@87: Doing something well, requires to focus on a small set of specific aspects. meillo@87: Under the assumption that focused development produces better results meillo@87: in the particular area, specialized projects will likely be superior meillo@87: in their field of focus. meillo@87: Hence, all-in-one mail system projects \(en no matter if monolithic meillo@87: or modular \(en will never be the best choice in any of the fields. meillo@87: Even in providing the best consistent all-in-one system they are likely meillo@87: to be beaten by projects that focus only on integrating existing mail meillo@87: components to a homogenious system. meillo@87: .P meillo@87: The limiting resource in Free Software community development meillo@87: is usually man power. meillo@87: If the development power is spread over a large development area, meillo@87: it becomes even more difficult to compete with the specialists in the meillo@87: various fields. meillo@87: The concrete situation for MH-based mail systems is even tougher, meillo@87: given the small and aged community, including both developers and users, meillo@87: it has. meillo@87: .P meillo@87: In consequence, I believe that the available development resources meillo@87: should be focused on the point where MH is most unique. meillo@87: This is clearly the user interface \(en the MUA. meillo@87: Peripheral parts should be removed to stream-line mmh for the MUA task. meillo@60: meillo@60: meillo@87: .H2 "Removal of the Mail Transfer Facilities meillo@60: .P meillo@60: In contrast to nmh, which also provides mail submission and mail retrieval meillo@87: agents, mmh is a MUA only. meillo@66: This general difference in the view on the character of nmh meillo@76: initiated the development of mmh. meillo@66: Removing the mail transfer facilities had been the first work task meillo@76: in the mmh project. meillo@60: .P meillo@66: The MSA is called \fIMessage Transfer Service\fP (MTS) in nmh. meillo@76: The facility established network connections and spoke SMTP to submit meillo@60: messages for relay to the outside world. meillo@76: This part was implemented by the meillo@60: .Pn post meillo@60: command. meillo@87: The changes in emailing in the last years meillo@87: demanded changes in this part of nmh too. meillo@76: Encryption and authetication for network connections meillo@87: needed to be supported, hence TLS and SASL were introduced into nmh. meillo@87: This added complexity to nmh without improving it in its core functions. meillo@87: Also, keeping up with recent developments in the field of meillo@87: mail transfer requires development power and specialists. meillo@87: In mmh this whole facility was simply cut off. meillo@76: .Ci f6aa95b724fd8c791164abe7ee5468bf5c34f226 meillo@76: .Ci fecd5d34f65597a4dfa16aeabea7d74b191532c3 meillo@76: .Ci 156d35f6425bea4c1ed3c4c79783dc613379c65b meillo@87: Instead, mmh depends on an external MSA. meillo@60: The only outgoing interface available to mmh is the meillo@60: .Pn sendmail meillo@87: command, which almost any MSA provides. meillo@87: If not, a wrapper program can be written. meillo@87: It must read the message from the standard input, extract the meillo@87: recipient addresses from the message header, and hand the message meillo@87: over to the MSA. meillo@87: For example, a wrapper script for qmail would be: meillo@87: .VS meillo@87: #!/bin/sh meillo@87: # ignore command line arguments meillo@87: exec qmail-inject meillo@87: VE meillo@87: The requirement to parse the recipient addresses out of the message header meillo@87: is likely to be removed in the future. meillo@87: Then mmh would give the recipient addresses as command line arguments. meillo@87: This is clearly the better interface, but mmh does not provide it yet. meillo@87: .\" XXX implement it meillo@60: .P meillo@60: To retrieve mail, the meillo@60: .Pn inc meillo@76: command established network connections meillo@76: and spoke POP3 to retrieve mail from remote servers. meillo@76: As with mail submission, the network connections required encryption and meillo@87: authentication, thus TLS and SASL were added. meillo@87: Support for message retrieval through IMAP will become necessary meillo@87: to be added soon, too, and so on for any changes in mail transfer. meillo@76: Mmh has dropped the support for retrieving mail from remote locations. meillo@76: .Ci ab7b48411962d26439f92f35ed084d3d6275459c meillo@76: Instead, it depends on an external tool to cover this task. meillo@87: In mmh there exist two paths for messages to enter mmh's mail storage: meillo@87: (1) Mail can be incorporate with meillo@60: .Pn inc meillo@87: from the system maildrop, or (2) with meillo@60: .Pn rcvstore meillo@87: by reading them, one at a time, from the standard input. meillo@60: .P meillo@60: With the removal of the MSA and MRA, mmh converted from an all-in-one meillo@87: mail system to being a MUA only. meillo@87: Following the Unix philosophy, it now focuses on one job and meillo@76: tries to do that one well. meillo@76: Not only the programs follow that tenet but also the project itself does so. meillo@60: Now, of course, mmh depends on third-party software. meillo@87: An external MSA is required to transfer mail to the outside world; meillo@60: an external MRA is required to retrieve mail from remote machines. meillo@60: There exist excellent implementations of such software, meillo@76: which do this specific task likely better than the internal meillo@87: versions had done it. meillo@87: Also, the best suiting programs can be freely chosen. meillo@60: .P meillo@60: As it had already been possible to use an external MSA or MRA, meillo@60: why not keep the internal version for convenience? meillo@76: The question whether there is sense in having a fall-back pager in all meillo@76: the command line tools, for the cases when meillo@60: .Pn more meillo@60: or meillo@60: .Pn less meillo@76: aren't available, appears to be ridiculous. meillo@87: Now, an MSA or MRA is more complex than a text pager meillo@87: and not necessarily available but still the concept of orthogonal meillo@87: design holds: ``Write programs that do one thing and do it well.'' meillo@87: .[ meillo@87: mcilroy unix phil meillo@87: p. 53 meillo@87: .] meillo@87: .[ meillo@87: mcilroy bstj foreword meillo@87: .] meillo@87: Here, this part of the Unix philosophy was applied not only meillo@87: to the programs but to the project itself. meillo@87: In other words: meillo@87: ``Develop projects that focus on one thing and do it well.'' meillo@87: Projects grown complex should be split for the same reasons programs grown meillo@87: complex should be split. meillo@87: If it is conceptionally more elegant to have the MSA and MRA meillo@87: separate projects then they should be separated. meillo@87: This is the case here, in my opinion. meillo@87: The RFCs propose this separation by clearly distinguishing the different meillo@87: mail handling tasks. meillo@87: .[ meillo@87: rfc 821 meillo@87: .] meillo@87: The small interfaces between the mail agents support the separation. meillo@76: .P meillo@87: In the beginning, email had been small and simple. meillo@76: (\c meillo@60: .Pn /bin/mail meillo@76: had once covered anything there was to email and still had been small meillo@76: and simple.) meillo@76: Then the essential complexity of email increased. meillo@87: (Essential complexity is the complexity defined by the problem itself.\0 meillo@87: .[[ meillo@87: brooks no silver bullet meillo@87: .]]) meillo@87: Email systems reacted to this change: They grew. meillo@87: RFCs started to introduce mail agents and separated the various tasks meillo@87: because the existing tasks became more extensive and new tasks appeared. meillo@87: Again, email systems grew, or they split parts off. meillo@76: In nmh, for instance, the POP server, which the original MH had included, meillo@76: was removed. meillo@87: Now is the time to go one step further and remove the MSA and MRA, too. meillo@87: Not only does this decrease the code size of the project, meillo@87: but, more important, it unburdens mmh of the whole field of meillo@87: message transfer with all its implications for the project. meillo@87: There's no more need to concern with changes in network transfer. meillo@76: This independence is received by depending on an external program meillo@76: that covers the field. meillo@76: Today, this is a reasonable exchange. meillo@60: .P meillo@87: Function can be added in three different ways: meillo@87: .BU meillo@87: Implementing the function originally in the project. meillo@87: .BU meillo@87: Depending on a library that provides the function. meillo@87: .BU meillo@87: Depending on a program that provides the function. meillo@87: .P meillo@87: Whereas adding the function originally to the project increases the meillo@76: code size most and requires most maintenance and development work, meillo@87: it makes the project most independent of other software. meillo@87: Using libraries or external programs require less maintenance work meillo@87: but introduces dependencies on external software. meillo@87: Programs have the smallest interfaces and provide the best separation meillo@87: but possibly limit the information exchange. meillo@87: External libraries are stronger connected than external programs, meillo@87: thus information can be exchanged more flexible. meillo@87: Adding code to a project increases maintenance work. meillo@87: .\" XXX ref meillo@87: Implementing complex functions originally in the project will add meillo@87: a lot of code. meillo@87: This should be avoided if possible. meillo@66: Hence, the dependencies only change in kind, not in their existence. meillo@66: In mmh, library dependencies on meillo@66: .Pn libsasl2 meillo@66: and meillo@66: .Pn libcrypto /\c meillo@66: .Pn libssl meillo@66: were treated against program dependencies on an MSA and an MRA. meillo@87: This also meant treating build-time dependencies against run-time meillo@87: dependencies. meillo@66: Besides program dependencies providing the stronger separation meillo@66: and being more flexible, they also allowed meillo@66: over 6\|000 lines of code to be removed from mmh. meillo@66: This made mmh's code base about 12\|% smaller. meillo@87: Reducing the project's code size by such an amount without actually meillo@87: losing functionality is a convincing argument. meillo@87: Actually, as external MSAs and MRAs are likely superior to the meillo@87: project's internal versions, the common user even gains functionality. meillo@66: .P meillo@76: Users of MH should not have problems to set up an external MSA and MRA. meillo@60: Also, the popular MSAs and MRAs have large communities and a lot meillo@60: of documentation available. meillo@87: Choices for MSAs range from full-featured MTAs like meillo@60: .I Postfix meillo@87: over mid-size MTAs like meillo@60: .I masqmail meillo@60: and meillo@60: .I dma meillo@60: to small forwarders like meillo@60: .I ssmtp meillo@60: and meillo@60: .I nullmailer . meillo@60: Choices for MRAs include meillo@60: .I fetchmail , meillo@60: .I getmail , meillo@60: .I mpop meillo@60: and meillo@60: .I fdm . meillo@60: meillo@60: meillo@60: .H2 "Removal of non-MUA Tools meillo@60: .P meillo@87: One goal of mmh is to remove the tools that are not part of the MUA's task. meillo@87: Further more, any tools that don't improve the MUA's job significently meillo@87: should be removed. meillo@87: Loosely related and rarely used tools distract from the lean appearance. meillo@87: They require maintenance work without adding much to the core task. meillo@87: On removing these tools, the project shall become more stream-lined meillo@87: and focused. meillo@76: In mmh the following tools are not available anymore: meillo@62: .BU meillo@58: .Pn conflict meillo@87: was removed meillo@76: .Ci 8b235097cbd11d728c07b966cf131aa7133ce5a9 meillo@87: because it is a mail system maintenance tool that is not MUA-related. meillo@87: It even checked meillo@58: .Fn /etc/passwd meillo@58: and meillo@58: .Fn /etc/group meillo@87: for consistency, which is completely unrelated to email. meillo@87: A tool like meillo@87: .Pn conflict meillo@87: is surely useful, but it should not be shipped with mmh. meillo@76: .\" XXX historic reasons? meillo@62: .BU meillo@58: .Pn rcvtty meillo@87: was removed meillo@87: .Ci 14767c94b3827be7c867196467ed7aea5f6f49b0 meillo@87: because its usecase of writing to the user's terminal meillo@76: on receiving of mail is obsolete. meillo@87: If users like to be informed of new mail, the shell's meillo@58: .Ev MAILPATH meillo@87: variable or graphical notifications are technically more appealing. meillo@62: Writing directly to a terminals is hardly ever wanted today. meillo@62: If though one wants to have it this way, the standard tool meillo@58: .Pn write meillo@58: can be used in a way similar to: meillo@82: .VS meillo@58: scan -file - | write `id -un` meillo@82: VE meillo@62: .BU meillo@58: .Pn viamail meillo@87: was removed meillo@87: .Ci eda72d6a7a7c20ff123043fb7f19c509ea01f932 meillo@87: when the new attachment system was activated, because meillo@58: .Pn forw meillo@76: could then cover the task itself. meillo@62: The program meillo@58: .Pn sendfiles meillo@62: was rewritten as a shell script wrapper around meillo@58: .Pn forw . meillo@76: .Ci 0e82199cf3c991a173e0ac8aa776efdb3ded61e6 meillo@62: .BU meillo@58: .Pn msgchk meillo@87: was removed meillo@87: .Ci bb9360ead7eb7a3fedcce2eeedfc660014e41dbe , meillo@87: because it lost its use case when POP support was removed. meillo@76: A call to meillo@58: .Pn msgchk meillo@87: provided hardly more information than: meillo@82: .VS meillo@58: ls -l /var/mail/meillo meillo@82: VE meillo@87: It did distinguished between old and new mail, but meillo@87: this detail information and can be retrieved with meillo@76: .Pn stat (1), meillo@62: too. meillo@62: A very small shell script could be written to output the information meillo@76: in a similar way, if truly necessary. meillo@76: As mmh's meillo@76: .Pn inc meillo@87: only incorporates mail from the user's local maildrop, meillo@62: and thus no data transfers over slow networks are involved, meillo@76: there's hardly any need to check for new mail before incorporating it. meillo@62: .BU meillo@58: .Pn msh meillo@87: was removed meillo@76: .Ci 916690191222433a6923a4be54b0d8f6ac01bd02 meillo@87: because the tool was in conflict with the philosophy of MH. meillo@76: It provided an interactive shell to access the features of MH, meillo@76: but it wasn't just a shell, tailored to the needs of mail handling. meillo@76: Instead it was one large program that had several MH tools built in. meillo@76: This conflicts with the major feature of MH of being a tool chest. meillo@76: .Pn msh 's meillo@76: main use case had been accessing Bulletin Boards, which have seized to meillo@62: be popular. meillo@62: .P meillo@62: Removing meillo@58: .Pn msh , meillo@76: together with the truly archaic code relicts meillo@58: .Pn vmh meillo@58: and meillo@58: .Pn wmh , meillo@62: saved more than 7\|000 lines of C code \(en meillo@66: about 15\|% of the project's original source code amount. meillo@76: .P meillo@76: Having less code (with equal readability, of course) meillo@76: for the same functionality is an advantage. meillo@63: Less code means less bugs and less maintenance work. meillo@76: As meillo@63: .Pn rcvtty meillo@63: and meillo@63: .Pn msgchk meillo@87: are assumed to be rarely used and can be implemented in different ways, meillo@87: why should one keep them? meillo@76: Removing them stream-lines mmh. meillo@63: .Pn viamail 's meillo@63: use case is now partly obsolete and partly covered by meillo@63: .Pn forw , meillo@76: hence there's no reason to still maintain it. meillo@63: .Pn conflict meillo@76: is not related to the mail client, and meillo@63: .Pn msh meillo@63: conflicts with the basic concept of MH. meillo@76: Theses two tools might still be useful, but they should not be part of mmh. meillo@63: .P meillo@76: Finally, there's meillo@76: .Pn slocal . meillo@76: .Pn slocal meillo@76: is an MDA and thus not directly MUA-related. meillo@78: It should be removed, because including it is a violation meillo@78: of the idea that mmh is a MUA only. meillo@78: It should become a separate project. meillo@87: However, meillo@76: .Pn slocal meillo@76: provides rule-based processing of messages, like filing them into meillo@76: different folders, which is otherwise not available in mmh. meillo@87: Although meillo@76: .Pn slocal meillo@87: does neither pull in dependencies nor does it include a separate meillo@87: technical area (cf. Sec. XXX), meillo@87: still it accounts for about 1\|000 lines of code that need to be maintained. meillo@76: As meillo@76: .Pn slocal meillo@76: is almost self-standing, it should be split off into a separate project. meillo@76: This would cut the strong connection between the MUA mmh and the MDA meillo@76: .Pn slocal . meillo@87: For anyone not using MH, meillo@87: .Pn slocal meillo@87: would become yet another independent MDA, like meillo@87: .I procmail . meillo@87: The need to install a complete MH system to have meillo@87: .Pn slocal meillo@87: would be gone. meillo@76: Likewise, mmh users could decide to use meillo@76: .I procmail meillo@87: without having a second, unused MDA, meillo@87: .Pn slocal , meillo@76: installed. meillo@76: That's conceptionally the best solution. meillo@76: Yet, meillo@76: .Pn slocal meillo@87: is not split off. meillo@87: I feel unsure with removing it from mmh. meillo@87: Hence, I defer the decision over meillo@87: .Pn slocal . meillo@87: In the meanwhile meillo@78: .Pn slocal meillo@87: does not hurt because it is unrelated to the rest of mmh. meillo@0: meillo@58: meillo@76: .H2 "\fLshow\fP and \fPmhshow\fP meillo@58: .P meillo@69: Since the very beginning \(en already in the first concept paper \(en meillo@58: .Pn show meillo@62: had been MH's message display program. meillo@58: .Pn show meillo@76: mapped message numbers and sequences to files and invoked meillo@58: .Pn mhl meillo@76: to have the files formated. meillo@88: With MIME, this approach wasn't sufficient anymore. meillo@58: MIME messages can consist of multiple parts, some of which aren't meillo@88: directly displayable, further more text content might be encoded in meillo@58: foreign charsets. meillo@58: .Pn show 's meillo@76: understanding of messages and meillo@58: .Pn mhl 's meillo@88: display capabilities couldn't cope with the task any longer. meillo@62: .P meillo@88: Instead of extending these tools, additional tools were written from meillo@88: scratch and added to the MH tool chest. meillo@88: Doing so is encouraged by the tool chest approach. meillo@88: Modular design is a great advantage for extending a system, meillo@88: as new tools can be added without interfering with existing ones. meillo@62: First, the new MIME features were added in form of the single program meillo@58: .Pn mhn . meillo@58: The command meillo@82: .Cl "mhn -show 42 meillo@58: would show the MIME message numbered 42. meillo@58: With the 1.0 release of nmh in February 1999, Richard Coleman finished meillo@58: the split of meillo@58: .Pn mhn meillo@88: into a set of specialized tools, which together covered the meillo@88: multiple aspects of MIME. meillo@88: One of them was meillo@69: .Pn mhshow , meillo@88: which replaced meillo@88: .Cl "mhn -show" . meillo@88: It was capable of displaying MIME messages appropriately. meillo@62: .P meillo@88: From then on, two message display tools were part of nmh, meillo@76: .Pn show meillo@76: and meillo@76: .Pn mhshow . meillo@88: To ease the life of users, meillo@69: .Pn show meillo@69: was extended to automatically hand the job over to meillo@69: .Pn mhshow meillo@69: if displaying the message would be beyond meillo@69: .Pn show 's meillo@69: abilities. meillo@88: In consequence, the user would simply invoke meillo@69: .Pn show meillo@69: (possibly through meillo@69: .Pn next meillo@69: or meillo@69: .Pn prev ) meillo@69: and get the message printed with either meillo@69: .Pn show meillo@69: or meillo@69: .Pn mhshow , meillo@69: whatever was more appropriate. meillo@69: .P meillo@69: Having two similar tools for essentially the same task is redundant. meillo@88: Usually, meillo@88: users wouldn't distinguish between meillo@88: .Pn show meillo@88: and meillo@88: .Pn mhshow meillo@88: in their daily mail reading. meillo@88: Having two separate display programs was therefore mainly unnecessary meillo@88: from a user's point of view. meillo@88: Besides, the development of both programs needed to be in sync, meillo@76: to ensure that the programs behaved in a similar way, meillo@76: because they were used like a single tool. meillo@76: Different behavior would have surprised the user. meillo@69: .P meillo@69: Today, non-MIME messages are rather seen to be a special case of meillo@88: MIME messages, although it's the other way round. meillo@69: As meillo@69: .Pn mhshow meillo@88: had already be able to display non-MIME messages, it appeared natural meillo@69: to drop meillo@69: .Pn show meillo@69: in favor of using meillo@69: .Pn mhshow meillo@69: exclusively. meillo@88: .Ci 4c1efddfd499300c7e74263e57d8aa137e84c853 meillo@88: Removing meillo@88: .Pn show meillo@88: is no loss in function, because functionally meillo@88: .Pn mhshow meillo@88: covers it completely. meillo@88: The old behavior of meillo@88: .Pn show meillo@88: can still be emulated with the simple command line: meillo@88: .VS meillo@88: mhl `mhpath c` meillo@88: VE meillo@88: .P meillo@76: For convenience, meillo@76: .Pn mhshow meillo@88: was renamed to meillo@88: .Pn show meillo@88: after meillo@88: .Pn show meillo@88: was gone. meillo@88: It is clear that such a rename may confuse future developers when meillo@88: trying to understand the history. meillo@88: Nevertheless, I consider the convenience on the user's side, meillo@88: to call meillo@88: .Pn show meillo@88: when they want a message to be displayed, to outweigh the inconvenience meillo@88: on the developer's side when understanding the project history. meillo@69: .P meillo@88: To prepare for the transition, meillo@69: .Pn mhshow meillo@69: was reworked to behave more like meillo@69: .Pn show meillo@69: first. meillo@88: (cf. Sec. XXX) meillo@88: Once the tools behaved more alike, the replacing appeared to be meillo@88: even more natural. meillo@88: Today, mmh's new meillo@69: .Pn show meillo@88: became the one single message display program again, with the difference meillo@88: that today it handles MIME messages as well as non-MIME messages. meillo@88: The outcome of the transition is one program less to maintain, meillo@88: no second display program for users to deal with, meillo@88: and less system complexity. meillo@69: .P meillo@88: Still, removing the old meillo@69: .Pn show meillo@88: hurts in one regard: It had been such a simple program. meillo@88: Its lean elegance is missing to the new meillo@69: .Pn show . meillo@88: But there is no chance; meillo@88: supporting MIME demands for higher essential complexity. meillo@58: meillo@58: meillo@58: .H2 "Removal of Configure Options meillo@58: .P meillo@76: Customization is a double-edged sword. meillo@76: It allows better suiting setups, but not for free. meillo@76: There is the cost of code complexity to be able to customize. meillo@76: There is the cost of less tested setups, because there are meillo@72: more possible setups and especially corner-cases. meillo@76: And, there is the cost of choice itself. meillo@76: The code complexity directly affects the developers. meillo@72: Less tested code affects both, users and developers. meillo@76: The problem of choice affects the users, for once by having to meillo@76: choose, but also by complexer interfaces that require more documentation. meillo@72: Whenever options add little advantages, they should be considered for meillo@72: removal. meillo@72: I have reduced the number of project-specific configure options from meillo@72: fifteen to three. meillo@74: meillo@76: .U3 "Mail Transfer Facilities meillo@74: .P meillo@85: With the removal of the mail transfer facilities five configure meillo@85: options vanished: meillo@85: .P meillo@85: The switches meillo@85: .Sw --with-tls meillo@85: and meillo@85: .Sw --with-cyrus-sasl meillo@85: had activated the support for transfer encryption and authetication. meillo@85: This is not needed anymore. meillo@85: .Ci fecd5d34f65597a4dfa16aeabea7d74b191532c3 meillo@85: .Ci 156d35f6425bea4c1ed3c4c79783dc613379c65b meillo@85: .P meillo@85: The configure switch meillo@85: .Sw --enable-pop meillo@85: activated the message retrieval facility. meillo@85: The code area that would be conditionally compiled in for TLS and SASL meillo@85: support had been small. meillo@85: The conditionally compiled code area for POP support had been much larger. meillo@85: Whereas the code base changes would only slightly change on toggling meillo@85: TLS or SASL support, it changed much on toggling POP support. meillo@85: The changes in the code base could hardly be overviewed. meillo@85: By having POP support togglable a second code base had been created, meillo@85: one that needed to be tested. meillo@85: This situation is basically similar for the conditional TLS and SASL meillo@85: code, but there the changes are minor and can yet be overviewed. meillo@85: Still, conditional compilation of a code base creates variations meillo@85: of the original program. meillo@85: More variations require more testing and maintenance work. meillo@85: .P meillo@85: Two other options only specified default configuration values: meillo@85: .Sw --with-mts=[smtp|sendmail] meillo@85: defined the default transport service. meillo@85: In mmh this fixed to meillo@85: .Ar sendmail . meillo@85: .Ci f6aa95b724fd8c791164abe7ee5468bf5c34f226 meillo@85: With meillo@85: .Sw --with-smtpservers=[server1...] meillo@85: default SMTP servers for the meillo@85: .Ar smtp meillo@85: transport service could be specified. meillo@72: .Ci 128545e06224233b7e91fc4c83f8830252fe16c9 meillo@85: Both of them became irrelevant. meillo@72: meillo@74: .U3 "Backup Prefix meillo@74: .P meillo@76: The backup prefix is the string that was prepended to message meillo@76: filenames to tag them as deleted. meillo@76: By default it had been the comma character `\f(CW,\fP'. meillo@78: In July 2000, Kimmo Suominen introduced meillo@78: the configure option meillo@78: .Sw --with-hash-backup meillo@78: to change the default to the hash symbol `\f(CW#\fP'. meillo@78: The choice was probably personal preference, because first, the meillo@78: option was named meillo@78: .Sw --with-backup-prefix. meillo@78: and had the prefix symbol as argument. meillo@78: Because giving the hash symbol as argument caused to many problems meillo@78: for configure, meillo@78: the option was limited to use the hash symbol as the default prefix. meillo@78: This makes me believe, that the choice for the hash was personal preference. meillo@78: Being it related or not, words that start with the hash symbol meillo@78: introduce a comment in the Unix shell. meillo@72: Thus, the command line meillo@72: .Cl "rm #13 #15 meillo@72: calls meillo@72: .Pn rm meillo@72: without arguments because the first hash symbol starts the comment meillo@72: that reaches until the end of the line. meillo@72: To delete the backup files, meillo@72: .Cl "rm ./#13 ./#15" meillo@72: needs to be used. meillo@78: Using the hash as backup prefix can be seen as a precaution agains meillo@78: data loss. meillo@78: .P meillo@72: I removed the configure option but added the profile entry meillo@72: .Pe backup-prefix , meillo@72: which allows to specify an arbitrary string as backup prefix. meillo@72: .Ci 6c40d481d661d532dd527eaf34cebb6d3f8ed086 meillo@76: Profile entries are the common method to change mmh's behavior. meillo@76: This change did not remove the choice but moved it to a location where meillo@72: it suited better. meillo@76: .P meillo@78: Eventually, however, the new trash folder concept meillo@78: .Cf "Sec. XXX meillo@78: obsoleted the concept of the backup prefix completely. meillo@78: .Ci 8edc5aaf86f9f77124664f6801bc6c6cdf258173 meillo@72: (Well, there still are corner-cases to remove until the backup meillo@72: prefix can be layed to rest, eventually.) meillo@72: .\" FIXME: Do this work in the code! meillo@76: meillo@76: .U3 "Editor and Pager meillo@74: .P meillo@74: The two configure options meillo@74: .CW --with-editor=EDITOR meillo@74: .CW --with-pager=PAGER meillo@74: were used to specify the default editor and pager at configure time. meillo@74: Doing so at configure time made sense in the Eighties, meillo@76: when the set of available editors and pagers varied much across meillo@76: different systems. meillo@76: Today, the situation is more homegeneic. meillo@74: The programs meillo@74: .Pn vi meillo@74: and meillo@74: .Pn more meillo@76: can be expected to be available on every Unix system, meillo@74: as they are specified by POSIX since two decades. meillo@74: (The specifications for meillo@74: .Pn vi meillo@74: and meillo@74: .Pn more meillo@74: appeared in meillo@74: .[ meillo@74: posix 1987 meillo@74: .] meillo@74: and, meillo@74: .[ meillo@74: posix 1992 meillo@74: .] meillo@74: respectively.) meillo@74: As a first step, these two tools were hard-coded as defaults. meillo@74: .Ci 5d43a99db70c12a673028c7758c20cbe3e13ef5f meillo@74: Not changed were the meillo@74: .Pe editor meillo@74: and meillo@74: .Pe moreproc meillo@76: profile entries, which allowed the user to override the system defaults. meillo@74: Later, the concept was reworked to respect the standard environment meillo@74: variables meillo@74: .Ev VISUAL meillo@74: and meillo@74: .Ev PAGER meillo@76: if they are set. meillo@74: Today, mmh determines the editor to use in the following order, meillo@74: taking the first available and non-empty item: meillo@74: .IP (1) meillo@74: Environment variable meillo@74: .Ev MMHEDITOR meillo@74: .IP (2) meillo@74: Profile entry meillo@74: .Pe Editor meillo@74: .IP (3) meillo@74: Environment variable meillo@74: .Ev VISUAL meillo@74: .IP (4) meillo@74: Environment variable meillo@74: .Ev EDITOR meillo@74: .IP (5) meillo@74: Command meillo@74: .Pn vi . meillo@74: .P meillo@76: .Ci f85f4b7ae62e3d05a945dcd46ead51f0a2a89a9b meillo@76: .P meillo@76: The pager to use is deteminded in a similar order, meillo@74: also taking the first available and non-empty item: meillo@74: .IP (1) meillo@74: Environment variable meillo@74: .Ev MMHPAGER meillo@74: .IP (2) meillo@74: Profile entry meillo@74: .Pe Pager meillo@74: (replaces meillo@74: .Pe moreproc ) meillo@74: .IP (3) meillo@74: Environment variable meillo@74: .Ev PAGER meillo@74: .IP (4) meillo@74: Command meillo@74: .Pn more . meillo@74: .P meillo@74: .Ci 0c4214ea2aec6497d0d67b436bbee9bc1d225f1e meillo@74: .P meillo@76: By respecting the meillo@74: .Ev VISUAL /\c meillo@74: .Ev EDITOR meillo@74: and meillo@74: .Ev PAGER meillo@76: environment variables, meillo@76: the new behavior confirms better to the common style on Unix systems. meillo@76: Additionally, the new approach is more uniform and clearer to users. meillo@72: meillo@74: .U3 "Locale meillo@74: .P meillo@74: The configure option meillo@74: .Sw --disable-locale meillo@85: was removed because POSIX provides locale support and there's meillo@85: hardly any need to disable locale support. meillo@74: .Ci ccf4f175ef4c4e7522f9510a4a1149c15d810dd9 meillo@72: meillo@76: .U3 "ndbm meillo@72: .P meillo@74: .Pn slocal meillo@78: used to depend on meillo@74: .I ndbm , meillo@74: a database library. meillo@76: The database is used to store the `\fLMessage-ID\fP's of all meillo@76: messages delivered. meillo@74: This enables meillo@74: .Pn slocal meillo@74: to suppress delivering the same message to the same user twice. meillo@74: (This features was enabled by the meillo@74: .Sw -suppressdup meillo@74: switch.) meillo@74: .P meillo@74: A variety of version of the database library exist. meillo@78: .[ meillo@78: wolter unix incompat notes dbm meillo@78: .] meillo@74: Complicated autoconf code was needed to detect them correctly. meillo@74: Further more, the configure switches meillo@74: .Sw --with-ndbm=ARG meillo@74: and meillo@74: .Sw --with-ndbmheader=ARG meillo@74: were added to help with difficult setups that would meillo@78: not be detected automatically or correctly. meillo@74: .P meillo@74: By removing the suppress duplicates feature of meillo@74: .Pn slocal , meillo@74: the dependency on meillo@74: .I ndbm meillo@78: vanished and 120 lines of complex autoconf code could be saved. meillo@74: .Ci ecd6d6a20cb7a1507e3a20d6c4cb3a1cf14c6bbf meillo@78: The change removed funtionality too, but that is minor to the meillo@78: improvement by dropping the dependency and the complex autoconf code. meillo@72: meillo@74: .U3 "mh-e Support meillo@72: .P meillo@74: The configure option meillo@74: .Sw --disable-mhe meillo@74: was removed when the mh-e support was reworked. meillo@74: Mh-e is the Emacs front-end to MH. meillo@76: It requires MH to provide minor additional functions. meillo@76: The meillo@76: .Sw --disable-mhe meillo@76: configure option could switch these extensions off. meillo@76: After removing the support for old versions of mh-e, meillo@74: only the meillo@74: .Sw -build meillo@76: switches of meillo@74: .Pn forw meillo@74: and meillo@74: .Pn repl meillo@76: are left to be mh-e extensions. meillo@76: They are now always built in because they add little code and complexity. meillo@76: In consequence, the meillo@74: .Sw --disable-mhe meillo@76: configure option was removed meillo@72: .Ci a7ce7b4a580d77b6c2c4d980812beb589aa4c643 meillo@74: Removing the option removed a second code setup that would have meillo@74: needed to be tested. meillo@76: This change was first done in nmh and thereafter merged into mmh. meillo@76: .P meillo@76: The interface changes in mmh require mh-e to be adjusted in order meillo@76: to be able to use mmh as back-end. meillo@76: This will require minor changes to mh-e, but removing the meillo@76: .Sw -build meillo@76: switches would require more rework. meillo@72: meillo@74: .U3 "Masquerading meillo@72: .P meillo@74: The configure option meillo@74: .Sw --enable-masquerade meillo@76: could take up to three arguments: meillo@76: `draft_from', `mmailid', and `username_extension'. meillo@74: They activated different types of address masquerading. meillo@74: All of them were implemented in the SMTP-speaking meillo@74: .Pn post meillo@76: command, which provided an MSA. meillo@76: Address masquerading is an MTA's task and mmh does not cover meillo@76: this field anymore. meillo@76: Hence, true masquerading needs to be implemented in the external MTA. meillo@74: .P meillo@74: The meillo@74: .I mmailid meillo@74: masquerading type is the oldest one of the three and the only one meillo@74: available in the original MH. meillo@74: It provided a meillo@74: .I username meillo@74: to meillo@74: .I fakeusername meillo@76: mapping, based on the password file's GECOS field. meillo@74: The man page meillo@74: .Mp mh-tailor(5) meillo@74: described the use case as being the following: meillo@74: .QP meillo@74: This is useful if you want the messages you send to always meillo@74: appear to come from the name of an MTA alias rather than your meillo@74: actual account name. For instance, many organizations set up meillo@74: `First.Last' sendmail aliases for all users. If this is meillo@74: the case, the GECOS field for each user should look like: meillo@74: ``First [Middle] Last '' meillo@74: .P meillo@74: As mmh sends outgoing mail via the local MTA only, meillo@76: the best location to do such global rewrites is there. meillo@74: Besides, the MTA is conceptionally the right location because it meillo@74: does the reverse mapping for incoming mail (aliasing), too. meillo@76: Further more, masquerading set up there is readily available for all meillo@74: mail software on the system. meillo@76: Hence, mmailid masquerading was removed. meillo@74: .Ci 0836c8000ccb34b59410ef1c15b1b7feac70ce5f meillo@74: .P meillo@74: The meillo@74: .I username_extension meillo@76: masquerading type did not replace the username but would append a suffix, meillo@76: specified by the meillo@74: .Ev USERNAME_EXTENSION meillo@76: environment variable, to it. meillo@76: This provided support for the meillo@74: .I user-extension meillo@74: feature of qmail and the similar meillo@74: .I "plussed user meillo@74: processing of sendmail. meillo@74: The decision to remove this username_extension masquerading was meillo@74: motivated by the fact that meillo@74: .Pn spost meillo@76: hadn't supported it already. meillo@76: .Ci 2abae0bfd0ad5bf898461e50aa4b466d641f23d9 meillo@76: Username extensions are possible in mmh, but less convenient to use. meillo@76: .\" XXX format file %(getenv USERNAME_EXTENSION) meillo@74: .P meillo@74: The meillo@74: .I draft_from meillo@74: masquerading type instructed meillo@74: .Pn post meillo@84: to use the value of the meillo@84: .Hd From meillo@84: header field as SMTP envelope sender. meillo@76: Sender addresses could be replaced completely. meillo@74: .Ci b14ea6073f77b4359aaf3fddd0e105989db9 meillo@76: Mmh offers a kind of masquerading similar in effect, but meillo@74: with technical differences. meillo@76: As mmh does not transfer messages itself, the local MTA has final control meillo@76: over the sender's address. Any masquerading mmh introduces may be reverted meillo@76: by the MTA. meillo@76: In times of pedantic spam checking, an MTA will take care to use meillo@76: sensible envelope sender addresses to keep its own reputation up. meillo@84: Nonetheless, the MUA can set the meillo@84: .Hd From meillo@84: header field and thereby propose meillo@76: a sender address to the MTA. meillo@74: The MTA may then decide to take that one or generate the canonical sender meillo@74: address for use as envelope sender address. meillo@74: .P meillo@74: In mmh, the MTA will always extract the recipient and sender from the meillo@84: message header (\c meillo@74: .Pn sendmail 's meillo@74: .Sw -t meillo@74: switch). meillo@84: The meillo@84: .Hd From meillo@84: header field of the draft may be set arbitrary by the user. meillo@74: If it is missing, the canonical sender address will be generated by the MTA. meillo@74: meillo@74: .U3 "Remaining Options meillo@74: .P meillo@74: Two configure options remain in mmh. meillo@74: One is the locking method to use: meillo@74: .Sw --with-locking=[dot|fcntl|flock|lockf] . meillo@76: The idea of removing all methods except the portable dot locking meillo@76: and having that one as the default is appealing, but this change meillo@76: requires deeper technical investigation into the topic. meillo@76: The other option, meillo@74: .Sw --enable-debug , meillo@74: compiles the programs with debugging symbols and does not strip them. meillo@74: This option is likely to stay. meillo@72: meillo@72: meillo@58: meillo@63: meillo@58: .H2 "Removal of switches meillo@58: .P meillo@58: meillo@58: meillo@58: meillo@58: meillo@74: .H1 "Modernizing meillo@58: meillo@58: meillo@58: .H2 "Removal of Code Relicts meillo@0: .P meillo@51: The code base of mmh originates from the late Seventies, meillo@51: had been extensively meillo@51: worked on in the mid Eighties, and had been partly reorganized and extended meillo@51: in the Nineties. Relicts of all those times had gathered in the code base. meillo@12: My goal was to remove any ancient code parts. One part of the task was meillo@12: converting obsolete code constructs to standard constructs, the other part meillo@12: was dropping obsolete functions. meillo@12: .P meillo@12: As I'm not even thirty years old and have no more than seven years of meillo@51: Unix experience, I needed to learn about the history in retrospective. meillo@51: Older people likely have used those ancient constructs themselves meillo@51: and have suffered from their incompatibilities and have longed for meillo@12: standardization. Unfortunately, I have only read that others had done so. meillo@12: This put me in a much more difficult positions when working on the old meillo@12: code. I needed to recherche what other would have known by heart from meillo@12: experience. All my programming experience comes from a time past ANSI C meillo@12: and past POSIX. Although I knew about the times before, I took the meillo@51: current state implicitly for granted most of the time. meillo@12: .P meillo@12: Being aware of meillo@12: these facts, I rather let people with more historic experience solve the meillo@12: task of converting the ancient code constructs to standardized ones. meillo@12: Luckily, Lyndon Nerenberg focused on this task at the nmh project. meillo@12: He converted large parts of the code to POSIX constructs, removing meillo@12: the conditionals compilation for now standardized features. meillo@12: I'm thankful for this task being solved. I only pulled the changes into meillo@12: mmh. meillo@12: .P meillo@20: The other task \(en dropping ancient functionality to remove old code \(en meillo@12: I did myself, though. My position to strip mmh to the bare minimum of meillo@12: frequently used features is much more revolutional than the nmh community meillo@20: likes it. Without the need to justify my decisions, I was able to quickly meillo@20: remove functionality I considered ancient. meillo@20: The need to discuss my decisions with meillo@20: peers likely would have slowed this process down. Of course, I researched meillo@12: if a particular feature really should be dropped. Having not had any meillo@12: contact to this feature within my computer life was a first indicator to meillo@12: drop it, but I also asked others and searched the literature for modern meillo@12: usage of the feature. If it appeared to be truly ancient, I dropped it. meillo@12: The reason for dropping is always part of the commit message in the meillo@12: version control system. Thus, it is easy for others to check their meillo@12: view on the topic with mine and possibly to argue for reinclusion. meillo@12: meillo@12: .U2 "MMDF maildrop support meillo@12: .P meillo@12: I did drop any support for the MMDF maildrop format. This type of format meillo@12: is conceptionally similar to the mbox format, but uses four bytes with meillo@12: value 1 (\fL^A^A^A^A\fP) as message delimiter, meillo@18: instead of the string ``\fLFrom\ \fP''. meillo@12: Due to the similarity and mbox being the de-facto standard maildrop meillo@12: format on Unix, but also due to the larger influence of Sendmail than MMDF, meillo@12: the MMDF maildrop format had vanished. meillo@12: .P meillo@12: The simplifications within the code were only moderate. Switches could meillo@12: be removed from tools like meillo@12: .L packf , meillo@12: which generate packed mailboxes. Only one packed mailbox format remained: meillo@12: mbox. meillo@12: The most important changes affect the equally named mail parsing routine in meillo@12: .L sbr/m_getfld.c . meillo@12: The direct MMDF code had been removed, but as now only one packed mailbox meillo@12: format is left, code structure simplifications are likely possible. meillo@12: The reason why they are still outstanding is the heavily optimized code meillo@18: of meillo@18: .Fu m_getfld() . meillo@18: Changes beyond a small local scope \(en meillo@12: which restructuring in its core is \(en cause a high risk of damaging meillo@12: the intricate workings of the optimized code. This problem is know meillo@12: to the developers of nmh, too. They also avoid touching this minefield meillo@12: if possible. meillo@12: meillo@12: .U2 "UUCP Bang Paths meillo@12: .P meillo@12: More questionably than the former topic is the removal of support for the meillo@12: UUCP bang path address style. However, the user may translate the bang meillo@12: paths on retrieval to Internet addresses and the other way on posting meillo@12: messages. The former can be done my an MDA like procmail; the latter meillo@12: by a sendmail wrapper. This would ensure that any address handling would meillo@12: work as expected. However, it might just work well without any meillo@12: such modifications, as mmh does not touch addresses much, in general. meillo@12: But I can't ensure as I have never used an environment with bang paths. meillo@12: Also, the behavior might break at any point in further development. meillo@12: meillo@12: .U2 "Hardcopy terminal support meillo@12: .P meillo@12: More of a funny anecdote is the remaining of a check for printing to a meillo@12: hardcopy terminal until Spring 2012, when I finally removed it. meillo@12: I surely would be very happy to see such a terminal in action, maybe meillo@12: actually being able to work on it, but I fear my chances are null. meillo@12: .P meillo@12: The check only prevented a pager to be placed between the outputting meillo@18: program (\c meillo@18: .Pn mhl ) meillo@18: and the terminal. This could have been ensured with meillo@18: the meillo@82: .Sw -nomoreproc meillo@18: at the command line statically, too. meillo@12: meillo@12: .U2 "Removed support for header fields meillo@12: .P meillo@84: The meillo@84: .Hd Encrypted meillo@84: header field had been introduced by RFC\^822, but already meillo@12: marked legacy in RFC 2822. It was superseded by FIXME. meillo@84: Mmh does no more support this header field. meillo@12: .P meillo@84: Native support for meillo@84: .Hd Face meillo@84: header fields had been removed, as well. meillo@84: The feature is similar to the meillo@84: .Hd X-Face meillo@84: header field in its intent, meillo@21: but takes a different approach to store the image. meillo@84: Instead of encoding the image data directly into the header field, meillo@84: the it contains the hostname and UDP port where the image meillo@21: date could be retrieved. meillo@84: Neither meillo@84: .Hd X-Face meillo@84: nor the here described meillo@84: .Hd Face meillo@84: system meillo@21: \** meillo@21: .FS meillo@21: There is also a newer but different system, invented 2005, meillo@84: using meillo@84: .Hd Face meillo@84: headers. meillo@84: It is the successor of meillo@84: .Hd X-Face meillo@84: providing colored PNG images. meillo@21: .FE meillo@21: became well used in the large scale. meillo@21: It's still possible to use a Face systems, meillo@21: although mmh does not provide support for any of the different systems meillo@21: anymore. It's fairly easy to write a small shell script to meillo@21: extract the embedded or fetch the external Face data and display the image. meillo@84: Own meillo@84: .Hd Face meillo@84: header field can be added into the draft template files. meillo@21: .P meillo@84: .Hd Content-MD5 meillo@84: header fields were introduced by RFC\^1864. They provide only meillo@12: a verification of data corruption during the transfer. By no means can meillo@12: they ensure verbatim end-to-end delivery of the contents. This is clearly meillo@12: stated in the RFC. The proper approach to provide verificationability meillo@12: of content in an end-to-end relationship is the use of digital cryptography meillo@12: (RFCs FIXME). On the other hand, transfer protocols should ensure the meillo@12: integrity of the transmission. In combinations these two approaches meillo@84: make the meillo@84: .Hd Content-MD5 meillo@84: header field useless. In consequence, I removed meillo@12: the support for it. By this removal, MD5 computation is not needed meillo@12: anywhere in mmh. Hence, over 500 lines of code were removed by this one meillo@84: change. Even if the meillo@84: .Hd Content-MD5 meillo@84: header field is useful sometimes, meillo@12: I value its usefulnes less than the improvement in maintainability, caused meillo@12: by the removal. meillo@12: meillo@20: .U2 "Prompter's Control Keys meillo@20: .P meillo@20: The program meillo@20: .Pn prompter meillo@20: queries the user to fill in a message form. When used by meillo@20: .Pn comp meillo@20: as: meillo@82: .VS meillo@82: comp -editor prompter meillo@82: VE meillo@20: the resulting behavior is similar to meillo@20: .Pn mailx . meillo@51: Apparently, meillo@20: .Pn prompter meillo@20: hadn't been touched lately. Otherwise it's hardly explainable why it meillo@20: still offered the switches meillo@84: .Sw -erase meillo@84: .Ar chr meillo@20: and meillo@84: .Sw -kill meillo@84: .Ar chr meillo@20: to name the characters for command line editing. meillo@21: The times when this had been necessary are long time gone. meillo@20: Today these things work out-of-the-box, and if not, are configured meillo@20: with the standard tool meillo@20: .Pn stty . meillo@20: meillo@21: .U2 "Vfork and Retry Loops meillo@21: .P meillo@51: MH creates many processes, which is a consequence of the tool chest approach. meillo@21: In earlier times meillo@21: .Fu fork() meillo@21: had been an expensive system call, as the process's whole image needed meillo@21: to be duplicated. One common case is replacing the image with meillo@21: .Fu exec() meillo@21: right after having forked the child process. meillo@21: To speed up this case, the meillo@21: .Fu vfork() meillo@21: system call was invented at Berkeley. It completely omits copying the meillo@21: image. If the image gets replaced right afterwards then unnecessary meillo@21: work is omited. On old systems this results in large speed ups. meillo@21: MH uses meillo@21: .Fu vfork() meillo@21: whenever possible. meillo@21: .P meillo@21: Memory management units that support copy-on-write semantics make meillo@21: .Fu fork() meillo@21: almost as fast as meillo@21: .Fu vfork() meillo@21: in the cases when they can be exchanged. meillo@21: With meillo@21: .Fu vfork() meillo@51: being more error-prone and hardly faster, it's preferable to simply meillo@21: use meillo@21: .Fu fork() meillo@21: instead. meillo@21: .P meillo@21: Related to the costs of meillo@21: .Fu fork() meillo@21: is the probability of its success. meillo@21: Today on modern systems, the system call will succeed almost always. meillo@51: In the Eighties on heavy loaded systems, as they were common at meillo@21: universities, this had been different. Thus, many of the meillo@21: .Fu fork() meillo@21: calls were wrapped into loops to retry to fork several times in meillo@21: short intervals, in case of previous failure. meillo@21: In mmh, the program aborts at once if the fork failed. meillo@21: The user can reexecute the command then. This is expected to be a meillo@21: very rare case on modern systems, especially personal ones, which are meillo@21: common today. meillo@21: meillo@12: meillo@58: .H2 "Attachments meillo@22: .P meillo@58: MIME meillo@58: meillo@58: meillo@58: .H2 "Digital Cryptography meillo@22: .P meillo@58: Signing and encryption. meillo@58: meillo@58: meillo@58: .H2 "Good Defaults meillo@22: .P meillo@58: foo meillo@58: meillo@58: meillo@58: meillo@58: meillo@58: .H1 "Code style meillo@22: .P meillo@58: foo meillo@58: meillo@58: meillo@58: .H2 "Standard Code meillo@22: .P meillo@58: POSIX meillo@22: meillo@22: meillo@58: .H2 "Separation meillo@14: meillo@58: .U2 "MH Directory Split meillo@0: .P meillo@19: In MH and nmh, a personal setup had consisted of two parts: meillo@19: The MH profile, named meillo@19: .Fn \&.mh_profile meillo@19: and being located directly in the user's home directory. meillo@19: And the MH directory, where all his mail messages and also his personal meillo@19: forms, scan formats, other configuration files are stored. The location meillo@19: of this directory could be user-chosen. The default was to name it meillo@19: .Fn Mail meillo@19: and have it directly in the home directory. meillo@19: .P meillo@19: I've never liked the data storage and the configuration to be intermixed. meillo@19: They are different kinds of data. One part, are the messages, meillo@19: which are the data to operate on. The other part, are the personal meillo@19: configuration files, which are able to change the behavior of the operations. meillo@19: The actual operations are defined in the profile, however. meillo@19: .P meillo@19: When storing data, one should try to group data by its type. meillo@19: There's sense in the Unix file system hierarchy, where configuration meillo@19: file are stored separate (\c meillo@19: .Fn /etc ) meillo@19: to the programs (\c meillo@19: .Fn /bin meillo@19: and meillo@19: .Fn /usr/bin ) meillo@19: to their sources (\c meillo@19: .Fn /usr/src ). meillo@19: Such separation eases the backup management, for instance. meillo@19: .P meillo@19: In mmh, I've reorganized the file locations. meillo@19: Still there are two places: meillo@19: There's the mail storage directory, which, like in MH, contains all the meillo@19: messages, but, unlike in MH, nothing else. meillo@19: Its location still is user-chosen, with the default name meillo@19: .Fn Mail , meillo@19: in the user's home directory. This is much similar to the case in nmh. meillo@19: The configuration files, however, are grouped together in the new directory meillo@19: .Fn \&.mmh meillo@19: in the user's home directory. meillo@19: The user's profile now is a file, named meillo@19: .Fn profile , meillo@19: in this mmh directory. meillo@19: Consistently, the context file and all the personal forms, scan formats, meillo@19: and the like, are also there. meillo@19: .P meillo@19: The naming changed with the relocation. meillo@19: The directory where everything, except the profile, had been stored (\c meillo@19: .Fn $HOME/Mail ), meillo@19: used to be called \fIMH directory\fP. Now, this directory is called the meillo@19: user's \fImail storage\fP. The name \fImmh directory\fP is now given to meillo@19: the new directory meillo@19: (\c meillo@19: .Fn $HOME/.mmh ), meillo@19: containing all the personal configuration files. meillo@19: .P meillo@19: The separation of the files by type of content is logical and convenient. meillo@19: There are no functional differences as any possible setup known to me meillo@19: can be implemented with both approaches, although likely a bit easier meillo@19: with the new approach. The main goal of the change had been to provide meillo@19: sensible storage locations for any type of personal mmh file. meillo@19: .P meillo@19: In order for one user to have multiple MH setups, he can use the meillo@19: environment variable meillo@19: .Ev MH meillo@19: the point to a different profile file. meillo@19: The MH directory (mail storage plus personal configuration files) is meillo@19: defined by the meillo@19: .Pe Path meillo@19: profile entry. meillo@19: The context file could be defined by the meillo@19: .Pe context meillo@19: profile entry or by the meillo@19: .Ev MHCONTEXT meillo@19: environment variable. meillo@19: The latter is useful to have a distinct context (e.g. current folders) meillo@19: in each terminal window, for instance. meillo@19: In mmh, there are three environment variables now. meillo@19: .Ev MMH meillo@19: may be used to change the location of the mmh directory. meillo@19: .Ev MMHP meillo@19: and meillo@19: .Ev MMHC meillo@19: change the profile and context files, respectively. meillo@19: Besides providing a more consistent feel (which simply is the result meillo@19: of being designed anew), the set of personal configuration files can meillo@19: be chosen independently from the profile (including mail storage location) meillo@19: and context, now. Being it relevant for practical use or not, it meillo@19: de-facto is an improvement. However, the main achievement is the meillo@19: split between mail storage and personal configuration files. meillo@17: meillo@0: meillo@58: .H2 "Modularization meillo@0: .P meillo@58: whatnowproc meillo@0: .P meillo@49: The \fIMH library\fP meillo@49: .Fn libmh.a meillo@49: collects a bunch of standard functions that many of the MH tools need, meillo@49: like reading the profile or context files. meillo@49: This doesn't hurt the separation. meillo@49: meillo@58: meillo@58: .H2 "Style meillo@58: .P meillo@58: Code layout, goto, ... meillo@58: meillo@58: meillo@58: meillo@58: meillo@58: .H1 "Concept Exploitation/Homogeniety meillo@58: meillo@58: meillo@58: .H2 "Draft Folder meillo@58: .P meillo@58: Historically, MH provided exactly one draft message, named meillo@58: .Fn draft meillo@58: and meillo@58: being located in the MH directory. When starting to compose another message meillo@58: before the former one was sent, the user had been questioned whether to use, meillo@58: refile or replace the old draft. Working on multiple drafts at the same time meillo@58: was impossible. One could only work on them in alteration by refiling the meillo@58: previous one to some directory and fetching some other one for reediting. meillo@58: This manual draft management needed to be done each time the user wanted meillo@58: to switch between editing one draft to editing another. meillo@58: .P meillo@58: To allow true parallel editing of drafts, in a straight forward way, the meillo@58: draft folder facility exists. It had been introduced already in July 1984 meillo@58: by Marshall T. Rose. The facility was deactivated by default. meillo@58: Even in nmh, the draft folder facility remained deactivated by default. meillo@58: At least, Richard Coleman added the man page meillo@58: .Mp mh-draft(5) meillo@58: to document meillo@58: the feature well. meillo@58: .P meillo@58: The only advantage of not using the draft folder facility is the static meillo@58: name of the draft file. This could be an issue for MH frontends like mh-e. meillo@58: But as they likely want to provide working on multiple drafts in parallel, meillo@58: the issue is only concerning compatibility. The aim of nmh to stay compatible meillo@58: prevented the default activation of the draft folder facility. meillo@58: .P meillo@58: On the other hand, a draft folder is the much more natural concept than meillo@58: a draft message. MH's mail storage consists of folders and messages, meillo@58: the messages named with ascending numbers. A draft message breaks with this meillo@58: concept by introducing a message in a file named meillo@58: .Fn draft . meillo@58: This draft meillo@58: message is special. It can not be simply listed with the available tools, meillo@58: but instead requires special switches. I.e. corner-cases were meillo@58: introduced. A draft folder, in contrast, does not introduce such meillo@58: corner-cases. The available tools can operate on the messages within that meillo@58: folder like on any messages within any mail folders. The only difference meillo@58: is the fact that the default folder for meillo@58: .Pn send meillo@58: is the draft folder, meillo@58: instead of the current folder, like for all other tools. meillo@58: .P meillo@58: The trivial part of the change was activating the draft folder facility meillo@58: by default and setting a default name for this folder. Obviously, I chose meillo@58: the name meillo@58: .Fn +drafts . meillo@58: This made the meillo@82: .Sw -draftfolder meillo@58: and meillo@82: .Sw -draftmessage meillo@58: switches useless, and I could remove them. meillo@58: The more difficult but also the part that showed the real improvement, meillo@58: was updating the tools to the new concept. meillo@82: .Sw -draft meillo@58: switches could meillo@58: be dropped, as operating on a draft message became indistinguishable to meillo@58: operating on any other message for the tools. meillo@58: .Pn comp meillo@58: still has its meillo@82: .Sw -use meillo@58: switch for switching between its two modes: (1) Compose a new meillo@58: draft, possibly by taking some existing message as a form. (2) Modify meillo@58: an existing draft. In either case, the behavior of meillo@58: .Pn comp is meillo@58: deterministic. There is no more need to query the user. I consider this meillo@58: a major improvement. By making meillo@58: .Pn send meillo@58: simply operate on the current meillo@58: message in the draft folder by default, with message and folder both meillo@58: overridable by specifying them on the command line, it is now possible meillo@58: to send a draft anywhere within the storage by simply specifying its folder meillo@58: and name. meillo@58: .P meillo@58: All theses changes converted special cases to regular cases, thus meillo@58: simplifying the tools and increasing the flexibility. meillo@58: meillo@58: meillo@58: .H2 "Trash Folder meillo@58: .P meillo@58: Similar to the situation for drafts is the situation for removed messages. meillo@58: Historically, a message was deleted by renaming. A specific meillo@58: \fIbackup prefix\fP, often comma (\c meillo@58: .Fn , ) meillo@58: or hash (\c meillo@58: .Fn # ), meillo@58: being prepended to the file name. Thus, MH wouldn't recognize the file meillo@58: as a message anymore, as only files whose name consists of digits only meillo@58: are treated as messages. The removed messages remained as files in the meillo@58: same directory and needed some maintenance job to truly delete them after meillo@58: some grace time. Usually, by running a command similar to meillo@82: .VS meillo@82: find /home/user/Mail -ctime +7 -name ',*' | xargs rm meillo@82: VE meillo@58: in a cron job. Within the grace time interval meillo@58: the original message could be restored by stripping the meillo@58: the backup prefix from the file name. If however, the last message of meillo@58: a folder is been removed \(en say message meillo@58: .Fn 6 meillo@58: becomes file meillo@58: .Fn ,6 meillo@58: \(en and a new message enters the same folder, thus the same meillo@58: numbered being given again \(en in our case meillo@58: .Fn 6 meillo@58: \(en, if that one meillo@58: is removed too, then the backup of the former message gets overwritten. meillo@58: Thus, the ability to restore removed messages does not only depend on meillo@58: the ``sweeping cron job'' but also on the removing of further messages. meillo@58: This is undesirable, because the real mechanism is hidden from the user meillo@58: and the consequences of further removals are not always obvious. meillo@58: Further more, the backup files are scattered within the whole mail meillo@58: storage, instead of being collected at one place. meillo@58: .P meillo@58: To improve the situation, the profile entry meillo@58: .Pe rmmproc meillo@58: (previously named meillo@58: .Pe Delete-Prog ) meillo@58: was introduced, very early. meillo@58: It could be set to any command, which would care for the mail removal meillo@58: instead of taking the default action, described above. meillo@58: Refiling the to-be-removed files to some garbage folder was a common meillo@58: example. Nmh's man page meillo@58: .Mp rmm(1) meillo@58: proposes meillo@58: .Cl "refile +d meillo@58: to move messages to the garbage folder and meillo@58: .Cl "rm `mhpath +d all` meillo@58: the empty the garbage folder. meillo@58: Managing the message removal this way is a sane approach. It keeps meillo@58: the removed messages in one place, makes it easy to remove the backup meillo@58: files, and, most important, enables the user to use the tools of MH meillo@58: itself to operate on the removed messages. One can meillo@58: .Pn scan meillo@58: them, meillo@58: .Pn show meillo@58: them, and restore them with meillo@58: .Pn refile . meillo@58: There's no more meillo@58: need to use meillo@58: .Pn mhpath meillo@58: to switch over from MH tools to Unix tools \(en MH can do it all itself. meillo@58: .P meillo@58: This approach matches perfect with the concepts of MH, thus making meillo@58: it powerful. Hence, I made it the default. And even more, I also meillo@58: removed the old backup prefix approach, as it is clearly less powerful. meillo@58: Keeping unused alternative in the code is a bad choice as they likely meillo@58: gather bugs, by not being constantly tested. Also, the increased code meillo@58: size and more conditions crease the maintenance costs. By strictly meillo@58: converting to the trash folder approach, I simplified the code base. meillo@58: .Pn rmm meillo@58: calls meillo@58: .Pn refile meillo@58: internally to move the to-be-removed meillo@58: message to the trash folder (\c meillo@58: .Fn +trash meillo@58: by default). Messages meillo@58: there can be operated on like on any other message in the storage. meillo@58: The sweep clean, one can use meillo@82: .Cl "rmm -unlink +trash a" , meillo@58: where the meillo@82: .Sw -unlink meillo@58: switch causes the files to be truly unliked instead meillo@58: of moved to the trash folder. meillo@58: meillo@58: meillo@58: .H2 "Path Notations meillo@58: .P meillo@58: foo meillo@58: meillo@58: meillo@58: .H2 "MIME Integration meillo@58: .P meillo@58: user-visible access to whole messages and MIME parts are inherently meillo@58: different meillo@58: meillo@58: meillo@58: .H2 "Of One Cast meillo@58: .P