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