rev |
line source |
meillo@0
|
1 .H0 "Work Report
|
meillo@0
|
2 .P
|
meillo@0
|
3 foo
|
meillo@0
|
4 .P
|
meillo@0
|
5 bar
|
meillo@0
|
6
|
meillo@12
|
7 .H1 "Removal of Code Relicts
|
meillo@0
|
8 .P
|
meillo@20
|
9 The code base of mmh originates from the late 70s, had been extensively
|
meillo@12
|
10 worked on in the mid 80s, and had been partly reorganized and extended
|
meillo@12
|
11 in the 90s. Relicts of all those times had gathered in the code base.
|
meillo@12
|
12 My goal was to remove any ancient code parts. One part of the task was
|
meillo@12
|
13 converting obsolete code constructs to standard constructs, the other part
|
meillo@12
|
14 was dropping obsolete functions.
|
meillo@12
|
15 .P
|
meillo@12
|
16 As I'm not even thirty years old and have no more than seven years of
|
meillo@12
|
17 Unix experience, I needed to learn about the history in retroperspective.
|
meillo@12
|
18 Older people likely have used those ancient constructs themself
|
meillo@12
|
19 and have suffered from their incompatiblities and have longed for
|
meillo@12
|
20 standardization. Unfortunately, I have only read that others had done so.
|
meillo@12
|
21 This put me in a much more difficult positions when working on the old
|
meillo@12
|
22 code. I needed to recherche what other would have known by heart from
|
meillo@12
|
23 experience. All my programming experience comes from a time past ANSI C
|
meillo@12
|
24 and past POSIX. Although I knew about the times before, I took the
|
meillo@12
|
25 current state implicitely for granted most of the time.
|
meillo@12
|
26 .P
|
meillo@12
|
27 Being aware of
|
meillo@12
|
28 these facts, I rather let people with more historic experience solve the
|
meillo@12
|
29 task of converting the ancient code constructs to standardized ones.
|
meillo@12
|
30 Luckily, Lyndon Nerenberg focused on this task at the nmh project.
|
meillo@12
|
31 He converted large parts of the code to POSIX constructs, removing
|
meillo@12
|
32 the conditionals compilation for now standardized features.
|
meillo@12
|
33 I'm thankful for this task being solved. I only pulled the changes into
|
meillo@12
|
34 mmh.
|
meillo@12
|
35 .P
|
meillo@20
|
36 The other task \(en dropping ancient functionality to remove old code \(en
|
meillo@12
|
37 I did myself, though. My position to strip mmh to the bare minimum of
|
meillo@12
|
38 frequently used features is much more revolutional than the nmh community
|
meillo@20
|
39 likes it. Without the need to justify my decisions, I was able to quickly
|
meillo@20
|
40 remove functionality I considered ancient.
|
meillo@20
|
41 The need to discuss my decisions with
|
meillo@20
|
42 peers likely would have slowed this process down. Of course, I researched
|
meillo@12
|
43 if a particular feature really should be dropped. Having not had any
|
meillo@12
|
44 contact to this feature within my computer life was a first indicator to
|
meillo@12
|
45 drop it, but I also asked others and searched the literature for modern
|
meillo@12
|
46 usage of the feature. If it appeared to be truly ancient, I dropped it.
|
meillo@12
|
47 The reason for dropping is always part of the commit message in the
|
meillo@12
|
48 version control system. Thus, it is easy for others to check their
|
meillo@12
|
49 view on the topic with mine and possibly to argue for reinclusion.
|
meillo@12
|
50
|
meillo@12
|
51 .U2 "MMDF maildrop support
|
meillo@12
|
52 .P
|
meillo@12
|
53 I did drop any support for the MMDF maildrop format. This type of format
|
meillo@12
|
54 is conceptionally similar to the mbox format, but uses four bytes with
|
meillo@12
|
55 value 1 (\fL^A^A^A^A\fP) as message delimiter,
|
meillo@18
|
56 instead of the string ``\fLFrom\ \fP''.
|
meillo@12
|
57 Due to the similarity and mbox being the de-facto standard maildrop
|
meillo@12
|
58 format on Unix, but also due to the larger influence of Sendmail than MMDF,
|
meillo@12
|
59 the MMDF maildrop format had vanished.
|
meillo@12
|
60 .P
|
meillo@12
|
61 The simplifications within the code were only moderate. Switches could
|
meillo@12
|
62 be removed from tools like
|
meillo@12
|
63 .L packf ,
|
meillo@12
|
64 which generate packed mailboxes. Only one packed mailbox format remained:
|
meillo@12
|
65 mbox.
|
meillo@12
|
66 The most important changes affect the equally named mail parsing routine in
|
meillo@12
|
67 .L sbr/m_getfld.c .
|
meillo@12
|
68 The direct MMDF code had been removed, but as now only one packed mailbox
|
meillo@12
|
69 format is left, code structure simplifications are likely possible.
|
meillo@12
|
70 The reason why they are still outstanding is the heavily optimized code
|
meillo@18
|
71 of
|
meillo@18
|
72 .Fu m_getfld() .
|
meillo@18
|
73 Changes beyond a small local scope \(en
|
meillo@12
|
74 which restructuring in its core is \(en cause a high risk of damaging
|
meillo@12
|
75 the intricate workings of the optimized code. This problem is know
|
meillo@12
|
76 to the developers of nmh, too. They also avoid touching this minefield
|
meillo@12
|
77 if possible.
|
meillo@12
|
78
|
meillo@12
|
79 .U2 "UUCP Bang Paths
|
meillo@12
|
80 .P
|
meillo@12
|
81 More questionably than the former topic is the removal of support for the
|
meillo@12
|
82 UUCP bang path address style. However, the user may translate the bang
|
meillo@12
|
83 paths on retrieval to Internet addresses and the other way on posting
|
meillo@12
|
84 messages. The former can be done my an MDA like procmail; the latter
|
meillo@12
|
85 by a sendmail wrapper. This would ensure that any address handling would
|
meillo@12
|
86 work as expected. However, it might just work well without any
|
meillo@12
|
87 such modifications, as mmh does not touch addresses much, in general.
|
meillo@12
|
88 But I can't ensure as I have never used an environment with bang paths.
|
meillo@12
|
89 Also, the behavior might break at any point in further development.
|
meillo@12
|
90
|
meillo@12
|
91 .U2 "Hardcopy terminal support
|
meillo@12
|
92 .P
|
meillo@12
|
93 More of a funny anecdote is the remaining of a check for printing to a
|
meillo@12
|
94 hardcopy terminal until Spring 2012, when I finally removed it.
|
meillo@12
|
95 I surely would be very happy to see such a terminal in action, maybe
|
meillo@12
|
96 actually being able to work on it, but I fear my chances are null.
|
meillo@12
|
97 .P
|
meillo@12
|
98 The check only prevented a pager to be placed between the outputting
|
meillo@18
|
99 program (\c
|
meillo@18
|
100 .Pn mhl )
|
meillo@18
|
101 and the terminal. This could have been ensured with
|
meillo@18
|
102 the
|
meillo@18
|
103 .Sw \-nomoreproc
|
meillo@18
|
104 at the command line statically, too.
|
meillo@12
|
105
|
meillo@12
|
106 .U2 "Removed support for header fields
|
meillo@12
|
107 .P
|
meillo@12
|
108 The `Encrypted' header had been introduced by RFC\^822, but already
|
meillo@12
|
109 marked legacy in RFC 2822. It was superseded by FIXME.
|
meillo@12
|
110 Mmh does no more support this header.
|
meillo@12
|
111 .P
|
meillo@21
|
112 Native support for `Face' headers
|
meillo@21
|
113 had been removed, as well.
|
meillo@21
|
114 The feature is similar to the `X-Face' header in its intent,
|
meillo@21
|
115 but takes a different approach to store the image.
|
meillo@21
|
116 Instead of encoding the image data directly into the header,
|
meillo@21
|
117 the the header contains the hostname and UDP port where the image
|
meillo@21
|
118 date could be retrieved.
|
meillo@21
|
119 Neither `X-Face' nor the here described `Face' system
|
meillo@21
|
120 \**
|
meillo@21
|
121 .FS
|
meillo@21
|
122 There is also a newer but different system, invented 2005,
|
meillo@21
|
123 using `Face' headers.
|
meillo@21
|
124 It is the successor of `X-Face' providing colored PNG images.
|
meillo@21
|
125 .FE
|
meillo@21
|
126 became well used in the large scale.
|
meillo@21
|
127 It's still possible to use a Face systems,
|
meillo@21
|
128 although mmh does not provide support for any of the different systems
|
meillo@21
|
129 anymore. It's fairly easy to write a small shell script to
|
meillo@21
|
130 extract the embedded or fetch the external Face data and display the image.
|
meillo@21
|
131 Own Face headers can be added into the draft template files.
|
meillo@21
|
132 .P
|
meillo@12
|
133 `Content-MD5' headers were introduced by RFC\^1864. They provide only
|
meillo@12
|
134 a verification of data corruption during the transfer. By no means can
|
meillo@12
|
135 they ensure verbatim end-to-end delivery of the contents. This is clearly
|
meillo@12
|
136 stated in the RFC. The proper approach to provide verificationability
|
meillo@12
|
137 of content in an end-to-end relationship is the use of digital cryptography
|
meillo@12
|
138 (RFCs FIXME). On the other hand, transfer protocols should ensure the
|
meillo@12
|
139 integrity of the transmission. In combinations these two approaches
|
meillo@12
|
140 make the `Content-MD5' header field useless. In consequence, I removed
|
meillo@12
|
141 the support for it. By this removal, MD5 computation is not needed
|
meillo@12
|
142 anywhere in mmh. Hence, over 500 lines of code were removed by this one
|
meillo@12
|
143 change. Even if the `Content-MD5' header field is useful sometimes,
|
meillo@12
|
144 I value its usefulnes less than the improvement in maintainability, caused
|
meillo@12
|
145 by the removal.
|
meillo@12
|
146
|
meillo@20
|
147 .U2 "Prompter's Control Keys
|
meillo@20
|
148 .P
|
meillo@20
|
149 The program
|
meillo@20
|
150 .Pn prompter
|
meillo@20
|
151 queries the user to fill in a message form. When used by
|
meillo@20
|
152 .Pn comp
|
meillo@20
|
153 as:
|
meillo@20
|
154 .DS
|
meillo@20
|
155 comp \-editor prompter
|
meillo@20
|
156 .DE
|
meillo@20
|
157 the resulting behavior is similar to
|
meillo@20
|
158 .Pn mailx .
|
meillo@20
|
159 Appearently,
|
meillo@20
|
160 .Pn prompter
|
meillo@20
|
161 hadn't been touched lately. Otherwise it's hardly explainable why it
|
meillo@20
|
162 still offered the switches
|
meillo@20
|
163 .Sn \-erase \fUchr\fP
|
meillo@20
|
164 and
|
meillo@20
|
165 .Sn \-kill \fUchr\fP
|
meillo@20
|
166 to name the characters for command line editing.
|
meillo@21
|
167 The times when this had been necessary are long time gone.
|
meillo@20
|
168 Today these things work out-of-the-box, and if not, are configured
|
meillo@20
|
169 with the standard tool
|
meillo@20
|
170 .Pn stty .
|
meillo@20
|
171
|
meillo@21
|
172 .U2 "Vfork and Retry Loops
|
meillo@21
|
173 .P
|
meillo@21
|
174 MH creates many processes, which is a concequence of the toolchest approach.
|
meillo@21
|
175 In earlier times
|
meillo@21
|
176 .Fu fork()
|
meillo@21
|
177 had been an expensive system call, as the process's whole image needed
|
meillo@21
|
178 to be duplicated. One common case is replacing the image with
|
meillo@21
|
179 .Fu exec()
|
meillo@21
|
180 right after having forked the child process.
|
meillo@21
|
181 To speed up this case, the
|
meillo@21
|
182 .Fu vfork()
|
meillo@21
|
183 system call was invented at Berkeley. It completely omits copying the
|
meillo@21
|
184 image. If the image gets replaced right afterwards then unnecessary
|
meillo@21
|
185 work is omited. On old systems this results in large speed ups.
|
meillo@21
|
186 MH uses
|
meillo@21
|
187 .Fu vfork()
|
meillo@21
|
188 whenever possible.
|
meillo@21
|
189 .P
|
meillo@21
|
190 Memory management units that support copy-on-write semantics make
|
meillo@21
|
191 .Fu fork()
|
meillo@21
|
192 almost as fast as
|
meillo@21
|
193 .Fu vfork()
|
meillo@21
|
194 in the cases when they can be exchanged.
|
meillo@21
|
195 With
|
meillo@21
|
196 .Fu vfork()
|
meillo@21
|
197 being more errorprone and hardly faster, it's preferable to simply
|
meillo@21
|
198 use
|
meillo@21
|
199 .Fu fork()
|
meillo@21
|
200 instead.
|
meillo@21
|
201 .P
|
meillo@21
|
202 Related to the costs of
|
meillo@21
|
203 .Fu fork()
|
meillo@21
|
204 is the probability of its success.
|
meillo@21
|
205 Today on modern systems, the system call will succeed almost always.
|
meillo@21
|
206 In the 80s on heavy loaded systems, as they were common at
|
meillo@21
|
207 universities, this had been different. Thus, many of the
|
meillo@21
|
208 .Fu fork()
|
meillo@21
|
209 calls were wrapped into loops to retry to fork several times in
|
meillo@21
|
210 short intervals, in case of previous failure.
|
meillo@21
|
211 In mmh, the program aborts at once if the fork failed.
|
meillo@21
|
212 The user can reexecute the command then. This is expected to be a
|
meillo@21
|
213 very rare case on modern systems, especially personal ones, which are
|
meillo@21
|
214 common today.
|
meillo@21
|
215
|
meillo@12
|
216
|
meillo@22
|
217 .H1 "Removal of Tools
|
meillo@22
|
218 .P
|
meillo@22
|
219 MH had been considered an all-in-one system for mail handling.
|
meillo@22
|
220 The community around nmh has a similar understanding.
|
meillo@22
|
221 In fundamental difference, I believe that mmh should be a MUA but
|
meillo@22
|
222 nothing more. I believe that all-in-one mail systems are not the way
|
meillo@22
|
223 to go. There are excellent specialized MTAs, like Postfix;
|
meillo@22
|
224 there are specialized MDAs, like Procmail; there are specialized
|
meillo@22
|
225 MRAs, like Fetchmail. I believe it's best to use them instead of
|
meillo@22
|
226 providing the same function ourself. Doing something well requires to
|
meillo@22
|
227 focus on this particular aspect or a small set of aspects. The more
|
meillo@22
|
228 it is possible to focus, the better the result in this particular
|
meillo@22
|
229 area will be. The limiting resource in Free Software community development
|
meillo@22
|
230 usually is human power. If the low development power is even parted
|
meillo@22
|
231 into multiple development areas, it will hardly be possible to
|
meillo@22
|
232 compete with the specialists in the various fields. This is even
|
meillo@22
|
233 increased, given the small community \(en developers and users \(en
|
meillo@22
|
234 that MH-based mail systems have. In consequence, I believe that the
|
meillo@22
|
235 available resources should be concentrated at the point where MH is
|
meillo@22
|
236 most unique. This is clearly the MUA part.
|
meillo@22
|
237 .P
|
meillo@22
|
238 Several of nmh's tools were removed from mmh because they didn't
|
meillo@22
|
239 match the main focus of adding to the MUA's task.
|
meillo@22
|
240 .P
|
meillo@22
|
241 .Pn conflict
|
meillo@22
|
242 was removed because it is a mail system maintenance tool.
|
meillo@22
|
243 Besides, it also checks the
|
meillo@22
|
244 .Fn /etc/passwd
|
meillo@22
|
245 and
|
meillo@22
|
246 .Fn /etc/group
|
meillo@22
|
247 files.
|
meillo@22
|
248 The tool might be useful, but it should not be shipped with mmh.
|
meillo@22
|
249 .P
|
meillo@22
|
250 .Pn rcvtty
|
meillo@22
|
251 was removed because its usecase of writing to the user's terminal
|
meillo@22
|
252 on receival of mail is hardly wanted today. If users like to be
|
meillo@22
|
253 informed of new mail, then using the shell's
|
meillo@22
|
254 .Ev MAILPATH
|
meillo@22
|
255 variable or different (graphical) notifications are likely more
|
meillo@22
|
256 appealing. Writing directly to other terminals is hardly ever wanted
|
meillo@22
|
257 today. If though one wants to have it this way, the standard tool
|
meillo@22
|
258 .Pn write
|
meillo@22
|
259 can be used in a way similar to:
|
meillo@22
|
260 .DS
|
meillo@22
|
261 scan -file - | write `id -un`
|
meillo@22
|
262 .DE
|
meillo@22
|
263 .P
|
meillo@22
|
264 When the new attachment system was introduced,
|
meillo@22
|
265 .Pn viamail
|
meillo@22
|
266 was removed because then
|
meillo@22
|
267 .Pn forw
|
meillo@22
|
268 could cover the task itself.
|
meillo@22
|
269 The wrapper program
|
meillo@22
|
270 .Pn sendfiles
|
meillo@22
|
271 was rewritten as a shell script to use
|
meillo@22
|
272 .Pn forw .
|
meillo@22
|
273 .P
|
meillo@22
|
274 .Pn msgchk
|
meillo@22
|
275 was removed as it became hardly useful when POP support was removed.
|
meillo@22
|
276 It is questionable if
|
meillo@22
|
277 .Pn msgchk
|
meillo@22
|
278 provides more information than:
|
meillo@22
|
279 .DS
|
meillo@22
|
280 ls -l /var/mail/meillo
|
meillo@22
|
281 .DE
|
meillo@22
|
282 It does separate between old and new mail, but that's not very
|
meillo@22
|
283 useful and can be found out with
|
meillo@22
|
284 .Pn stat (1)
|
meillo@22
|
285 too. A very small shell script could care for the form of output.
|
meillo@22
|
286 As mmh's inc only incorporates mail from the user's local maildrop
|
meillo@22
|
287 and thus no long data transfers are involved,
|
meillo@22
|
288 there's no need to check for new mail before incorporating it.
|
meillo@22
|
289 .P
|
meillo@22
|
290 .Pn msh
|
meillo@22
|
291 was removed because the tool was in conflict with the original
|
meillo@22
|
292 philosophy of MH. It provided an interactive shell to access the
|
meillo@22
|
293 features of MH. One major feature of MH is being a toolchest.
|
meillo@22
|
294 .Pn msh
|
meillo@22
|
295 wouldn't be just another shell, taylored to the needs of mail
|
meillo@22
|
296 handling, but one large program to have the MH tools built in.
|
meillo@22
|
297 It's main use was for accessing Bulletin Boards, which have seized to
|
meillo@22
|
298 be popular. Removing
|
meillo@22
|
299 .Pn msh ,
|
meillo@22
|
300 together with the truly obsolete programs
|
meillo@22
|
301 .Pn vmh
|
meillo@22
|
302 and
|
meillo@22
|
303 .Pn wmh ,
|
meillo@22
|
304 saved more than 7\|000 lines of C code \(en a major achievement.
|
meillo@22
|
305
|
meillo@22
|
306
|
meillo@14
|
307 .H1 "Draft and Trash Folders
|
meillo@16
|
308 .U2 "Draft Folder
|
meillo@14
|
309 .P
|
meillo@18
|
310 Historically, MH provided exactly one draft message, named
|
meillo@18
|
311 .Fn draft
|
meillo@18
|
312 and
|
meillo@14
|
313 being located in the MH directory. When starting to compose another message
|
meillo@14
|
314 before the former one was sent, the user had been questioned wether to use,
|
meillo@14
|
315 refile or replace the old draft. Working on multiple drafts at the same time
|
meillo@14
|
316 was impossible. One could only work on them in alteration by refiling the
|
meillo@14
|
317 previous one to some directory and fetching some other one for reediting.
|
meillo@14
|
318 This manual draft management needed to be done each time the user wanted
|
meillo@14
|
319 to switch between editing one draft to editing another.
|
meillo@14
|
320 .P
|
meillo@14
|
321 To allow true parallel editing of drafts, in a straight forward way, the
|
meillo@14
|
322 draft folder facility exists. It had been introduced already in July 1984
|
meillo@14
|
323 by Marshall T. Rose. The facility was deactivated by default.
|
meillo@14
|
324 Even in nmh, the draft folder facility remained deactivated by default.
|
meillo@18
|
325 At least, Richard Coleman added the man page
|
meillo@18
|
326 .Mp mh-draft(5)
|
meillo@18
|
327 to document
|
meillo@14
|
328 the feature well.
|
meillo@14
|
329 .P
|
meillo@14
|
330 The only advantage of not using the draft folder facility is the static
|
meillo@14
|
331 name of the draft file. This could be an issue for MH frontends like mh-e.
|
meillo@14
|
332 But as they likely want to provide working on multiple drafts in parallel,
|
meillo@14
|
333 the issue is only concerning compatibility. The aim of nmh to stay compatible
|
meillo@14
|
334 prevented the default activation of the draft folder facility.
|
meillo@14
|
335 .P
|
meillo@14
|
336 On the other hand, a draft folder is the much more natural concept than
|
meillo@14
|
337 a draft message. MH's mail storage consists of folders and messages,
|
meillo@14
|
338 the messages named with ascending numbers. A draft message breaks with this
|
meillo@18
|
339 concept by introducing a message in a file named
|
meillo@18
|
340 .Fn draft .
|
meillo@18
|
341 This draft
|
meillo@14
|
342 message is special. It can not be simply listed with the available tools,
|
meillo@17
|
343 but instead requires special switches. I.e. corner-cases were
|
meillo@14
|
344 introduced. A draft folder, in contrast, does not introduce such
|
meillo@14
|
345 corner-cases. The available tools can operate on the messages within that
|
meillo@14
|
346 folder like on any messages within any mail folders. The only difference
|
meillo@18
|
347 is the fact that the default folder for
|
meillo@18
|
348 .Pn send
|
meillo@18
|
349 is the draft folder,
|
meillo@14
|
350 instead of the current folder, like for all other tools.
|
meillo@14
|
351 .P
|
meillo@14
|
352 The trivial part of the change was activating the draft folder facility
|
meillo@14
|
353 by default and setting a default name for this folder. Obviously, I chose
|
meillo@18
|
354 the name
|
meillo@18
|
355 .Fn +drafts .
|
meillo@18
|
356 This made the
|
meillo@18
|
357 .Sw \-draftfolder
|
meillo@18
|
358 and
|
meillo@18
|
359 .Sw \-draftmessage
|
meillo@18
|
360 switches useless, and I could remove them.
|
meillo@14
|
361 The more difficult but also the part that showed the real improvement,
|
meillo@18
|
362 was updating the tools to the new concept.
|
meillo@18
|
363 .Sw \-draft
|
meillo@18
|
364 switches could
|
meillo@14
|
365 be dropped, as operating on a draft message became indistinguishable to
|
meillo@18
|
366 operating on any other message for the tools.
|
meillo@18
|
367 .Pn comp
|
meillo@18
|
368 still has its
|
meillo@18
|
369 .Sw \-use
|
meillo@18
|
370 switch for switching between its two modes: (1) Compose a new
|
meillo@14
|
371 draft, possibly by taking some existing message as a form. (2) Modify
|
meillo@18
|
372 an existing draft. In either case, the behavior of
|
meillo@18
|
373 .Pn comp is
|
meillo@14
|
374 deterministic. There is no more need to query the user. I consider this
|
meillo@18
|
375 a major improvement. By making
|
meillo@18
|
376 .Pn send
|
meillo@18
|
377 simply operate on the current
|
meillo@17
|
378 message in the draft folder by default, with message and folder both
|
meillo@14
|
379 overridable by specifying them on the command line, it is now possible
|
meillo@17
|
380 to send a draft anywhere within the storage by simply specifying its folder
|
meillo@17
|
381 and name.
|
meillo@14
|
382 .P
|
meillo@14
|
383 All theses changes converted special cases to regular cases, thus
|
meillo@14
|
384 simplifying the tools and increasing the flexibility.
|
meillo@14
|
385
|
meillo@16
|
386 .U2 "Trash Folder
|
meillo@16
|
387 .P
|
meillo@16
|
388 Similar to the situation for drafts is the situation for removed messages.
|
meillo@16
|
389 Historically, a message was deleted by renaming. A specific
|
meillo@18
|
390 \fIbackup prefix\fP, often comma (\c
|
meillo@18
|
391 .Fn , )
|
meillo@18
|
392 or hash (\c
|
meillo@18
|
393 .Fn # ),
|
meillo@16
|
394 being prepended to the file name. Thus, MH wouldn't recognize the file
|
meillo@16
|
395 as a message anymore, as only files whose name consists of digits only
|
meillo@16
|
396 are treated as messages. The removed messages remained as files in the
|
meillo@16
|
397 same directory and needed some maintenance job to truly delete them after
|
meillo@16
|
398 some grace time. Usually, by running a command similar to
|
meillo@16
|
399 .DS
|
meillo@16
|
400 find /home/user/Mail \-ctime +7 \-name ',*' | xargs rm
|
meillo@16
|
401 .DE
|
meillo@16
|
402 in a cron job. Within the grace time interval
|
meillo@16
|
403 the original message could be restored by stripping the
|
meillo@16
|
404 the backup prefix from the file name. If however, the last message of
|
meillo@18
|
405 a folder is been removed \(en say message
|
meillo@18
|
406 .Fn 6
|
meillo@18
|
407 becomes file
|
meillo@18
|
408 .Fn ,6
|
meillo@18
|
409 \(en and a new message enters the same folder, thus the same
|
meillo@18
|
410 numbered being given again \(en in our case
|
meillo@18
|
411 .Fn 6
|
meillo@18
|
412 \(en, if that one
|
meillo@17
|
413 is removed too, then the backup of the former message gets overwritten.
|
meillo@16
|
414 Thus, the ability to restore removed messages does not only depend on
|
meillo@16
|
415 the ``sweeping cron job'' but also on the removing of further messages.
|
meillo@16
|
416 This is undesireable, because the real mechanism is hidden from the user
|
meillo@16
|
417 and the concequences of further removals are not always obvious.
|
meillo@16
|
418 Further more, the backup files are scattered within the whole mail
|
meillo@16
|
419 storage, instead of being collected at one place.
|
meillo@16
|
420 .P
|
meillo@18
|
421 To improve the situation, the profile entry
|
meillo@18
|
422 .Pe rmmproc
|
meillo@18
|
423 (previously named
|
meillo@18
|
424 .Pe Delete-Prog )
|
meillo@18
|
425 was introduced, very early.
|
meillo@16
|
426 It could be set to any command, which would care for the mail removal
|
meillo@16
|
427 instead of taking the default action, described above.
|
meillo@16
|
428 Refiling the to-be-removed files to some wastebin folder was a common
|
meillo@18
|
429 example. Nmh's man page
|
meillo@18
|
430 .Mp rmm(1)
|
meillo@18
|
431 proposes
|
meillo@18
|
432 .Cl "refile +d
|
meillo@18
|
433 to move messages to the wastebin and
|
meillo@18
|
434 .Cl "rm `mhpath +d all`
|
meillo@16
|
435 the empty the wastebin.
|
meillo@16
|
436 Managing the message removal this way is a sane approach. It keeps
|
meillo@16
|
437 the removed messages in one place, makes it easy to remove the backup
|
meillo@16
|
438 files, and, most important, enables the user to use the tools of MH
|
meillo@18
|
439 itself to operate on the removed messages. One can
|
meillo@18
|
440 .Pn scan
|
meillo@18
|
441 them,
|
meillo@18
|
442 .Pn show
|
meillo@18
|
443 them, and restore them with
|
meillo@18
|
444 .Pn refile .
|
meillo@18
|
445 There's no more
|
meillo@18
|
446 need to use
|
meillo@18
|
447 .Pn mhpath
|
meillo@18
|
448 to switch over from MH tools to Unix tools \(en MH can do it all itself.
|
meillo@16
|
449 .P
|
meillo@18
|
450 This apporach matches perfect with the concepts of MH, thus making
|
meillo@16
|
451 it powerful. Hence, I made it the default. And even more, I also
|
meillo@16
|
452 removed the old backup prefix approach, as it is clearly less powerful.
|
meillo@16
|
453 Keeping unused alternative in the code is a bad choice as they likely
|
meillo@16
|
454 gather bugs, by not being constantly tested. Also, the increased code
|
meillo@16
|
455 size and more conditions crease the maintenance costs. By strictly
|
meillo@16
|
456 converting to the trash folder approach, I simplified the code base.
|
meillo@18
|
457 .Pn rmm
|
meillo@18
|
458 calls
|
meillo@18
|
459 .Pn refile
|
meillo@18
|
460 internally to move the to-be-removed
|
meillo@18
|
461 message to the trash folder (\c
|
meillo@18
|
462 .Fn +trash
|
meillo@18
|
463 by default). Messages
|
meillo@16
|
464 there can be operated on like on any other message in the storage.
|
meillo@18
|
465 The sweep clean, one can use
|
meillo@18
|
466 .Cl "rmm \-unlink +trash a" ,
|
meillo@18
|
467 where the
|
meillo@18
|
468 .Sw \-unlink
|
meillo@18
|
469 switch causes the files to be truly unliked instead
|
meillo@16
|
470 of moved to the trash folder.
|
meillo@16
|
471
|
meillo@0
|
472
|
meillo@17
|
473 .H1 "MH Directory Split
|
meillo@0
|
474 .P
|
meillo@19
|
475 In MH and nmh, a personal setup had consisted of two parts:
|
meillo@19
|
476 The MH profile, named
|
meillo@19
|
477 .Fn \&.mh_profile
|
meillo@19
|
478 and being located directly in the user's home directory.
|
meillo@19
|
479 And the MH directory, where all his mail messages and also his personal
|
meillo@19
|
480 forms, scan formats, other configuration files are stored. The location
|
meillo@19
|
481 of this directory could be user-chosen. The default was to name it
|
meillo@19
|
482 .Fn Mail
|
meillo@19
|
483 and have it directly in the home directory.
|
meillo@19
|
484 .P
|
meillo@19
|
485 I've never liked the data storage and the configuration to be intermixed.
|
meillo@19
|
486 They are different kinds of data. One part, are the messages,
|
meillo@19
|
487 which are the data to operate on. The other part, are the personal
|
meillo@19
|
488 configuration files, which are able to change the behavior of the operations.
|
meillo@19
|
489 The actual operations are defined in the profile, however.
|
meillo@19
|
490 .P
|
meillo@19
|
491 When storing data, one should try to group data by its type.
|
meillo@19
|
492 There's sense in the Unix file system hierarchy, where configuration
|
meillo@19
|
493 file are stored separate (\c
|
meillo@19
|
494 .Fn /etc )
|
meillo@19
|
495 to the programs (\c
|
meillo@19
|
496 .Fn /bin
|
meillo@19
|
497 and
|
meillo@19
|
498 .Fn /usr/bin )
|
meillo@19
|
499 to their sources (\c
|
meillo@19
|
500 .Fn /usr/src ).
|
meillo@19
|
501 Such separation eases the backup management, for instance.
|
meillo@19
|
502 .P
|
meillo@19
|
503 In mmh, I've reorganized the file locations.
|
meillo@19
|
504 Still there are two places:
|
meillo@19
|
505 There's the mail storage directory, which, like in MH, contains all the
|
meillo@19
|
506 messages, but, unlike in MH, nothing else.
|
meillo@19
|
507 Its location still is user-chosen, with the default name
|
meillo@19
|
508 .Fn Mail ,
|
meillo@19
|
509 in the user's home directory. This is much similar to the case in nmh.
|
meillo@19
|
510 The configuration files, however, are grouped together in the new directory
|
meillo@19
|
511 .Fn \&.mmh
|
meillo@19
|
512 in the user's home directory.
|
meillo@19
|
513 The user's profile now is a file, named
|
meillo@19
|
514 .Fn profile ,
|
meillo@19
|
515 in this mmh directory.
|
meillo@19
|
516 Consistently, the context file and all the personal forms, scan formats,
|
meillo@19
|
517 and the like, are also there.
|
meillo@19
|
518 .P
|
meillo@19
|
519 The naming changed with the relocation.
|
meillo@19
|
520 The directory where everything, except the profile, had been stored (\c
|
meillo@19
|
521 .Fn $HOME/Mail ),
|
meillo@19
|
522 used to be called \fIMH directory\fP. Now, this directory is called the
|
meillo@19
|
523 user's \fImail storage\fP. The name \fImmh directory\fP is now given to
|
meillo@19
|
524 the new directory
|
meillo@19
|
525 (\c
|
meillo@19
|
526 .Fn $HOME/.mmh ),
|
meillo@19
|
527 containing all the personal configuration files.
|
meillo@19
|
528 .P
|
meillo@19
|
529 The separation of the files by type of content is logical and convenient.
|
meillo@19
|
530 There are no functional differences as any possible setup known to me
|
meillo@19
|
531 can be implemented with both approaches, although likely a bit easier
|
meillo@19
|
532 with the new approach. The main goal of the change had been to provide
|
meillo@19
|
533 sensible storage locations for any type of personal mmh file.
|
meillo@19
|
534 .P
|
meillo@19
|
535 In order for one user to have multiple MH setups, he can use the
|
meillo@19
|
536 environment variable
|
meillo@19
|
537 .Ev MH
|
meillo@19
|
538 the point to a different profile file.
|
meillo@19
|
539 The MH directory (mail storage plus personal configuration files) is
|
meillo@19
|
540 defined by the
|
meillo@19
|
541 .Pe Path
|
meillo@19
|
542 profile entry.
|
meillo@19
|
543 The context file could be defined by the
|
meillo@19
|
544 .Pe context
|
meillo@19
|
545 profile entry or by the
|
meillo@19
|
546 .Ev MHCONTEXT
|
meillo@19
|
547 environment variable.
|
meillo@19
|
548 The latter is useful to have a distinct context (e.g. current folders)
|
meillo@19
|
549 in each terminal window, for instance.
|
meillo@19
|
550 In mmh, there are three environment variables now.
|
meillo@19
|
551 .Ev MMH
|
meillo@19
|
552 may be used to change the location of the mmh directory.
|
meillo@19
|
553 .Ev MMHP
|
meillo@19
|
554 and
|
meillo@19
|
555 .Ev MMHC
|
meillo@19
|
556 change the profile and context files, respectively.
|
meillo@19
|
557 Besides providing a more consistent feel (which simply is the result
|
meillo@19
|
558 of being designed anew), the set of personal configuration files can
|
meillo@19
|
559 be chosen independently from the profile (including mail storage location)
|
meillo@19
|
560 and context, now. Being it relevant for practical use or not, it
|
meillo@19
|
561 de-facto is an improvement. However, the main achievement is the
|
meillo@19
|
562 split between mail storage and personal configuration files.
|
meillo@17
|
563
|
meillo@0
|
564
|
meillo@0
|
565 .H1 "Path Notations
|
meillo@0
|
566 .P
|
meillo@0
|
567 foo
|
meillo@0
|
568
|
meillo@0
|
569 .H1 "Attachments
|
meillo@0
|
570 .P
|
meillo@0
|
571 foo
|
meillo@0
|
572
|
meillo@20
|
573 .H1 "mhshow to show Transition
|
meillo@20
|
574 .P
|
meillo@20
|
575 Since the very beginning, already in the first concept paper,
|
meillo@20
|
576 .Pn show
|
meillo@20
|
577 had been MH's mail display program.
|
meillo@20
|
578 .Pn show
|
meillo@20
|
579 found out which pathnames the relevant messages had and invoked
|
meillo@20
|
580 .Pn mhl
|
meillo@20
|
581 then to let it render the content.
|
meillo@20
|
582 With the advent of MIME, this approach wasn't sufficient anymore.
|
meillo@20
|
583 MIME messages can consist of multiple parts, some of which aren't
|
meillo@20
|
584 directly displayable, and text content can be encoded in
|
meillo@20
|
585 foreign charsets.
|
meillo@20
|
586 .Pn show 's
|
meillo@20
|
587 simple approach and
|
meillo@20
|
588 .Pn mhl 's
|
meillo@20
|
589 limited display facilities couldn't cope with the task any longer.
|
meillo@20
|
590 Instead of extending these tools, new ones were written from scratch
|
meillo@20
|
591 and then added to the MH toolchest. Doing so is encouraged by the
|
meillo@20
|
592 toolchest approach. The new tools could be added without interfearing
|
meillo@20
|
593 with the existing ones. This is great. It allowed MH to be the
|
meillo@20
|
594 first MUA to implement MIME.
|
meillo@20
|
595 .P
|
meillo@20
|
596 The new MIME features were added in form of the single program
|
meillo@20
|
597 .Pn mhn .
|
meillo@20
|
598 The command
|
meillo@20
|
599 .DS
|
meillo@20
|
600 mhn \-show 42
|
meillo@20
|
601 .DE
|
meillo@20
|
602 would show the MIME message numbered 42.
|
meillo@20
|
603 With the 1.0 release of nmh in February 1999, Richard Coleman finished
|
meillo@20
|
604 the split of
|
meillo@20
|
605 .Pn mhn
|
meillo@20
|
606 into a set of specialized programs, which together covered the
|
meillo@20
|
607 aspects of MIME. One of these resulting tools was
|
meillo@20
|
608 .Pn mhshow .
|
meillo@20
|
609
|
meillo@20
|
610
|
meillo@0
|
611 .H1 "Blind Carbon Copies
|
meillo@0
|
612 .P
|
meillo@0
|
613 foo
|
meillo@0
|
614
|
meillo@0
|
615 .H1 "Good Defaults
|
meillo@0
|
616 .P
|
meillo@0
|
617 foo
|
meillo@0
|
618
|
meillo@0
|
619 .H1 "Modularization
|
meillo@0
|
620 .P
|
meillo@0
|
621 foo
|
meillo@0
|
622
|
meillo@0
|
623 .H1 "Code style
|
meillo@0
|
624 .P
|
meillo@0
|
625 foo
|