docs/master

view intro.roff @ 215:3e44b92cfa8c

bib: Minor change for consistency.
author markus schnalke <meillo@marmaro.de>
date Fri, 13 Jul 2012 01:12:07 +0200
parents 1b38b1c3c01d
children 1fa5a74bf138
line source
1 .RN 1
2 .H0 "Introduction
3 .Id introduction
5 .P
6 MH is a set of mail handling tools with a common concept, similar to
7 the Unix tool chest, which is a set of file handling tools with a common
8 concept. \fInmh\fP is the currently most popular implementation of an
9 MH-like mail handling system.
10 This thesis describes an experimental version of nmh, named \fImmh\fP.
11 .P
12 This chapter introduces MH, its history, concepts and how it is used.
13 It describes nmh's code base and community to give the reader
14 a better understanding of the state of mmh when it started off.
15 Furthermore, this chapter outlines the mmh project itself,
16 describing the motivation for it and its goals.
19 .H1 "MH \(en the Mail Handler
20 .Id mh
21 .P
22 MH is a conceptual email system design and its concrete implementation.
23 MH had started as a design proposal at RAND Corporation,
24 where the first implementation followed later.
25 In spirit, MH is similar to Unix, which
26 influenced the world more in being a set of system design concepts
27 than in being a specific software product.
28 The ideas behind Unix are summarized in the \fIUnix philosophy\fP.
29 .[
30 gancarz unix philosophy
31 .]
32 MH follows this philosophy.
34 .U2 "History
35 .P
36 In 1977 at RAND Corporation, Norman Shapiro and Stockton Gaines
37 proposed the design of a new mail handling system,
38 .[
39 shapiro gaines mh proposal
40 .]
41 to superseed RAND's old monolithic \fIMail System\fP (MS).
42 One year later, in 1978, Bruce Borden picked up on the
43 proposal and implemented a prototype, which he called
44 \fIMail Handler\fP (MH).
45 Before the prototype's existence, the concept was
46 believed to be practically unusable.
47 But the prototype \(en written in only three weeks \(en
48 proved successful and replaced MS thereafter.\&
49 .[ [
50 rand note design of mh
51 .], p. 4]
52 .P
53 In the early eighties,
54 the University of California at Irvine (UCI) started to use MH.
55 Marshall T. Rose and John L. Romine then became the driving force.
56 They took over the development and pushed MH forward.
57 .[ [
58 rand note design of mh
59 .], p. 4]
60 RAND had put the code into the public domain by then.
61 MH was developed at UCI at the same time when the Internet appeared,
62 BSD started to support TCP/IP networking,
63 and Eric Allman wrote Sendmail.
64 MH was extended as emailing became more featured.
65 The development of MH was closely related to the development of email RFCs.
66 In the advent of the \fIMultipurpose Internet Mail Extensions\fP (MIME),
67 MH was one of the first implementations of the new email standard.
68 .P
69 In the nineties, the Internet became popular and in December 1996,
70 Richard Coleman initiated the \fINew Mail Handler\fP (nmh) project.
71 Nmh is a fork of MH 6.8.3 and bases heavily on the
72 \fILBL changes\fP by Van Jacobson, Mike Karels and Craig Leres.
73 .[
74 lbl changes
75 .]
76 Colman intended to modernize MH and improve its portability and
77 MIME handling capabilities.
78 The development of MH at UCI stopped after the 6.8.4 release in
79 February 1996, soon after the development of nmh had started.
80 Today, nmh is developed openly in the Internet community.
81 It has almost completely replaced the original MH.
82 Some systems might still provide the old MH, but hardly for good reasons.
83 .P
84 In the last years, the majority of changes in nmh was maintenance work.
85 Nevertheless, the development was revived in December 2011
86 and stayed busy since then.
89 .U2 "Concepts
90 .P
91 MH consists of a set of tools, each covering a specific task of
92 email handling, such as composing a message, replying to a message,
93 refiling a message to a different folder, listing the messages in a folder.
94 The tools are invoked directly from the Unix shell.
95 .[
96 a rand note design of mh
97 .]
98 .P
99 The tools operate on a common mail storage, which consists of
100 \fImail folders\fP (directories) and \fPmessages\fP (regular files).
101 Each message is stored in a separate file.
102 .[
103 a rand note design of mh
104 .]
105 The files are named with ascending numbers in each folder.
106 The specific format of the mail storage characterizes MH in the same way
107 as the format of the file system characterizes Unix.
108 .P
109 MH tools maintain a \fIcontext\fP, which includes for instance the
110 current mail folder.
111 Processes in Unix have a similar context, containing the current working
112 directory, for instance. In contrast, the process context is maintained
113 by the Unix kernel automatically, whereas MH tools need to maintain the MH
114 context themselves.
115 The user can have one MH context or multiple ones; he can even share it
116 with others.
117 .P
118 Messages are named by their numeric filename,
119 but they can have symbolic names, as well.
120 These are either one of six system-controlled position names
121 and a shorthand for the range of all messages,
122 or user-settable group names for arbitrary sets of messages.
123 These names are called sequences.
124 Automatically updated position names exist for the
125 first, last, previous, next, current message, and for the number
126 one beyond the last message.
127 (In mmh, the names of these sequences are abbreviated to the
128 first character.)
129 User-definded sequences can be bound to the folder containing the
130 messages (\fIpublic sequences\fP) or to the user's context
131 (\fIprivate sequences\fP).
132 .P
133 The user's \fIprofile\fP is the file that contains his MH configuration.
134 Default switches for the individual tools can be specified to
135 adjust them to the user's personal preferences.
136 These switches will be automatically supplied whenever the specific
137 tool is invoked.
138 Additionally, a single command can be linked under different names
139 with different default values.
140 Form templates for new messages and replies, as well as format files
141 to adjust the output of tools are easily exchanged in the profile.
142 Almost every part of the system can be adjusted to personal preference.
143 .P
144 The whole system is well scriptable and extensible.
145 New MH tools are built out of or on top of existing ones quickly.
146 MH encourages the user to tailor, extend, and automate the system.
147 As the MH tool chest was modeled after the Unix tool chest, the
148 properties of the latter apply to the former as well.
152 .U2 "Using MH
153 .P
154 Many tutorials to using MH
155 .[
156 rose sweet mh tutorial
157 .]
158 .[
159 moss jackson user's guide for mh
160 .]
161 .[
162 hegardt mh for beginners
163 .]
164 are old, but still they teach the concepts and basics,
165 which remained unchanged.
166 Rose and Romine have written an excellent introduction on a more
167 technical level, with pointers to advanced usage.
168 .[
169 rose romine real work
170 .]
171 For a more recent document, it is strongly recommended to have
172 a look at the \fIMH Book\fP,
173 .[ [
174 peek mh book
175 .], Part II]
176 especially at its online version.
177 .P
178 Following here is a sample mail handling session with mmh.
179 Details might vary to MH and nmh but the look and feel is the same.
181 .so input/mh-session
184 .H1 "nmh
185 .P
186 In order to understand the condition, goals and dynamics of a project,
187 one needs to know the reasons behind them.
188 This section gives background information.
189 .P
190 MH predates the Internet;
191 it comes from times before networking was universal;
192 it comes from times when emailing was small, short and simple.
193 Then, MH grew, spread and adapted to the changes email went through.
194 Its core concepts, however, remained the same.
195 During the eighties, students at UCI actively worked on MH.
196 They added new features and optimized the code for the systems
197 popular at that time.
198 This was in times before POSIX and ANSI C.
199 As large parts of the code stem from this time, today's nmh source code
200 still contains many ancient parts.
201 BSD-specific code and constructs tailored for hardware of that time
202 are frequent.
203 .P
204 Nmh started about one decade after the POSIX and ANSI C standards were
205 released.
206 A more modern coding style entered the code base but still
207 a part of the developers were ``of the old type''.
208 The developer base became more diverse,
209 thus broadening the range of different coding styles.
210 Programming practices from different decades merged in the project.
211 As several peers added code, the system became more a conglomeration
212 of single tools rather than a homogeneous of-one-cast mail system.
213 For that, leadership would have been necessary.
214 Nevertheless, MH's basic concepts held the project together.
215 They were mostly untouched throughout the years.
216 .P
217 Though clearly separated on the surface
218 \(en as a collection of small, separate programs \(en
219 the source code turns out to be fairly interwoven.
220 Multiple separate components are compiled into a program
221 for efficiency reasons.
222 This leads to intricate innards.
223 .P
224 It is visible in nmh that
225 the advent of MIME raised the complexity of email by a magnitude.
226 The MIME-related parts are the most complex ones.
227 It is also visible that MIME support was added on top of the old MH core.
228 MH's tool chest style made this easily possible and encourages
229 such approaches, but unfortunately, it led to duplicated functions
230 and half-hearted implementation of concepts.
231 .P
232 To provide backward-compatibility, it is a common understanding
233 in the nmh community to not change the default settings.
234 In consequence, users need to activate modern features explicitly
235 to be able to use them.
236 The ancient style in which fresh nmh setups remain to appear
237 causes difficulties for new users, as modern email features require
238 additional configuration.
239 The small but mature community around nmh, however, needs little change
240 as they have had their convenient setups for decades.
243 .H1 "mmh
244 .P
245 I started to work on my experimental version in October 2011,
246 basing my work on nmh version \fInmh-1.3-dev\fP.
247 At that time no more than three commits were made to nmh
248 since the beginning of 2011, the latest one being
249 .Ci a01a41d031c796b526329a4170eb23f0ac93b949 ,
250 commited on 2011-04-13.
251 In December, when I announced my work in progress on the
252 nmh-workers mailing list,
253 .[
254 nmh-workers mmh announce December
255 .]
256 nmh's community became active, all of a sudden.
257 This movement was heavily pushed by Paul Vixie's ``edginess'' comment.
258 .[
259 nmh-workers vixie edginess
260 .]
261 After long years of stagnation, nmh became actively developed again.
262 Hence, while I was working on mmh, the community was working on nmh,
263 in parallel but unrelated.
264 .P
265 The name \fImmh\fP may stand for \fImodern mail handler\fP,
266 because the project tries to modernize nmh.
267 Personally however, I prefer to call mmh \fImeillo's mail handler\fP,
268 emphasizing that the project is my version of nmh,
269 following my visions and preferences.
270 (My login name is \fImeillo\fP.)
271 This project model was inspired by \fIdwm\fP,
272 .[
273 dwm website
274 .]
275 which is Anselm Garbe's personal window manager \(en
276 targeted to satisfy Garbe's personal needs whenever conflicts appear.
277 Dwm has retained its lean elegance and its focused character, whereas
278 its community-driven predecessor \fIwmii\fP
279 .[
280 wmii website
281 .]
282 had grown fat over time.
283 The development of mmh should remain focused.
286 .U2 "Motivation
287 .P
288 MH is the most important of very few email systems in a tool chest style.
289 Tool chests are powerful because they can be perfectly automated and
290 extended.
291 They allow the implementation of arbitrary kinds of front-ends
292 on top of the tool chest quickly and without internal knowledge.
293 Additionally, tool chests are easier to maintain than monolithic
294 programs.
295 MH-like email tool chests should be kept alive as they fill a market
296 niche by providing conceptional elegance and unique scripting qualities.
297 Mmh tries to create a modern and convenient entry point to MH-like
298 systems for new and interested users.
299 .P
300 The mmh project is motivated by deficits of nmh and
301 by my wish for general changes.
302 At the time the mmh project started, nmh had not yet adjusted to
303 modern emailing needs well enough.
304 The default setup was completely unusable for modern emailing.
305 Too much setup work was required.
306 Several modern features were already available,
307 but the community did not want to have them active by default.
308 Mmh is my way to change this.
309 .P
310 In my eyes, MH's concepts could be exploited better and
311 the style of the tools could be improved.
312 Both would simplify and generalize the system, providing cleaner
313 interfaces and greater software leverage at the same time.
314 Mmh is my way to demonstrate this.
315 .P
316 In providing multiple parts of the email system, nmh can hardly
317 compete with the large specialized projects that focus
318 on one of the components only.
319 The situation could be improved by concentrating the development power
320 on the most unique part of MH and letting the user pick his preferred
321 set of other mail components.
322 Today's pre-packaged software components encourage this model.
323 Mmh is my way to provide this.
324 .P
325 It is worthwhile to fork nmh for the development of mmh,
326 because the two projects focus on different goals and differ in
327 fundamental questions.
328 The nmh community's reluctance regarding change conflicts
329 with my strong desire for it.
330 .[
331 nmh-workers schnalke understanding nmh
332 .]
333 In developing a separate experimental version, new approaches can
334 easily be tried out without the need to discuss changes beforehand.
335 In fact, revolutionary changes are hardly possible otherwise.
336 .P
337 The mmh project provides the basis on which the aforementioned
338 ideas can be implemented and demonstrated,
339 without the need to change the nmh project or its community.
340 Of course, the results of the mmh project shall improve nmh, in the end.
341 By no means it is my intent to work against the nmh project.
344 .U2 "Target Field
345 .P
346 Any effort needs to be targeted towards a specific goal
347 in order to be successful.
348 Therefore, a description of an imagined typical mmh user follows.
349 Actually, as mmh is my personal version of MH,
350 this is sort of a description of myself.
351 Developing software for one's own is a reliable way to produce software
352 that matches the user's desires.
353 .P
354 The target user of mmh likes Unix and its philosophy.
355 He appreciates to use programs that are conceptionally appealing.
356 He is familiar with the command line and enjoys its power.
357 He is capable of shell scripting and wants to improve his
358 productivity by scripting the mail system.
359 He uses modern email features, such as attachments,
360 non-ASCII text, digital signatures and message encryption in a natural way.
361 He is able to set up mail system components
362 and likes to pick the ones he prefers.
363 He has a reasonably modern operating system that complies to the
364 POSIX and ANSI C standards.
365 .P
366 The typical user invokes mmh commands directly in an interactive
367 shell session, even on workstations where graphical front-ends could
368 be added.
369 Likely, he runs his mail setup on a server machine,
370 to which he connects via ssh.
371 He might automate mail processing with mmh tools
372 but definitely he uses the tools to build better tools.
373 In any case, he wants to have the flexibility to change
374 his setup to suit his needs.
375 .P
376 The typical mmh user is a programmer.
377 He likes to, occasionally, make use of the opportunity of free software
378 by putting hands on and getting involved in software he uses.
379 In consequence, he likes small and clean code bases and cares for
380 code quality.
381 In general, he believes that:
382 .BU
383 The elegance of source code is most important.
384 .BU
385 Concepts are more important than concrete implementations.
386 .BU
387 Code optimizations for anything but readability should be avoided.
388 .BU
389 Removed code is debugged code.
390 .BU
391 Having a lot of choice is bad.
394 .U2 "Goals of the mmh Project
395 .IP "Streamlining
396 Mmh should be stripped down to its core, which is the user agent (MUA).
397 The feature set should be distilled to the indispensable ones,
398 effectively removing corner cases.
399 Parts that do not add to the main task of being a conceptionally
400 appealing user agent should be removed.
401 This includes the mail transfer and mail retrieval facilities.
402 Choice should be reduced to the main options.
403 All tools should be tightly shaped.
404 .IP "Modernizing
405 Mmh's feature set needs to become more modern.
406 Better support for attachments, digital signatures, and message
407 encryption should be added.
408 MIME support should be integrated deeper and more naturally.
409 The modern email features need to be readily available, out-of-the-box.
410 On the other hand, obsolete facilities can be dropped out and
411 ancient technologies need not be further supported.
412 The available concepts should be expanded as far as possible.
413 A small set of concepts should recur consistently.
414 .IP "Styling
415 Mmh's source code should be updated to modern standards.
416 Standardized library functions should replace non-standard versions
417 whenever possible.
418 Code should be separated into distinct modules when feasible.
419 Time and space optimizations should to be replaced by
420 clear and readable code.
421 A uniform programming style should prevail.
422 The whole system should appear to be of-one-style;
423 it should feel like being cast as one.