docs/master

annotate ch03.roff @ 51:49cf68506b5d

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