rev |
line source |
meillo@58
|
1 .H0 "Discussion
|
meillo@0
|
2 .P
|
meillo@58
|
3 This main chapter discusses the practical work done in the mmh project.
|
meillo@58
|
4 It is structured along the goals to achieve. The concrete work done
|
meillo@58
|
5 is described in the examples of how the general goals were achieved.
|
meillo@58
|
6
|
meillo@58
|
7
|
meillo@58
|
8
|
meillo@58
|
9
|
meillo@58
|
10 .H1 "Stream-lining
|
meillo@58
|
11
|
meillo@0
|
12 .P
|
meillo@58
|
13 MH had been considered an all-in-one system for mail handling.
|
meillo@58
|
14 The community around nmh has a similar understanding.
|
meillo@58
|
15 In fundamental difference, I believe that mmh should be a MUA but
|
meillo@58
|
16 nothing more. I believe that all-in-one mail systems are not the way
|
meillo@58
|
17 to go. There are excellent specialized MTAs, like Postfix;
|
meillo@58
|
18 there are specialized MDAs, like Procmail; there are specialized
|
meillo@58
|
19 MRAs, like Fetchmail. I believe it's best to use them instead of
|
meillo@58
|
20 providing the same function ourselves. Doing something well requires to
|
meillo@58
|
21 focus on this particular aspect or a small set of aspects. The more
|
meillo@58
|
22 it is possible to focus, the better the result in this particular
|
meillo@58
|
23 area will be. The limiting resource in Free Software community development
|
meillo@58
|
24 usually is human power. If the low development power is even parted
|
meillo@58
|
25 into multiple development areas, it will hardly be possible to
|
meillo@58
|
26 compete with the specialists in the various fields. This is even
|
meillo@58
|
27 increased, given the small community \(en developers and users \(en
|
meillo@58
|
28 that MH-based mail systems have. In consequence, I believe that the
|
meillo@58
|
29 available resources should be concentrated at the point where MH is
|
meillo@58
|
30 most unique. This is clearly the MUA part.
|
meillo@58
|
31 .P
|
meillo@60
|
32 The goal for mmh was to remove peripheral parts and stream-line
|
meillo@60
|
33 it for the MUA task.
|
meillo@60
|
34
|
meillo@60
|
35
|
meillo@60
|
36 .H2 "Removal of Mail Transfer Facilities
|
meillo@60
|
37 .P
|
meillo@60
|
38 In contrast to nmh, which also provides mail submission and mail retrieval
|
meillo@60
|
39 facilities, mmh is a MUA only.
|
meillo@66
|
40 This general difference in the view on the character of nmh
|
meillo@66
|
41 strongly supported the development of mmh.
|
meillo@66
|
42 Removing the mail transfer facilities had been the first work task
|
meillo@66
|
43 for the mmh project.
|
meillo@60
|
44 .P
|
meillo@66
|
45 The MSA is called \fIMessage Transfer Service\fP (MTS) in nmh.
|
meillo@60
|
46 The facility establishes TCP/IP connections and speaks SMTP to submit
|
meillo@60
|
47 messages for relay to the outside world.
|
meillo@60
|
48 This part is implemented in the
|
meillo@60
|
49 .Pn post
|
meillo@60
|
50 command.
|
meillo@60
|
51 Demanded by the changes in
|
meillo@60
|
52 emailing, this part of nmh required changes in the last years.
|
meillo@60
|
53 Encrypted connections needed to be supported, hence SASL was introduced
|
meillo@60
|
54 into nmh. This added complexity to the nmh without improving it in
|
meillo@60
|
55 its core functions. Also, keeping up with recent developments in
|
meillo@60
|
56 this field needs requires development power and specialists.
|
meillo@60
|
57 Mmh cuts this whole facility off and depends on an external MTA instead.
|
meillo@60
|
58 The only outgoing interface available to mmh is the
|
meillo@60
|
59 .Pn sendmail
|
meillo@60
|
60 command.
|
meillo@60
|
61 Almost any MTA provides a
|
meillo@60
|
62 .Pn sendmail
|
meillo@60
|
63 command.
|
meillo@60
|
64 It not, any program can be substituted if it reads the
|
meillo@60
|
65 message from the standard input, extracts the recipient addresses
|
meillo@60
|
66 from the message header and does not conflict
|
meillo@60
|
67 with sendmail-specific command line arguments.
|
meillo@60
|
68 .P
|
meillo@60
|
69 To retrieve mail, the
|
meillo@60
|
70 .Pn inc
|
meillo@60
|
71 command in nmh has the ability to establish TCP/IP connections
|
meillo@60
|
72 and speaks POP3 to retrieve mail from remote servers.
|
meillo@60
|
73 As with mail submission, here encrypted connections are required
|
meillo@60
|
74 today, thus SASL support was added.
|
meillo@60
|
75 As POP3 is superseded by IMAP more and more, support for message
|
meillo@60
|
76 retrieval through IMAP will become necessary to be added soon.
|
meillo@60
|
77 Mmh has no support for retrieving mail from remote locations.
|
meillo@60
|
78 It depends on an external tool to cover this task.
|
meillo@60
|
79 There are two ways for messages to enter mmh's mail storage:
|
meillo@60
|
80 Incorporate them with
|
meillo@60
|
81 .Pn inc
|
meillo@60
|
82 from the system maildrop, or with
|
meillo@60
|
83 .Pn rcvstore
|
meillo@60
|
84 from the standard input.
|
meillo@66
|
85 In consequence, mmh has not any longer networking code
|
meillo@66
|
86 and thus does no more need to do transfer encryption and authentication.
|
meillo@66
|
87 Two large functional units are removed.
|
meillo@60
|
88 .P
|
meillo@60
|
89 With the removal of the MSA and MRA, mmh converted from an all-in-one
|
meillo@66
|
90 mail system to being only a MUA.
|
meillo@60
|
91 Following the Unix philosophy, it focuses on one job and to do that well.
|
meillo@60
|
92 Now, of course, mmh depends on third-party software.
|
meillo@60
|
93 An external MTA/MSA is required to transfer mail to the outside world;
|
meillo@60
|
94 an external MRA is required to retrieve mail from remote machines.
|
meillo@60
|
95 There exist excellent implementations of such software,
|
meillo@60
|
96 which do this specific task likely much better than the internal
|
meillo@60
|
97 versions of nmh do it. Also, this provides the choice for the best
|
meillo@60
|
98 suiting one of the available implementation.
|
meillo@60
|
99 .P
|
meillo@60
|
100 As it had already been possible to use an external MSA or MRA,
|
meillo@60
|
101 why not keep the internal version for convenience?
|
meillo@60
|
102 If this would question the sense in having a fall-back pager in all
|
meillo@60
|
103 the command line tools, in case
|
meillo@60
|
104 .Pn more
|
meillo@60
|
105 or
|
meillo@60
|
106 .Pn less
|
meillo@60
|
107 wouldn't be available, the answer is intuitively seen.
|
meillo@60
|
108 Now, an MSA or MRA is clearly more complex than a text pager, but
|
meillo@60
|
109 still the concept holds: If programs become complex, split them;
|
meillo@60
|
110 if projects become complex, split them.
|
meillo@60
|
111 Complexity is demanded by the problem to solve. Decades ago,
|
meillo@60
|
112 emailing had been small and simple.
|
meillo@60
|
113 (Remember,
|
meillo@60
|
114 .Pn /bin/mail
|
meillo@66
|
115 had once covered anything there was to email and still had been small.)
|
meillo@60
|
116 As the complexity in emailing increased, MH remainded mostly unchanged.
|
meillo@60
|
117 Nontheless, in nmh the POP server, which the original MH had included,
|
meillo@60
|
118 was removed. Now is the time to take one step further and remove
|
meillo@60
|
119 the MSA and MRA.
|
meillo@60
|
120 Not only does it decrease the code amount of the project,
|
meillo@60
|
121 but more important, it removes the whole field of message transfer
|
meillo@60
|
122 with all its implications from the project.
|
meillo@60
|
123 .P
|
meillo@66
|
124 If a project needs some kind of function, there's always the choice
|
meillo@66
|
125 between implementing the the function in the project directly or
|
meillo@66
|
126 depending on a library that provides the function or depending on
|
meillo@66
|
127 a program that provides the function.
|
meillo@66
|
128 Whereas adding the function directly to the project increases the
|
meillo@66
|
129 code size most, it makes the project most independent.
|
meillo@66
|
130 On the other end, interfacing external programs keeps the interface
|
meillo@66
|
131 smallest, but the depencency highest.
|
meillo@66
|
132 Using a library is in the middle.
|
meillo@66
|
133 Adding the function directly to the project is a bad choice for
|
meillo@66
|
134 any function of higher complexity, unless it's not available in other ways.
|
meillo@66
|
135 Hence, the dependencies only change in kind, not in their existence.
|
meillo@66
|
136 In mmh, library dependencies on
|
meillo@66
|
137 .Pn libsasl2
|
meillo@66
|
138 and
|
meillo@66
|
139 .Pn libcrypto /\c
|
meillo@66
|
140 .Pn libssl
|
meillo@66
|
141 were treated against program dependencies on an MSA and an MRA.
|
meillo@66
|
142 Besides program dependencies providing the stronger separation
|
meillo@66
|
143 and being more flexible, they also allowed
|
meillo@66
|
144 over 6\|000 lines of code to be removed from mmh.
|
meillo@66
|
145 This made mmh's code base about 12\|% smaller.
|
meillo@66
|
146 Reducing the projects code size by such an amount without actually
|
meillo@66
|
147 losing function is a convincing argument.
|
meillo@66
|
148 .P
|
meillo@66
|
149 Users of MH should have not problem to set up an external MSA and MRA.
|
meillo@60
|
150 Also, the popular MSAs and MRAs have large communities and a lot
|
meillo@60
|
151 of documentation available.
|
meillo@60
|
152 .P
|
meillo@60
|
153 Choices for MSAs range from the full-featured
|
meillo@60
|
154 .I Postfix
|
meillo@60
|
155 over mid-size solutions like
|
meillo@60
|
156 .I masqmail
|
meillo@60
|
157 and
|
meillo@60
|
158 .I dma
|
meillo@60
|
159 to small forwarders like
|
meillo@60
|
160 .I ssmtp
|
meillo@60
|
161 and
|
meillo@60
|
162 .I nullmailer .
|
meillo@60
|
163 Choices for MRAs include
|
meillo@60
|
164 .I fetchmail ,
|
meillo@60
|
165 .I getmail ,
|
meillo@60
|
166 .I mpop
|
meillo@60
|
167 and
|
meillo@60
|
168 .I fdm .
|
meillo@60
|
169
|
meillo@60
|
170
|
meillo@60
|
171 .H2 "Removal of non-MUA Tools
|
meillo@60
|
172 .P
|
meillo@62
|
173 Some of nmh's tools were removed from mmh because they didn't
|
meillo@58
|
174 match the main focus of adding to the MUA's task.
|
meillo@62
|
175 .BU
|
meillo@58
|
176 .Pn conflict
|
meillo@58
|
177 was removed because it is a mail system maintenance tool.
|
meillo@62
|
178 Besides, it even checks
|
meillo@58
|
179 .Fn /etc/passwd
|
meillo@58
|
180 and
|
meillo@58
|
181 .Fn /etc/group
|
meillo@62
|
182 for consistency, which has nothing at all to do with emailing.
|
meillo@58
|
183 The tool might be useful, but it should not be shipped with mmh.
|
meillo@62
|
184 .BU
|
meillo@58
|
185 .Pn rcvtty
|
meillo@58
|
186 was removed because its usecase of writing to the user's terminal
|
meillo@58
|
187 on receiving of mail is hardly wanted today. If users like to be
|
meillo@58
|
188 informed of new mail, then using the shell's
|
meillo@58
|
189 .Ev MAILPATH
|
meillo@62
|
190 variable or graphical notifications are likely more
|
meillo@62
|
191 appealing.
|
meillo@62
|
192 Writing directly to a terminals is hardly ever wanted today.
|
meillo@62
|
193 If though one wants to have it this way, the standard tool
|
meillo@58
|
194 .Pn write
|
meillo@58
|
195 can be used in a way similar to:
|
meillo@58
|
196 .DS
|
meillo@58
|
197 scan -file - | write `id -un`
|
meillo@58
|
198 .DE
|
meillo@62
|
199 .BU
|
meillo@58
|
200 .Pn viamail
|
meillo@62
|
201 was removed when the new attachment system was introduced, because
|
meillo@58
|
202 .Pn forw
|
meillo@62
|
203 could can now the task itself.
|
meillo@62
|
204 The program
|
meillo@58
|
205 .Pn sendfiles
|
meillo@62
|
206 was rewritten as a shell script wrapper around
|
meillo@58
|
207 .Pn forw .
|
meillo@62
|
208 .BU
|
meillo@58
|
209 .Pn msgchk
|
meillo@62
|
210 was removed, because it lost its usefulness when POP support was removed.
|
meillo@58
|
211 .Pn msgchk
|
meillo@62
|
212 provides hardly more information than:
|
meillo@58
|
213 .DS
|
meillo@58
|
214 ls -l /var/mail/meillo
|
meillo@58
|
215 .DE
|
meillo@62
|
216 It does separate between old and new mail, but that's merely a detail
|
meillo@62
|
217 and can be done with
|
meillo@58
|
218 .Pn stat (1)
|
meillo@62
|
219 too.
|
meillo@62
|
220 A very small shell script could be written to output the information
|
meillo@62
|
221 in a convenient way, if truly necessary.
|
meillo@58
|
222 As mmh's inc only incorporates mail from the user's local maildrop
|
meillo@62
|
223 and thus no data transfers over slow networks are involved,
|
meillo@62
|
224 there's hardly need to check for new mail before incorporating it.
|
meillo@62
|
225 .BU
|
meillo@58
|
226 .Pn msh
|
meillo@62
|
227 was removed because the tool was in conflict with the
|
meillo@58
|
228 philosophy of MH. It provided an interactive shell to access the
|
meillo@58
|
229 features of MH. One major feature of MH is being a tool chest.
|
meillo@58
|
230 .Pn msh
|
meillo@58
|
231 wouldn't be just another shell, tailored to the needs of mail
|
meillo@58
|
232 handling, but one large program to have the MH tools built in.
|
meillo@58
|
233 It's main use was for accessing Bulletin Boards, which have seized to
|
meillo@62
|
234 be popular.
|
meillo@62
|
235 .P
|
meillo@62
|
236 Removing
|
meillo@58
|
237 .Pn msh ,
|
meillo@62
|
238 together with the truly obsolete code relicts
|
meillo@58
|
239 .Pn vmh
|
meillo@58
|
240 and
|
meillo@58
|
241 .Pn wmh ,
|
meillo@62
|
242 saved more than 7\|000 lines of C code \(en
|
meillo@66
|
243 about 15\|% of the project's original source code amount.
|
meillo@63
|
244 Having the same functionality in less code (with equal readability,
|
meillo@63
|
245 of course) is an advantage.
|
meillo@63
|
246 Less code means less bugs and less maintenance work.
|
meillo@63
|
247 If
|
meillo@63
|
248 .Pn rcvtty
|
meillo@63
|
249 and
|
meillo@63
|
250 .Pn msgchk
|
meillo@63
|
251 are rarely used and can be implemented in different ways,
|
meillo@63
|
252 then why should one keep them?
|
meillo@63
|
253 .Pn viamail 's
|
meillo@63
|
254 use case is now partly obsolete and partly covered by
|
meillo@63
|
255 .Pn forw ,
|
meillo@63
|
256 hence there's no reason to still have
|
meillo@63
|
257 .Pn viamail
|
meillo@63
|
258 around.
|
meillo@63
|
259 .Pn conflict
|
meillo@63
|
260 is not related with the mail client, and
|
meillo@63
|
261 .Pn msh
|
meillo@63
|
262 conflicts with the basic concept of MH.
|
meillo@63
|
263 Both tools could still be useful, but not as part of mmh.
|
meillo@63
|
264 .P
|
meillo@63
|
265 It is a design goal of mmh to remove those parts that are rarely used.
|
meillo@63
|
266 The project shall become more stream-lined.
|
meillo@63
|
267 Rarely used and loosely related tools distract from the lean appearance.
|
meillo@63
|
268 They require maintenance cost without adding to the core task.
|
meillo@63
|
269 Therefore they were removed.
|
meillo@0
|
270
|
meillo@58
|
271
|
meillo@62
|
272 .H2 "Merge of \f(CWshow\fP and \f(CWmhshow\fP
|
meillo@58
|
273 .P
|
meillo@69
|
274 Since the very beginning \(en already in the first concept paper \(en
|
meillo@58
|
275 .Pn show
|
meillo@62
|
276 had been MH's message display program.
|
meillo@58
|
277 .Pn show
|
meillo@58
|
278 found out which pathnames the relevant messages had and invoked
|
meillo@58
|
279 .Pn mhl
|
meillo@62
|
280 then to have the content formated.
|
meillo@58
|
281 With the advent of MIME, this approach wasn't sufficient anymore.
|
meillo@58
|
282 MIME messages can consist of multiple parts, some of which aren't
|
meillo@62
|
283 directly displayable, and text content might be encoded in
|
meillo@58
|
284 foreign charsets.
|
meillo@58
|
285 .Pn show 's
|
meillo@58
|
286 simple approach and
|
meillo@58
|
287 .Pn mhl 's
|
meillo@58
|
288 limited display facilities couldn't cope with the task any longer.
|
meillo@62
|
289 .P
|
meillo@69
|
290 Instead of extending these tools, additional ones were written from scratch
|
meillo@58
|
291 and then added to the MH tool chest. Doing so is encouraged by the
|
meillo@58
|
292 tool chest approach. The new tools could be added without interfering
|
meillo@62
|
293 with the existing ones. This is great. The ease of adding new tools
|
meillo@62
|
294 even made MH the first MUA to implement MIME.
|
meillo@58
|
295 .P
|
meillo@62
|
296 First, the new MIME features were added in form of the single program
|
meillo@58
|
297 .Pn mhn .
|
meillo@58
|
298 The command
|
meillo@62
|
299 .Cl "mhn \-show 42
|
meillo@58
|
300 would show the MIME message numbered 42.
|
meillo@58
|
301 With the 1.0 release of nmh in February 1999, Richard Coleman finished
|
meillo@58
|
302 the split of
|
meillo@58
|
303 .Pn mhn
|
meillo@58
|
304 into a set of specialized programs, which together covered the
|
meillo@62
|
305 multiple aspects of MIME. One of these resulting tools was
|
meillo@69
|
306 .Pn mhshow ,
|
meillo@69
|
307 which replaced the
|
meillo@62
|
308 .Cl "mhn \-show
|
meillo@62
|
309 call.
|
meillo@62
|
310 .P
|
meillo@69
|
311 From then on, two message display tools were part of nmh.
|
meillo@69
|
312 Because it should not require user actions to invoke the right tool
|
meillo@69
|
313 whether the message uses MIME or not,
|
meillo@69
|
314 .Pn show
|
meillo@69
|
315 was extended to automatically hand the job over to
|
meillo@69
|
316 .Pn mhshow
|
meillo@69
|
317 if displaying the message would be beyond
|
meillo@69
|
318 .Pn show 's
|
meillo@69
|
319 abilities.
|
meillo@69
|
320 For convenience,
|
meillo@69
|
321 .Pn show
|
meillo@69
|
322 would still display MIME messages if they contained only a single text
|
meillo@69
|
323 part.
|
meillo@69
|
324 In consequence, the user would invoke
|
meillo@69
|
325 .Pn show
|
meillo@69
|
326 (possibly through
|
meillo@69
|
327 .Pn next
|
meillo@69
|
328 or
|
meillo@69
|
329 .Pn prev )
|
meillo@69
|
330 and get the message printed with either
|
meillo@69
|
331 .Pn show
|
meillo@69
|
332 or
|
meillo@69
|
333 .Pn mhshow ,
|
meillo@69
|
334 whatever was more appropriate.
|
meillo@69
|
335 (There was also a switch for
|
meillo@69
|
336 .Pn show
|
meillo@69
|
337 to never invoke
|
meillo@69
|
338 .Pn mhshow .)
|
meillo@69
|
339 .P
|
meillo@69
|
340 Having two similar tools for essentially the same task is redundant.
|
meillo@69
|
341 Both programs needed to be developed syncronously as they were
|
meillo@69
|
342 used as a single tool by the user. Thus they needed to act in a
|
meillo@69
|
343 similar way to not distract the user.
|
meillo@69
|
344 .P
|
meillo@69
|
345 Today, non-MIME messages are rather seen to be a special case of
|
meillo@69
|
346 MIME messages, than MIME messages are seen to be an extension to
|
meillo@69
|
347 original mail.
|
meillo@69
|
348 As
|
meillo@69
|
349 .Pn mhshow
|
meillo@69
|
350 had already be able to display non-MIME messages, it was natural
|
meillo@69
|
351 to drop
|
meillo@69
|
352 .Pn show
|
meillo@69
|
353 in favor of using
|
meillo@69
|
354 .Pn mhshow
|
meillo@69
|
355 exclusively.
|
meillo@72
|
356 .Ci 4c1efddfd499300c7e74263e57d8aa137e84c853
|
meillo@69
|
357 This decision follows the idea of orthogonal design.
|
meillo@69
|
358 .P
|
meillo@69
|
359 To allow this replacement,
|
meillo@69
|
360 .Pn mhshow
|
meillo@69
|
361 was reworked to behave more like
|
meillo@69
|
362 .Pn show
|
meillo@69
|
363 first.
|
meillo@69
|
364 Section XXX describes this rework from a different perspective.
|
meillo@69
|
365 Once the tools behaved similar, the replacing became a natural decision.
|
meillo@69
|
366 In mmh,
|
meillo@69
|
367 .Pn show
|
meillo@69
|
368 is the one single message display program again, but it handles
|
meillo@69
|
369 MIME messages as well as non-MIME messages.
|
meillo@69
|
370 There's only one program to maintain and users don't need to deal
|
meillo@69
|
371 with the existance of two display programs.
|
meillo@69
|
372 .P
|
meillo@69
|
373 Though, there's one reason why removing the old
|
meillo@69
|
374 .Pn show
|
meillo@69
|
375 hurts: It had been such a simple program.
|
meillo@69
|
376 Its lean elegance is missing to
|
meillo@69
|
377 .Pn mhshow ,
|
meillo@69
|
378 i.e. the new
|
meillo@69
|
379 .Pn show .
|
meillo@69
|
380 But there is no chance, because supporting MIME causes essentially
|
meillo@69
|
381 higher complexity.
|
meillo@58
|
382
|
meillo@58
|
383
|
meillo@58
|
384 .H2 "Removal of Configure Options
|
meillo@58
|
385 .P
|
meillo@72
|
386 Choice is a double-edged sword.
|
meillo@72
|
387 It allows customization and thus better suiting solutions,
|
meillo@72
|
388 but that comes with costs.
|
meillo@72
|
389 First, there is the cost of code complexity to have choice.
|
meillo@72
|
390 Second, there is the cost of less tested setups, because there are
|
meillo@72
|
391 more possible setups and especially corner-cases.
|
meillo@72
|
392 Third, there is the cost of choice itself.
|
meillo@72
|
393 The code complexity affects the developers.
|
meillo@72
|
394 Less tested code affects both, users and developers.
|
meillo@72
|
395 The problem of choice affects the users, for once simply by having to
|
meillo@72
|
396 choose but also by complexer interfaces that require more documentation.
|
meillo@72
|
397 Whenever options add little advantages, they should be considered for
|
meillo@72
|
398 removal.
|
meillo@72
|
399 .P
|
meillo@72
|
400 I have reduced the number of project-specific configure options from
|
meillo@72
|
401 fifteen to three.
|
meillo@72
|
402 .BU
|
meillo@72
|
403 With the removal of the mail transfer facilities five option vanished:
|
meillo@72
|
404 .IP \f(CW--with-mts=[smtp|sendmail]\fP
|
meillo@72
|
405 Specified the default mail transport service, which now is sendmail always.
|
meillo@72
|
406 .IP \f(CW--with-smtpservers=[server1...]\fP
|
meillo@72
|
407 Specified the default SMTP servers for the smtp mail transfer service.
|
meillo@72
|
408 .Ci 128545e06224233b7e91fc4c83f8830252fe16c9
|
meillo@72
|
409 .IP \f(CW--with-cyrus-sasl\fP
|
meillo@72
|
410 Enabled SASL support for mail transfer.
|
meillo@72
|
411 .IP \f(CW--with-tls\fP
|
meillo@72
|
412 Enabled TLS support for mail transfer.
|
meillo@72
|
413 .IP \f(CW--enable-pop\fP
|
meillo@72
|
414 Enabled the message retrieval facility.
|
meillo@72
|
415 .BU
|
meillo@72
|
416 --with-ndbm=ARG use -lARG to link with ndbm
|
meillo@72
|
417 --with-ndbmheader=ARG #include <ARG> to use ndbm
|
meillo@72
|
418
|
meillo@72
|
419 .BU
|
meillo@72
|
420 The default backup prefix, i.e. the string that was prepended to message
|
meillo@72
|
421 filenames to tag them as deleted, had been the comma `\f(CW,\fP'.
|
meillo@72
|
422 There was a configure option to change the default to the hash symbol
|
meillo@72
|
423 `\f(CW#\fP':
|
meillo@72
|
424 .CW --with-hash-backup .
|
meillo@72
|
425 The implication of the hash symbol is that it introduces a comment
|
meillo@72
|
426 in the Unix shell.
|
meillo@72
|
427 Thus, the command line
|
meillo@72
|
428 .Cl "rm #13 #15
|
meillo@72
|
429 calls
|
meillo@72
|
430 .Pn rm
|
meillo@72
|
431 without arguments because the first hash symbol starts the comment
|
meillo@72
|
432 that reaches until the end of the line.
|
meillo@72
|
433 To delete the backup files,
|
meillo@72
|
434 .Cl "rm ./#13 ./#15"
|
meillo@72
|
435 needs to be used.
|
meillo@72
|
436 .\" XXX check historical background
|
meillo@72
|
437 Besides this effect, the choice was personal preference.
|
meillo@72
|
438 I removed the configure option but added the profile entry
|
meillo@72
|
439 .Pe backup-prefix ,
|
meillo@72
|
440 which allows to specify an arbitrary string as backup prefix.
|
meillo@72
|
441 .Ci 6c40d481d661d532dd527eaf34cebb6d3f8ed086
|
meillo@72
|
442 This did not remove the choice but moved it to a location where
|
meillo@72
|
443 it suited better.
|
meillo@72
|
444 Profile entries are the common method to change mmh's behavior.
|
meillo@72
|
445 The name of the
|
meillo@72
|
446 .Fn .mh-sequences ,
|
meillo@72
|
447 for instance, is specified there, too.
|
meillo@72
|
448 Moving the specification of the backup prefix there, appears to be right.
|
meillo@72
|
449 Eventually, the new trash folder obsoleted the concept of the
|
meillo@72
|
450 backup prefix completely.
|
meillo@72
|
451 (Well, there still are corner-cases to remove until the backup
|
meillo@72
|
452 prefix can be layed to rest, eventually.)
|
meillo@72
|
453 .\" FIXME: Do this work in the code!
|
meillo@72
|
454
|
meillo@72
|
455
|
meillo@72
|
456 .P
|
meillo@72
|
457 --with-editor=EDITOR specify the default editor
|
meillo@72
|
458 --with-pager=PAGER specify the default pager
|
meillo@72
|
459 .Ci 5d43a99db70c12a673028c7758c20cbe3e13ef5f
|
meillo@72
|
460
|
meillo@72
|
461 .P
|
meillo@72
|
462 --disable-mhe disable mhe support
|
meillo@72
|
463 .Ci a7ce7b4a580d77b6c2c4d980812beb589aa4c643
|
meillo@72
|
464
|
meillo@72
|
465 .P
|
meillo@72
|
466 --enable-masquerade='draft_from mmailid username_extension' enable up to 3 types of address masquerading
|
meillo@72
|
467 --with-locking=[dot|fcntl|flock|lockf] specify the file locking method
|
meillo@72
|
468 --disable-locale turn off locale features
|
meillo@72
|
469
|
meillo@72
|
470
|
meillo@58
|
471
|
meillo@63
|
472
|
meillo@58
|
473 .H2 "Removal of switches
|
meillo@58
|
474 .P
|
meillo@58
|
475
|
meillo@58
|
476
|
meillo@58
|
477
|
meillo@58
|
478
|
meillo@58
|
479 .H1 "Moderizing
|
meillo@58
|
480
|
meillo@58
|
481
|
meillo@58
|
482 .H2 "Removal of Code Relicts
|
meillo@0
|
483 .P
|
meillo@51
|
484 The code base of mmh originates from the late Seventies,
|
meillo@51
|
485 had been extensively
|
meillo@51
|
486 worked on in the mid Eighties, and had been partly reorganized and extended
|
meillo@51
|
487 in the Nineties. Relicts of all those times had gathered in the code base.
|
meillo@12
|
488 My goal was to remove any ancient code parts. One part of the task was
|
meillo@12
|
489 converting obsolete code constructs to standard constructs, the other part
|
meillo@12
|
490 was dropping obsolete functions.
|
meillo@12
|
491 .P
|
meillo@12
|
492 As I'm not even thirty years old and have no more than seven years of
|
meillo@51
|
493 Unix experience, I needed to learn about the history in retrospective.
|
meillo@51
|
494 Older people likely have used those ancient constructs themselves
|
meillo@51
|
495 and have suffered from their incompatibilities and have longed for
|
meillo@12
|
496 standardization. Unfortunately, I have only read that others had done so.
|
meillo@12
|
497 This put me in a much more difficult positions when working on the old
|
meillo@12
|
498 code. I needed to recherche what other would have known by heart from
|
meillo@12
|
499 experience. All my programming experience comes from a time past ANSI C
|
meillo@12
|
500 and past POSIX. Although I knew about the times before, I took the
|
meillo@51
|
501 current state implicitly for granted most of the time.
|
meillo@12
|
502 .P
|
meillo@12
|
503 Being aware of
|
meillo@12
|
504 these facts, I rather let people with more historic experience solve the
|
meillo@12
|
505 task of converting the ancient code constructs to standardized ones.
|
meillo@12
|
506 Luckily, Lyndon Nerenberg focused on this task at the nmh project.
|
meillo@12
|
507 He converted large parts of the code to POSIX constructs, removing
|
meillo@12
|
508 the conditionals compilation for now standardized features.
|
meillo@12
|
509 I'm thankful for this task being solved. I only pulled the changes into
|
meillo@12
|
510 mmh.
|
meillo@12
|
511 .P
|
meillo@20
|
512 The other task \(en dropping ancient functionality to remove old code \(en
|
meillo@12
|
513 I did myself, though. My position to strip mmh to the bare minimum of
|
meillo@12
|
514 frequently used features is much more revolutional than the nmh community
|
meillo@20
|
515 likes it. Without the need to justify my decisions, I was able to quickly
|
meillo@20
|
516 remove functionality I considered ancient.
|
meillo@20
|
517 The need to discuss my decisions with
|
meillo@20
|
518 peers likely would have slowed this process down. Of course, I researched
|
meillo@12
|
519 if a particular feature really should be dropped. Having not had any
|
meillo@12
|
520 contact to this feature within my computer life was a first indicator to
|
meillo@12
|
521 drop it, but I also asked others and searched the literature for modern
|
meillo@12
|
522 usage of the feature. If it appeared to be truly ancient, I dropped it.
|
meillo@12
|
523 The reason for dropping is always part of the commit message in the
|
meillo@12
|
524 version control system. Thus, it is easy for others to check their
|
meillo@12
|
525 view on the topic with mine and possibly to argue for reinclusion.
|
meillo@12
|
526
|
meillo@12
|
527 .U2 "MMDF maildrop support
|
meillo@12
|
528 .P
|
meillo@12
|
529 I did drop any support for the MMDF maildrop format. This type of format
|
meillo@12
|
530 is conceptionally similar to the mbox format, but uses four bytes with
|
meillo@12
|
531 value 1 (\fL^A^A^A^A\fP) as message delimiter,
|
meillo@18
|
532 instead of the string ``\fLFrom\ \fP''.
|
meillo@12
|
533 Due to the similarity and mbox being the de-facto standard maildrop
|
meillo@12
|
534 format on Unix, but also due to the larger influence of Sendmail than MMDF,
|
meillo@12
|
535 the MMDF maildrop format had vanished.
|
meillo@12
|
536 .P
|
meillo@12
|
537 The simplifications within the code were only moderate. Switches could
|
meillo@12
|
538 be removed from tools like
|
meillo@12
|
539 .L packf ,
|
meillo@12
|
540 which generate packed mailboxes. Only one packed mailbox format remained:
|
meillo@12
|
541 mbox.
|
meillo@12
|
542 The most important changes affect the equally named mail parsing routine in
|
meillo@12
|
543 .L sbr/m_getfld.c .
|
meillo@12
|
544 The direct MMDF code had been removed, but as now only one packed mailbox
|
meillo@12
|
545 format is left, code structure simplifications are likely possible.
|
meillo@12
|
546 The reason why they are still outstanding is the heavily optimized code
|
meillo@18
|
547 of
|
meillo@18
|
548 .Fu m_getfld() .
|
meillo@18
|
549 Changes beyond a small local scope \(en
|
meillo@12
|
550 which restructuring in its core is \(en cause a high risk of damaging
|
meillo@12
|
551 the intricate workings of the optimized code. This problem is know
|
meillo@12
|
552 to the developers of nmh, too. They also avoid touching this minefield
|
meillo@12
|
553 if possible.
|
meillo@12
|
554
|
meillo@12
|
555 .U2 "UUCP Bang Paths
|
meillo@12
|
556 .P
|
meillo@12
|
557 More questionably than the former topic is the removal of support for the
|
meillo@12
|
558 UUCP bang path address style. However, the user may translate the bang
|
meillo@12
|
559 paths on retrieval to Internet addresses and the other way on posting
|
meillo@12
|
560 messages. The former can be done my an MDA like procmail; the latter
|
meillo@12
|
561 by a sendmail wrapper. This would ensure that any address handling would
|
meillo@12
|
562 work as expected. However, it might just work well without any
|
meillo@12
|
563 such modifications, as mmh does not touch addresses much, in general.
|
meillo@12
|
564 But I can't ensure as I have never used an environment with bang paths.
|
meillo@12
|
565 Also, the behavior might break at any point in further development.
|
meillo@12
|
566
|
meillo@12
|
567 .U2 "Hardcopy terminal support
|
meillo@12
|
568 .P
|
meillo@12
|
569 More of a funny anecdote is the remaining of a check for printing to a
|
meillo@12
|
570 hardcopy terminal until Spring 2012, when I finally removed it.
|
meillo@12
|
571 I surely would be very happy to see such a terminal in action, maybe
|
meillo@12
|
572 actually being able to work on it, but I fear my chances are null.
|
meillo@12
|
573 .P
|
meillo@12
|
574 The check only prevented a pager to be placed between the outputting
|
meillo@18
|
575 program (\c
|
meillo@18
|
576 .Pn mhl )
|
meillo@18
|
577 and the terminal. This could have been ensured with
|
meillo@18
|
578 the
|
meillo@18
|
579 .Sw \-nomoreproc
|
meillo@18
|
580 at the command line statically, too.
|
meillo@12
|
581
|
meillo@12
|
582 .U2 "Removed support for header fields
|
meillo@12
|
583 .P
|
meillo@12
|
584 The `Encrypted' header had been introduced by RFC\^822, but already
|
meillo@12
|
585 marked legacy in RFC 2822. It was superseded by FIXME.
|
meillo@12
|
586 Mmh does no more support this header.
|
meillo@12
|
587 .P
|
meillo@21
|
588 Native support for `Face' headers
|
meillo@21
|
589 had been removed, as well.
|
meillo@21
|
590 The feature is similar to the `X-Face' header in its intent,
|
meillo@21
|
591 but takes a different approach to store the image.
|
meillo@21
|
592 Instead of encoding the image data directly into the header,
|
meillo@21
|
593 the the header contains the hostname and UDP port where the image
|
meillo@21
|
594 date could be retrieved.
|
meillo@21
|
595 Neither `X-Face' nor the here described `Face' system
|
meillo@21
|
596 \**
|
meillo@21
|
597 .FS
|
meillo@21
|
598 There is also a newer but different system, invented 2005,
|
meillo@21
|
599 using `Face' headers.
|
meillo@21
|
600 It is the successor of `X-Face' providing colored PNG images.
|
meillo@21
|
601 .FE
|
meillo@21
|
602 became well used in the large scale.
|
meillo@21
|
603 It's still possible to use a Face systems,
|
meillo@21
|
604 although mmh does not provide support for any of the different systems
|
meillo@21
|
605 anymore. It's fairly easy to write a small shell script to
|
meillo@21
|
606 extract the embedded or fetch the external Face data and display the image.
|
meillo@21
|
607 Own Face headers can be added into the draft template files.
|
meillo@21
|
608 .P
|
meillo@12
|
609 `Content-MD5' headers were introduced by RFC\^1864. They provide only
|
meillo@12
|
610 a verification of data corruption during the transfer. By no means can
|
meillo@12
|
611 they ensure verbatim end-to-end delivery of the contents. This is clearly
|
meillo@12
|
612 stated in the RFC. The proper approach to provide verificationability
|
meillo@12
|
613 of content in an end-to-end relationship is the use of digital cryptography
|
meillo@12
|
614 (RFCs FIXME). On the other hand, transfer protocols should ensure the
|
meillo@12
|
615 integrity of the transmission. In combinations these two approaches
|
meillo@12
|
616 make the `Content-MD5' header field useless. In consequence, I removed
|
meillo@12
|
617 the support for it. By this removal, MD5 computation is not needed
|
meillo@12
|
618 anywhere in mmh. Hence, over 500 lines of code were removed by this one
|
meillo@12
|
619 change. Even if the `Content-MD5' header field is useful sometimes,
|
meillo@12
|
620 I value its usefulnes less than the improvement in maintainability, caused
|
meillo@12
|
621 by the removal.
|
meillo@12
|
622
|
meillo@20
|
623 .U2 "Prompter's Control Keys
|
meillo@20
|
624 .P
|
meillo@20
|
625 The program
|
meillo@20
|
626 .Pn prompter
|
meillo@20
|
627 queries the user to fill in a message form. When used by
|
meillo@20
|
628 .Pn comp
|
meillo@20
|
629 as:
|
meillo@20
|
630 .DS
|
meillo@20
|
631 comp \-editor prompter
|
meillo@20
|
632 .DE
|
meillo@20
|
633 the resulting behavior is similar to
|
meillo@20
|
634 .Pn mailx .
|
meillo@51
|
635 Apparently,
|
meillo@20
|
636 .Pn prompter
|
meillo@20
|
637 hadn't been touched lately. Otherwise it's hardly explainable why it
|
meillo@20
|
638 still offered the switches
|
meillo@20
|
639 .Sn \-erase \fUchr\fP
|
meillo@20
|
640 and
|
meillo@20
|
641 .Sn \-kill \fUchr\fP
|
meillo@20
|
642 to name the characters for command line editing.
|
meillo@21
|
643 The times when this had been necessary are long time gone.
|
meillo@20
|
644 Today these things work out-of-the-box, and if not, are configured
|
meillo@20
|
645 with the standard tool
|
meillo@20
|
646 .Pn stty .
|
meillo@20
|
647
|
meillo@21
|
648 .U2 "Vfork and Retry Loops
|
meillo@21
|
649 .P
|
meillo@51
|
650 MH creates many processes, which is a consequence of the tool chest approach.
|
meillo@21
|
651 In earlier times
|
meillo@21
|
652 .Fu fork()
|
meillo@21
|
653 had been an expensive system call, as the process's whole image needed
|
meillo@21
|
654 to be duplicated. One common case is replacing the image with
|
meillo@21
|
655 .Fu exec()
|
meillo@21
|
656 right after having forked the child process.
|
meillo@21
|
657 To speed up this case, the
|
meillo@21
|
658 .Fu vfork()
|
meillo@21
|
659 system call was invented at Berkeley. It completely omits copying the
|
meillo@21
|
660 image. If the image gets replaced right afterwards then unnecessary
|
meillo@21
|
661 work is omited. On old systems this results in large speed ups.
|
meillo@21
|
662 MH uses
|
meillo@21
|
663 .Fu vfork()
|
meillo@21
|
664 whenever possible.
|
meillo@21
|
665 .P
|
meillo@21
|
666 Memory management units that support copy-on-write semantics make
|
meillo@21
|
667 .Fu fork()
|
meillo@21
|
668 almost as fast as
|
meillo@21
|
669 .Fu vfork()
|
meillo@21
|
670 in the cases when they can be exchanged.
|
meillo@21
|
671 With
|
meillo@21
|
672 .Fu vfork()
|
meillo@51
|
673 being more error-prone and hardly faster, it's preferable to simply
|
meillo@21
|
674 use
|
meillo@21
|
675 .Fu fork()
|
meillo@21
|
676 instead.
|
meillo@21
|
677 .P
|
meillo@21
|
678 Related to the costs of
|
meillo@21
|
679 .Fu fork()
|
meillo@21
|
680 is the probability of its success.
|
meillo@21
|
681 Today on modern systems, the system call will succeed almost always.
|
meillo@51
|
682 In the Eighties on heavy loaded systems, as they were common at
|
meillo@21
|
683 universities, this had been different. Thus, many of the
|
meillo@21
|
684 .Fu fork()
|
meillo@21
|
685 calls were wrapped into loops to retry to fork several times in
|
meillo@21
|
686 short intervals, in case of previous failure.
|
meillo@21
|
687 In mmh, the program aborts at once if the fork failed.
|
meillo@21
|
688 The user can reexecute the command then. This is expected to be a
|
meillo@21
|
689 very rare case on modern systems, especially personal ones, which are
|
meillo@21
|
690 common today.
|
meillo@21
|
691
|
meillo@12
|
692
|
meillo@58
|
693 .H2 "Attachments
|
meillo@22
|
694 .P
|
meillo@58
|
695 MIME
|
meillo@58
|
696
|
meillo@58
|
697
|
meillo@58
|
698 .H2 "Digital Cryptography
|
meillo@22
|
699 .P
|
meillo@58
|
700 Signing and encryption.
|
meillo@58
|
701
|
meillo@58
|
702
|
meillo@58
|
703 .H2 "Good Defaults
|
meillo@22
|
704 .P
|
meillo@58
|
705 foo
|
meillo@58
|
706
|
meillo@58
|
707
|
meillo@58
|
708
|
meillo@58
|
709
|
meillo@58
|
710 .H1 "Code style
|
meillo@22
|
711 .P
|
meillo@58
|
712 foo
|
meillo@58
|
713
|
meillo@58
|
714
|
meillo@58
|
715 .H2 "Standard Code
|
meillo@22
|
716 .P
|
meillo@58
|
717 POSIX
|
meillo@22
|
718
|
meillo@22
|
719
|
meillo@58
|
720 .H2 "Separation
|
meillo@14
|
721
|
meillo@58
|
722 .U2 "MH Directory Split
|
meillo@0
|
723 .P
|
meillo@19
|
724 In MH and nmh, a personal setup had consisted of two parts:
|
meillo@19
|
725 The MH profile, named
|
meillo@19
|
726 .Fn \&.mh_profile
|
meillo@19
|
727 and being located directly in the user's home directory.
|
meillo@19
|
728 And the MH directory, where all his mail messages and also his personal
|
meillo@19
|
729 forms, scan formats, other configuration files are stored. The location
|
meillo@19
|
730 of this directory could be user-chosen. The default was to name it
|
meillo@19
|
731 .Fn Mail
|
meillo@19
|
732 and have it directly in the home directory.
|
meillo@19
|
733 .P
|
meillo@19
|
734 I've never liked the data storage and the configuration to be intermixed.
|
meillo@19
|
735 They are different kinds of data. One part, are the messages,
|
meillo@19
|
736 which are the data to operate on. The other part, are the personal
|
meillo@19
|
737 configuration files, which are able to change the behavior of the operations.
|
meillo@19
|
738 The actual operations are defined in the profile, however.
|
meillo@19
|
739 .P
|
meillo@19
|
740 When storing data, one should try to group data by its type.
|
meillo@19
|
741 There's sense in the Unix file system hierarchy, where configuration
|
meillo@19
|
742 file are stored separate (\c
|
meillo@19
|
743 .Fn /etc )
|
meillo@19
|
744 to the programs (\c
|
meillo@19
|
745 .Fn /bin
|
meillo@19
|
746 and
|
meillo@19
|
747 .Fn /usr/bin )
|
meillo@19
|
748 to their sources (\c
|
meillo@19
|
749 .Fn /usr/src ).
|
meillo@19
|
750 Such separation eases the backup management, for instance.
|
meillo@19
|
751 .P
|
meillo@19
|
752 In mmh, I've reorganized the file locations.
|
meillo@19
|
753 Still there are two places:
|
meillo@19
|
754 There's the mail storage directory, which, like in MH, contains all the
|
meillo@19
|
755 messages, but, unlike in MH, nothing else.
|
meillo@19
|
756 Its location still is user-chosen, with the default name
|
meillo@19
|
757 .Fn Mail ,
|
meillo@19
|
758 in the user's home directory. This is much similar to the case in nmh.
|
meillo@19
|
759 The configuration files, however, are grouped together in the new directory
|
meillo@19
|
760 .Fn \&.mmh
|
meillo@19
|
761 in the user's home directory.
|
meillo@19
|
762 The user's profile now is a file, named
|
meillo@19
|
763 .Fn profile ,
|
meillo@19
|
764 in this mmh directory.
|
meillo@19
|
765 Consistently, the context file and all the personal forms, scan formats,
|
meillo@19
|
766 and the like, are also there.
|
meillo@19
|
767 .P
|
meillo@19
|
768 The naming changed with the relocation.
|
meillo@19
|
769 The directory where everything, except the profile, had been stored (\c
|
meillo@19
|
770 .Fn $HOME/Mail ),
|
meillo@19
|
771 used to be called \fIMH directory\fP. Now, this directory is called the
|
meillo@19
|
772 user's \fImail storage\fP. The name \fImmh directory\fP is now given to
|
meillo@19
|
773 the new directory
|
meillo@19
|
774 (\c
|
meillo@19
|
775 .Fn $HOME/.mmh ),
|
meillo@19
|
776 containing all the personal configuration files.
|
meillo@19
|
777 .P
|
meillo@19
|
778 The separation of the files by type of content is logical and convenient.
|
meillo@19
|
779 There are no functional differences as any possible setup known to me
|
meillo@19
|
780 can be implemented with both approaches, although likely a bit easier
|
meillo@19
|
781 with the new approach. The main goal of the change had been to provide
|
meillo@19
|
782 sensible storage locations for any type of personal mmh file.
|
meillo@19
|
783 .P
|
meillo@19
|
784 In order for one user to have multiple MH setups, he can use the
|
meillo@19
|
785 environment variable
|
meillo@19
|
786 .Ev MH
|
meillo@19
|
787 the point to a different profile file.
|
meillo@19
|
788 The MH directory (mail storage plus personal configuration files) is
|
meillo@19
|
789 defined by the
|
meillo@19
|
790 .Pe Path
|
meillo@19
|
791 profile entry.
|
meillo@19
|
792 The context file could be defined by the
|
meillo@19
|
793 .Pe context
|
meillo@19
|
794 profile entry or by the
|
meillo@19
|
795 .Ev MHCONTEXT
|
meillo@19
|
796 environment variable.
|
meillo@19
|
797 The latter is useful to have a distinct context (e.g. current folders)
|
meillo@19
|
798 in each terminal window, for instance.
|
meillo@19
|
799 In mmh, there are three environment variables now.
|
meillo@19
|
800 .Ev MMH
|
meillo@19
|
801 may be used to change the location of the mmh directory.
|
meillo@19
|
802 .Ev MMHP
|
meillo@19
|
803 and
|
meillo@19
|
804 .Ev MMHC
|
meillo@19
|
805 change the profile and context files, respectively.
|
meillo@19
|
806 Besides providing a more consistent feel (which simply is the result
|
meillo@19
|
807 of being designed anew), the set of personal configuration files can
|
meillo@19
|
808 be chosen independently from the profile (including mail storage location)
|
meillo@19
|
809 and context, now. Being it relevant for practical use or not, it
|
meillo@19
|
810 de-facto is an improvement. However, the main achievement is the
|
meillo@19
|
811 split between mail storage and personal configuration files.
|
meillo@17
|
812
|
meillo@0
|
813
|
meillo@58
|
814 .H2 "Modularization
|
meillo@0
|
815 .P
|
meillo@58
|
816 whatnowproc
|
meillo@0
|
817 .P
|
meillo@49
|
818 The \fIMH library\fP
|
meillo@49
|
819 .Fn libmh.a
|
meillo@49
|
820 collects a bunch of standard functions that many of the MH tools need,
|
meillo@49
|
821 like reading the profile or context files.
|
meillo@49
|
822 This doesn't hurt the separation.
|
meillo@49
|
823
|
meillo@58
|
824
|
meillo@58
|
825 .H2 "Style
|
meillo@58
|
826 .P
|
meillo@58
|
827 Code layout, goto, ...
|
meillo@58
|
828
|
meillo@58
|
829
|
meillo@58
|
830
|
meillo@58
|
831
|
meillo@58
|
832 .H1 "Concept Exploitation/Homogeniety
|
meillo@58
|
833
|
meillo@58
|
834
|
meillo@58
|
835 .H2 "Draft Folder
|
meillo@58
|
836 .P
|
meillo@58
|
837 Historically, MH provided exactly one draft message, named
|
meillo@58
|
838 .Fn draft
|
meillo@58
|
839 and
|
meillo@58
|
840 being located in the MH directory. When starting to compose another message
|
meillo@58
|
841 before the former one was sent, the user had been questioned whether to use,
|
meillo@58
|
842 refile or replace the old draft. Working on multiple drafts at the same time
|
meillo@58
|
843 was impossible. One could only work on them in alteration by refiling the
|
meillo@58
|
844 previous one to some directory and fetching some other one for reediting.
|
meillo@58
|
845 This manual draft management needed to be done each time the user wanted
|
meillo@58
|
846 to switch between editing one draft to editing another.
|
meillo@58
|
847 .P
|
meillo@58
|
848 To allow true parallel editing of drafts, in a straight forward way, the
|
meillo@58
|
849 draft folder facility exists. It had been introduced already in July 1984
|
meillo@58
|
850 by Marshall T. Rose. The facility was deactivated by default.
|
meillo@58
|
851 Even in nmh, the draft folder facility remained deactivated by default.
|
meillo@58
|
852 At least, Richard Coleman added the man page
|
meillo@58
|
853 .Mp mh-draft(5)
|
meillo@58
|
854 to document
|
meillo@58
|
855 the feature well.
|
meillo@58
|
856 .P
|
meillo@58
|
857 The only advantage of not using the draft folder facility is the static
|
meillo@58
|
858 name of the draft file. This could be an issue for MH frontends like mh-e.
|
meillo@58
|
859 But as they likely want to provide working on multiple drafts in parallel,
|
meillo@58
|
860 the issue is only concerning compatibility. The aim of nmh to stay compatible
|
meillo@58
|
861 prevented the default activation of the draft folder facility.
|
meillo@58
|
862 .P
|
meillo@58
|
863 On the other hand, a draft folder is the much more natural concept than
|
meillo@58
|
864 a draft message. MH's mail storage consists of folders and messages,
|
meillo@58
|
865 the messages named with ascending numbers. A draft message breaks with this
|
meillo@58
|
866 concept by introducing a message in a file named
|
meillo@58
|
867 .Fn draft .
|
meillo@58
|
868 This draft
|
meillo@58
|
869 message is special. It can not be simply listed with the available tools,
|
meillo@58
|
870 but instead requires special switches. I.e. corner-cases were
|
meillo@58
|
871 introduced. A draft folder, in contrast, does not introduce such
|
meillo@58
|
872 corner-cases. The available tools can operate on the messages within that
|
meillo@58
|
873 folder like on any messages within any mail folders. The only difference
|
meillo@58
|
874 is the fact that the default folder for
|
meillo@58
|
875 .Pn send
|
meillo@58
|
876 is the draft folder,
|
meillo@58
|
877 instead of the current folder, like for all other tools.
|
meillo@58
|
878 .P
|
meillo@58
|
879 The trivial part of the change was activating the draft folder facility
|
meillo@58
|
880 by default and setting a default name for this folder. Obviously, I chose
|
meillo@58
|
881 the name
|
meillo@58
|
882 .Fn +drafts .
|
meillo@58
|
883 This made the
|
meillo@58
|
884 .Sw \-draftfolder
|
meillo@58
|
885 and
|
meillo@58
|
886 .Sw \-draftmessage
|
meillo@58
|
887 switches useless, and I could remove them.
|
meillo@58
|
888 The more difficult but also the part that showed the real improvement,
|
meillo@58
|
889 was updating the tools to the new concept.
|
meillo@58
|
890 .Sw \-draft
|
meillo@58
|
891 switches could
|
meillo@58
|
892 be dropped, as operating on a draft message became indistinguishable to
|
meillo@58
|
893 operating on any other message for the tools.
|
meillo@58
|
894 .Pn comp
|
meillo@58
|
895 still has its
|
meillo@58
|
896 .Sw \-use
|
meillo@58
|
897 switch for switching between its two modes: (1) Compose a new
|
meillo@58
|
898 draft, possibly by taking some existing message as a form. (2) Modify
|
meillo@58
|
899 an existing draft. In either case, the behavior of
|
meillo@58
|
900 .Pn comp is
|
meillo@58
|
901 deterministic. There is no more need to query the user. I consider this
|
meillo@58
|
902 a major improvement. By making
|
meillo@58
|
903 .Pn send
|
meillo@58
|
904 simply operate on the current
|
meillo@58
|
905 message in the draft folder by default, with message and folder both
|
meillo@58
|
906 overridable by specifying them on the command line, it is now possible
|
meillo@58
|
907 to send a draft anywhere within the storage by simply specifying its folder
|
meillo@58
|
908 and name.
|
meillo@58
|
909 .P
|
meillo@58
|
910 All theses changes converted special cases to regular cases, thus
|
meillo@58
|
911 simplifying the tools and increasing the flexibility.
|
meillo@58
|
912
|
meillo@58
|
913
|
meillo@58
|
914 .H2 "Trash Folder
|
meillo@58
|
915 .P
|
meillo@58
|
916 Similar to the situation for drafts is the situation for removed messages.
|
meillo@58
|
917 Historically, a message was deleted by renaming. A specific
|
meillo@58
|
918 \fIbackup prefix\fP, often comma (\c
|
meillo@58
|
919 .Fn , )
|
meillo@58
|
920 or hash (\c
|
meillo@58
|
921 .Fn # ),
|
meillo@58
|
922 being prepended to the file name. Thus, MH wouldn't recognize the file
|
meillo@58
|
923 as a message anymore, as only files whose name consists of digits only
|
meillo@58
|
924 are treated as messages. The removed messages remained as files in the
|
meillo@58
|
925 same directory and needed some maintenance job to truly delete them after
|
meillo@58
|
926 some grace time. Usually, by running a command similar to
|
meillo@58
|
927 .DS
|
meillo@58
|
928 find /home/user/Mail \-ctime +7 \-name ',*' | xargs rm
|
meillo@58
|
929 .DE
|
meillo@58
|
930 in a cron job. Within the grace time interval
|
meillo@58
|
931 the original message could be restored by stripping the
|
meillo@58
|
932 the backup prefix from the file name. If however, the last message of
|
meillo@58
|
933 a folder is been removed \(en say message
|
meillo@58
|
934 .Fn 6
|
meillo@58
|
935 becomes file
|
meillo@58
|
936 .Fn ,6
|
meillo@58
|
937 \(en and a new message enters the same folder, thus the same
|
meillo@58
|
938 numbered being given again \(en in our case
|
meillo@58
|
939 .Fn 6
|
meillo@58
|
940 \(en, if that one
|
meillo@58
|
941 is removed too, then the backup of the former message gets overwritten.
|
meillo@58
|
942 Thus, the ability to restore removed messages does not only depend on
|
meillo@58
|
943 the ``sweeping cron job'' but also on the removing of further messages.
|
meillo@58
|
944 This is undesirable, because the real mechanism is hidden from the user
|
meillo@58
|
945 and the consequences of further removals are not always obvious.
|
meillo@58
|
946 Further more, the backup files are scattered within the whole mail
|
meillo@58
|
947 storage, instead of being collected at one place.
|
meillo@58
|
948 .P
|
meillo@58
|
949 To improve the situation, the profile entry
|
meillo@58
|
950 .Pe rmmproc
|
meillo@58
|
951 (previously named
|
meillo@58
|
952 .Pe Delete-Prog )
|
meillo@58
|
953 was introduced, very early.
|
meillo@58
|
954 It could be set to any command, which would care for the mail removal
|
meillo@58
|
955 instead of taking the default action, described above.
|
meillo@58
|
956 Refiling the to-be-removed files to some garbage folder was a common
|
meillo@58
|
957 example. Nmh's man page
|
meillo@58
|
958 .Mp rmm(1)
|
meillo@58
|
959 proposes
|
meillo@58
|
960 .Cl "refile +d
|
meillo@58
|
961 to move messages to the garbage folder and
|
meillo@58
|
962 .Cl "rm `mhpath +d all`
|
meillo@58
|
963 the empty the garbage folder.
|
meillo@58
|
964 Managing the message removal this way is a sane approach. It keeps
|
meillo@58
|
965 the removed messages in one place, makes it easy to remove the backup
|
meillo@58
|
966 files, and, most important, enables the user to use the tools of MH
|
meillo@58
|
967 itself to operate on the removed messages. One can
|
meillo@58
|
968 .Pn scan
|
meillo@58
|
969 them,
|
meillo@58
|
970 .Pn show
|
meillo@58
|
971 them, and restore them with
|
meillo@58
|
972 .Pn refile .
|
meillo@58
|
973 There's no more
|
meillo@58
|
974 need to use
|
meillo@58
|
975 .Pn mhpath
|
meillo@58
|
976 to switch over from MH tools to Unix tools \(en MH can do it all itself.
|
meillo@58
|
977 .P
|
meillo@58
|
978 This approach matches perfect with the concepts of MH, thus making
|
meillo@58
|
979 it powerful. Hence, I made it the default. And even more, I also
|
meillo@58
|
980 removed the old backup prefix approach, as it is clearly less powerful.
|
meillo@58
|
981 Keeping unused alternative in the code is a bad choice as they likely
|
meillo@58
|
982 gather bugs, by not being constantly tested. Also, the increased code
|
meillo@58
|
983 size and more conditions crease the maintenance costs. By strictly
|
meillo@58
|
984 converting to the trash folder approach, I simplified the code base.
|
meillo@58
|
985 .Pn rmm
|
meillo@58
|
986 calls
|
meillo@58
|
987 .Pn refile
|
meillo@58
|
988 internally to move the to-be-removed
|
meillo@58
|
989 message to the trash folder (\c
|
meillo@58
|
990 .Fn +trash
|
meillo@58
|
991 by default). Messages
|
meillo@58
|
992 there can be operated on like on any other message in the storage.
|
meillo@58
|
993 The sweep clean, one can use
|
meillo@58
|
994 .Cl "rmm \-unlink +trash a" ,
|
meillo@58
|
995 where the
|
meillo@58
|
996 .Sw \-unlink
|
meillo@58
|
997 switch causes the files to be truly unliked instead
|
meillo@58
|
998 of moved to the trash folder.
|
meillo@58
|
999
|
meillo@58
|
1000
|
meillo@58
|
1001 .H2 "Path Notations
|
meillo@58
|
1002 .P
|
meillo@58
|
1003 foo
|
meillo@58
|
1004
|
meillo@58
|
1005
|
meillo@58
|
1006 .H2 "MIME Integration
|
meillo@58
|
1007 .P
|
meillo@58
|
1008 user-visible access to whole messages and MIME parts are inherently
|
meillo@58
|
1009 different
|
meillo@58
|
1010
|
meillo@58
|
1011
|
meillo@58
|
1012 .H2 "Of One Cast
|
meillo@58
|
1013 .P
|