docs/master

annotate ch03.roff @ 85:fb0d1b4c8fb1

Extended the text about mail transfer configure options.
author markus schnalke <meillo@marmaro.de>
date Wed, 06 Jun 2012 20:12:37 +0200
parents c35ec2b7de5d
children 7d5b180de542
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@76 15 In fundamental difference, should be a MUA only.
meillo@76 16 I believe that all-in-one mail systems are obsolete.
meillo@76 17 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@76 20 providing the same function ourselves. Doing something well, requires to
meillo@76 21 focus on a small set of aspects. The more
meillo@58 22 it is possible to focus, the better the result in this particular
meillo@76 23 area will be. Usually, the limiting resource in Free Software
meillo@76 24 community development is man power.
meillo@76 25 If the development power is even spread over a large
meillo@76 26 development area, it becomes more difficult to
meillo@58 27 compete with the specialists in the various fields. This is even
meillo@58 28 increased, given the small community \(en developers and users \(en
meillo@58 29 that MH-based mail systems have. In consequence, I believe that the
meillo@76 30 available resources should be focused to the point where MH is
meillo@58 31 most unique. This is clearly the MUA part.
meillo@58 32 .P
meillo@60 33 The goal for mmh was to remove peripheral parts and stream-line
meillo@60 34 it for the MUA task.
meillo@60 35
meillo@60 36
meillo@60 37 .H2 "Removal of Mail Transfer Facilities
meillo@60 38 .P
meillo@60 39 In contrast to nmh, which also provides mail submission and mail retrieval
meillo@60 40 facilities, mmh is a MUA only.
meillo@66 41 This general difference in the view on the character of nmh
meillo@76 42 initiated the development of mmh.
meillo@66 43 Removing the mail transfer facilities had been the first work task
meillo@76 44 in the mmh project.
meillo@60 45 .P
meillo@66 46 The MSA is called \fIMessage Transfer Service\fP (MTS) in nmh.
meillo@76 47 The facility established network connections and spoke SMTP to submit
meillo@60 48 messages for relay to the outside world.
meillo@76 49 This part was implemented by the
meillo@60 50 .Pn post
meillo@60 51 command.
meillo@76 52 The changes in emailing
meillo@76 53 demanded changes in this part of nmh in the last years.
meillo@76 54 Encryption and authetication for network connections
meillo@76 55 needed to be supported, hence TLS and SASL were introduced
meillo@60 56 into nmh. This added complexity to the nmh without improving it in
meillo@60 57 its core functions. Also, keeping up with recent developments in
meillo@76 58 this field requires development power and specialists.
meillo@76 59 For mmh this whole facility was cut off.
meillo@76 60 .Ci f6aa95b724fd8c791164abe7ee5468bf5c34f226
meillo@76 61 .Ci fecd5d34f65597a4dfa16aeabea7d74b191532c3
meillo@76 62 .Ci 156d35f6425bea4c1ed3c4c79783dc613379c65b
meillo@76 63 Instead, mmh depends on an external MTA.
meillo@60 64 The only outgoing interface available to mmh is the
meillo@60 65 .Pn sendmail
meillo@60 66 command.
meillo@60 67 Almost any MTA provides a
meillo@60 68 .Pn sendmail
meillo@60 69 command.
meillo@76 70 If not, any program can be substituted if it reads the
meillo@60 71 message from the standard input, extracts the recipient addresses
meillo@60 72 from the message header and does not conflict
meillo@76 73 with sendmail-specific command line options.
meillo@60 74 .P
meillo@60 75 To retrieve mail, the
meillo@60 76 .Pn inc
meillo@76 77 command established network connections
meillo@76 78 and spoke POP3 to retrieve mail from remote servers.
meillo@76 79 As with mail submission, the network connections required encryption and
meillo@76 80 authentication, thus TLS and SASL was added.
meillo@76 81 As POP3 becomes more and more superseded by IMAP, support for message
meillo@76 82 retrieval through IMAP will become necessary to be added soon, too.
meillo@76 83 Mmh has dropped the support for retrieving mail from remote locations.
meillo@76 84 .Ci ab7b48411962d26439f92f35ed084d3d6275459c
meillo@76 85 Instead, it depends on an external tool to cover this task.
meillo@76 86 There exist two paths for messages to enter mmh's mail storage:
meillo@76 87 They can be incorporate with
meillo@60 88 .Pn inc
meillo@76 89 from the system maildrop, or
meillo@60 90 .Pn rcvstore
meillo@76 91 reads them from the standard input.
meillo@60 92 .P
meillo@60 93 With the removal of the MSA and MRA, mmh converted from an all-in-one
meillo@66 94 mail system to being only a MUA.
meillo@76 95 Following the Unix philosophy, it focuses on one job and
meillo@76 96 tries to do that one well.
meillo@76 97 Not only the programs follow that tenet but also the project itself does so.
meillo@60 98 Now, of course, mmh depends on third-party software.
meillo@60 99 An external MTA/MSA is required to transfer mail to the outside world;
meillo@60 100 an external MRA is required to retrieve mail from remote machines.
meillo@60 101 There exist excellent implementations of such software,
meillo@76 102 which do this specific task likely better than the internal
meillo@76 103 versions had done it. Also, the best suiting programs can be freely chosen.
meillo@60 104 .P
meillo@60 105 As it had already been possible to use an external MSA or MRA,
meillo@60 106 why not keep the internal version for convenience?
meillo@76 107 The question whether there is sense in having a fall-back pager in all
meillo@76 108 the command line tools, for the cases when
meillo@60 109 .Pn more
meillo@60 110 or
meillo@60 111 .Pn less
meillo@76 112 aren't available, appears to be ridiculous.
meillo@76 113 Now, an MSA or MRA is clearly more complex than a text pager,
meillo@76 114 and not necessarily available but still the concept holds:
meillo@76 115 design the system orthogonally.
meillo@76 116 If it is conceptionally more elegant to have the MTA to be a separate tool
meillo@76 117 \(en as the RFCs propose this split, this is likely the case \(en
meillo@76 118 then separate.
meillo@76 119 .P
meillo@76 120 Further more, if programs become complex, they should be split;
meillo@76 121 and if projects become complex, they should be split, too.
meillo@76 122 Essential complexity is defined by the problem.
meillo@76 123 Decades ago, emailing had been small and simple.
meillo@76 124 (\c
meillo@60 125 .Pn /bin/mail
meillo@76 126 had once covered anything there was to email and still had been small
meillo@76 127 and simple.)
meillo@76 128 Then the essential complexity of email increased.
meillo@76 129 Email tools needed to react.
meillo@76 130 In nmh, for instance, the POP server, which the original MH had included,
meillo@76 131 was removed.
meillo@76 132 Now is the time to go one step further and remove the MSA and MRA.
meillo@60 133 Not only does it decrease the code amount of the project,
meillo@60 134 but more important, it removes the whole field of message transfer
meillo@76 135 with all its implications for the project.
meillo@76 136 It removes the need to adjust to any changes concerning network transfer.
meillo@76 137 This independence is received by depending on an external program
meillo@76 138 that covers the field.
meillo@76 139 Today, this is a reasonable exchange.
meillo@60 140 .P
meillo@76 141 To add some kind of function, there's always the choice
meillo@76 142 among implementing the function in the project directly,
meillo@76 143 depending on a library that provides the function, or depending on
meillo@66 144 a program that provides the function.
meillo@66 145 Whereas adding the function directly to the project increases the
meillo@76 146 code size most and requires most maintenance and development work,
meillo@76 147 it makes the project most independent.
meillo@76 148 Using libraries or external programs require less
meillo@76 149 maintenance work.
meillo@76 150 Programs have the smallest interfaces, providing the most separation
meillo@76 151 but possibly limiting the information exchange.
meillo@76 152 External libraries are stronger connected than external programs but
meillo@76 153 allow better information exchange.
meillo@76 154 Adding more code to a project does always increase maintenance work.
meillo@76 155 Implementing complex functions directly in the project will add
meillo@76 156 a lot of code. This should be avoided if possible.
meillo@66 157 Hence, the dependencies only change in kind, not in their existence.
meillo@66 158 In mmh, library dependencies on
meillo@66 159 .Pn libsasl2
meillo@66 160 and
meillo@66 161 .Pn libcrypto /\c
meillo@66 162 .Pn libssl
meillo@66 163 were treated against program dependencies on an MSA and an MRA.
meillo@66 164 Besides program dependencies providing the stronger separation
meillo@66 165 and being more flexible, they also allowed
meillo@66 166 over 6\|000 lines of code to be removed from mmh.
meillo@66 167 This made mmh's code base about 12\|% smaller.
meillo@66 168 Reducing the projects code size by such an amount without actually
meillo@66 169 losing function is a convincing argument.
meillo@76 170 Actually, as external MSAs and MRAs are likely better
meillo@76 171 than the project's internal version, the user even gains functionality.
meillo@66 172 .P
meillo@76 173 Users of MH should not have problems to set up an external MSA and MRA.
meillo@60 174 Also, the popular MSAs and MRAs have large communities and a lot
meillo@60 175 of documentation available.
meillo@60 176 Choices for MSAs range from the full-featured
meillo@60 177 .I Postfix
meillo@60 178 over mid-size solutions like
meillo@60 179 .I masqmail
meillo@60 180 and
meillo@60 181 .I dma
meillo@60 182 to small forwarders like
meillo@60 183 .I ssmtp
meillo@60 184 and
meillo@60 185 .I nullmailer .
meillo@60 186 Choices for MRAs include
meillo@60 187 .I fetchmail ,
meillo@60 188 .I getmail ,
meillo@60 189 .I mpop
meillo@60 190 and
meillo@60 191 .I fdm .
meillo@60 192
meillo@60 193
meillo@60 194 .H2 "Removal of non-MUA Tools
meillo@60 195 .P
meillo@76 196 Some MH tools were removed because they didn't add to the MUA's job.
meillo@76 197 It is a design goal of mmh to remove the parts that are rarely used.
meillo@76 198 The project shall become more stream-lined and focused.
meillo@76 199 Rarely used and loosely related tools distract from the lean appearance.
meillo@76 200 They require maintenance work without adding to the core task.
meillo@76 201 In mmh the following tools are not available anymore:
meillo@62 202 .BU
meillo@58 203 .Pn conflict
meillo@58 204 was removed because it is a mail system maintenance tool.
meillo@76 205 .Ci 8b235097cbd11d728c07b966cf131aa7133ce5a9
meillo@62 206 Besides, it even checks
meillo@58 207 .Fn /etc/passwd
meillo@58 208 and
meillo@58 209 .Fn /etc/group
meillo@62 210 for consistency, which has nothing at all to do with emailing.
meillo@58 211 The tool might be useful, but it should not be shipped with mmh.
meillo@76 212 .\" XXX historic reasons?
meillo@62 213 .BU
meillo@58 214 .Pn rcvtty
meillo@58 215 was removed because its usecase of writing to the user's terminal
meillo@76 216 on receiving of mail is obsolete.
meillo@76 217 .Ci 14767c94b3827be7c867196467ed7aea5f6f49b0
meillo@76 218 If users like to be
meillo@76 219 informed of new mail, the shell's
meillo@58 220 .Ev MAILPATH
meillo@76 221 variable or graphical notifications are more appealing.
meillo@62 222 Writing directly to a terminals is hardly ever wanted today.
meillo@62 223 If though one wants to have it this way, the standard tool
meillo@58 224 .Pn write
meillo@58 225 can be used in a way similar to:
meillo@82 226 .VS
meillo@58 227 scan -file - | write `id -un`
meillo@82 228 VE
meillo@62 229 .BU
meillo@58 230 .Pn viamail
meillo@76 231 was removed when the new attachment system was activated, because
meillo@58 232 .Pn forw
meillo@76 233 could then cover the task itself.
meillo@76 234 .Ci eda72d6a7a7c20ff123043fb7f19c509ea01f932
meillo@62 235 The program
meillo@58 236 .Pn sendfiles
meillo@62 237 was rewritten as a shell script wrapper around
meillo@58 238 .Pn forw .
meillo@76 239 .Ci 0e82199cf3c991a173e0ac8aa776efdb3ded61e6
meillo@62 240 .BU
meillo@58 241 .Pn msgchk
meillo@76 242 was removed, because it lost its use case when POP support was removed.
meillo@76 243 .Ci bb9360ead7eb7a3fedcce2eeedfc660014e41dbe
meillo@76 244 A call to
meillo@58 245 .Pn msgchk
meillo@76 246 provided hardly more information than
meillo@82 247 .VS
meillo@58 248 ls -l /var/mail/meillo
meillo@82 249 VE
meillo@76 250 though it distinguished between old and new mail.
meillo@76 251 This detail information and can be retrieved with
meillo@76 252 .Pn stat (1),
meillo@62 253 too.
meillo@62 254 A very small shell script could be written to output the information
meillo@76 255 in a similar way, if truly necessary.
meillo@76 256 As mmh's
meillo@76 257 .Pn inc
meillo@76 258 only incorporates mail from the user's local maildrop
meillo@62 259 and thus no data transfers over slow networks are involved,
meillo@76 260 there's hardly any need to check for new mail before incorporating it.
meillo@62 261 .BU
meillo@58 262 .Pn msh
meillo@76 263 was removed because the tool was in conflict with the philosophy of MH.
meillo@76 264 .Ci 916690191222433a6923a4be54b0d8f6ac01bd02
meillo@76 265 It provided an interactive shell to access the features of MH,
meillo@76 266 but it wasn't just a shell, tailored to the needs of mail handling.
meillo@76 267 Instead it was one large program that had several MH tools built in.
meillo@76 268 This conflicts with the major feature of MH of being a tool chest.
meillo@76 269 .Pn msh 's
meillo@76 270 main use case had been accessing Bulletin Boards, which have seized to
meillo@62 271 be popular.
meillo@62 272 .P
meillo@62 273 Removing
meillo@58 274 .Pn msh ,
meillo@76 275 together with the truly archaic code relicts
meillo@58 276 .Pn vmh
meillo@58 277 and
meillo@58 278 .Pn wmh ,
meillo@62 279 saved more than 7\|000 lines of C code \(en
meillo@66 280 about 15\|% of the project's original source code amount.
meillo@76 281 .P
meillo@76 282 Having less code (with equal readability, of course)
meillo@76 283 for the same functionality is an advantage.
meillo@63 284 Less code means less bugs and less maintenance work.
meillo@76 285 As
meillo@63 286 .Pn rcvtty
meillo@63 287 and
meillo@63 288 .Pn msgchk
meillo@63 289 are rarely used and can be implemented in different ways,
meillo@63 290 then why should one keep them?
meillo@76 291 Removing them stream-lines mmh.
meillo@63 292 .Pn viamail 's
meillo@63 293 use case is now partly obsolete and partly covered by
meillo@63 294 .Pn forw ,
meillo@76 295 hence there's no reason to still maintain it.
meillo@63 296 .Pn conflict
meillo@76 297 is not related to the mail client, and
meillo@63 298 .Pn msh
meillo@63 299 conflicts with the basic concept of MH.
meillo@76 300 Theses two tools might still be useful, but they should not be part of mmh.
meillo@63 301 .P
meillo@76 302 Finally, there's
meillo@76 303 .Pn slocal .
meillo@76 304 .Pn slocal
meillo@76 305 is an MDA and thus not directly MUA-related.
meillo@78 306 It should be removed, because including it is a violation
meillo@78 307 of the idea that mmh is a MUA only.
meillo@78 308 It should become a separate project.
meillo@76 309 But
meillo@76 310 .Pn slocal
meillo@76 311 provides rule-based processing of messages, like filing them into
meillo@76 312 different folders, which is otherwise not available in mmh.
meillo@76 313 Further more,
meillo@76 314 .Pn slocal
meillo@76 315 does neither pull dependencies nor a whole new technical area
meillo@76 316 into the project.
meillo@76 317 (See section XXX for the removing of the ndbm dependency.)
meillo@76 318 Still,
meillo@76 319 .Pn slocal
meillo@76 320 accounts for about 1\|000 lines of code that need to be maintained.
meillo@76 321 As
meillo@76 322 .Pn slocal
meillo@76 323 is almost self-standing, it should be split off into a separate project.
meillo@76 324 This would cut the strong connection between the MUA mmh and the MDA
meillo@76 325 .Pn slocal .
meillo@76 326 The MDA would become an alternative to
meillo@76 327 .I procmail ,
meillo@76 328 as it would no longer be the need to install a complete MH system, too.
meillo@76 329 Likewise, mmh users could decide to use
meillo@76 330 .I procmail
meillo@76 331 without having a second, unused MDA (\c
meillo@76 332 .Pn slocal )
meillo@76 333 installed.
meillo@76 334 That's conceptionally the best solution.
meillo@76 335 Yet,
meillo@76 336 .Pn slocal
meillo@78 337 was not removed.
meillo@78 338 I feel unsure with the removal.
meillo@78 339 Hence, the decision over
meillo@78 340 .Pn slocal
meillo@78 341 is deferred.
meillo@78 342 This does not hurt because
meillo@78 343 .Pn slocal
meillo@78 344 is completely unrelated to the rest of mmh.
meillo@0 345
meillo@58 346
meillo@76 347 .H2 "\fLshow\fP and \fPmhshow\fP
meillo@58 348 .P
meillo@69 349 Since the very beginning \(en already in the first concept paper \(en
meillo@58 350 .Pn show
meillo@62 351 had been MH's message display program.
meillo@58 352 .Pn show
meillo@76 353 mapped message numbers and sequences to files and invoked
meillo@58 354 .Pn mhl
meillo@76 355 to have the files formated.
meillo@76 356 For MIME, this approach wasn't sufficient anymore.
meillo@58 357 MIME messages can consist of multiple parts, some of which aren't
meillo@62 358 directly displayable, and text content might be encoded in
meillo@58 359 foreign charsets.
meillo@58 360 .Pn show 's
meillo@76 361 understanding of messages and
meillo@58 362 .Pn mhl 's
meillo@58 363 limited display facilities couldn't cope with the task any longer.
meillo@62 364 .P
meillo@76 365 Instead of extending these tools, additional tools were written from scratch
meillo@58 366 and then added to the MH tool chest. Doing so is encouraged by the
meillo@58 367 tool chest approach. The new tools could be added without interfering
meillo@78 368 with the existing ones.
meillo@78 369 Modular design is a great advantage for extending a system.
meillo@62 370 First, the new MIME features were added in form of the single program
meillo@58 371 .Pn mhn .
meillo@58 372 The command
meillo@82 373 .Cl "mhn -show 42
meillo@58 374 would show the MIME message numbered 42.
meillo@58 375 With the 1.0 release of nmh in February 1999, Richard Coleman finished
meillo@58 376 the split of
meillo@58 377 .Pn mhn
meillo@58 378 into a set of specialized programs, which together covered the
meillo@62 379 multiple aspects of MIME. One of these resulting tools was
meillo@69 380 .Pn mhshow ,
meillo@69 381 which replaced the
meillo@82 382 .Cl "mhn -show
meillo@62 383 call.
meillo@76 384 It was capable to display a MIME message appropriately.
meillo@62 385 .P
meillo@76 386 From then on, two message display tools were part of nmh:
meillo@76 387 .Pn show
meillo@76 388 and
meillo@76 389 .Pn mhshow .
meillo@76 390 Because the user should not need to invoke the right tool
meillo@69 391 whether the message uses MIME or not,
meillo@69 392 .Pn show
meillo@69 393 was extended to automatically hand the job over to
meillo@69 394 .Pn mhshow
meillo@69 395 if displaying the message would be beyond
meillo@69 396 .Pn show 's
meillo@69 397 abilities.
meillo@69 398 In consequence, the user would invoke
meillo@69 399 .Pn show
meillo@69 400 (possibly through
meillo@69 401 .Pn next
meillo@69 402 or
meillo@69 403 .Pn prev )
meillo@69 404 and get the message printed with either
meillo@69 405 .Pn show
meillo@69 406 or
meillo@69 407 .Pn mhshow ,
meillo@69 408 whatever was more appropriate.
meillo@69 409 (There was also a switch for
meillo@69 410 .Pn show
meillo@69 411 to never invoke
meillo@76 412 .Pn mhshow .
meillo@76 413 .Pn show
meillo@76 414 was able to display MIME messages if they contained only a single text
meillo@76 415 part.)
meillo@69 416 .P
meillo@69 417 Having two similar tools for essentially the same task is redundant.
meillo@76 418 The development of both programs needed to be in sync,
meillo@76 419 to ensure that the programs behaved in a similar way,
meillo@76 420 because they were used like a single tool.
meillo@76 421 Different behavior would have surprised the user.
meillo@69 422 .P
meillo@69 423 Today, non-MIME messages are rather seen to be a special case of
meillo@69 424 MIME messages, than MIME messages are seen to be an extension to
meillo@76 425 original email.
meillo@69 426 As
meillo@69 427 .Pn mhshow
meillo@69 428 had already be able to display non-MIME messages, it was natural
meillo@69 429 to drop
meillo@69 430 .Pn show
meillo@69 431 in favor of using
meillo@69 432 .Pn mhshow
meillo@69 433 exclusively.
meillo@76 434 This decision followed the idea of orthogonal design.
meillo@76 435 For convenience,
meillo@76 436 .Pn mhshow
meillo@76 437 was then renamed to
meillo@76 438 .Pn show .
meillo@72 439 .Ci 4c1efddfd499300c7e74263e57d8aa137e84c853
meillo@69 440 .P
meillo@76 441 To prepare for this transition,
meillo@69 442 .Pn mhshow
meillo@69 443 was reworked to behave more like
meillo@69 444 .Pn show
meillo@69 445 first.
meillo@76 446 (Section XXX describes this rework from a different perspective.)
meillo@69 447 Once the tools behaved similar, the replacing became a natural decision.
meillo@69 448 In mmh,
meillo@69 449 .Pn show
meillo@69 450 is the one single message display program again, but it handles
meillo@69 451 MIME messages as well as non-MIME messages.
meillo@76 452 Now, there's only one program to maintain, and users don't need to deal
meillo@69 453 with the existance of two display programs.
meillo@69 454 .P
meillo@76 455 There's one reason why removing the old
meillo@69 456 .Pn show
meillo@69 457 hurts: It had been such a simple program.
meillo@69 458 Its lean elegance is missing to
meillo@69 459 .Pn mhshow ,
meillo@69 460 i.e. the new
meillo@69 461 .Pn show .
meillo@69 462 But there is no chance, because supporting MIME causes essentially
meillo@69 463 higher complexity.
meillo@58 464
meillo@58 465
meillo@58 466 .H2 "Removal of Configure Options
meillo@58 467 .P
meillo@76 468 Customization is a double-edged sword.
meillo@76 469 It allows better suiting setups, but not for free.
meillo@76 470 There is the cost of code complexity to be able to customize.
meillo@76 471 There is the cost of less tested setups, because there are
meillo@72 472 more possible setups and especially corner-cases.
meillo@76 473 And, there is the cost of choice itself.
meillo@76 474 The code complexity directly affects the developers.
meillo@72 475 Less tested code affects both, users and developers.
meillo@76 476 The problem of choice affects the users, for once by having to
meillo@76 477 choose, but also by complexer interfaces that require more documentation.
meillo@72 478 Whenever options add little advantages, they should be considered for
meillo@72 479 removal.
meillo@72 480 I have reduced the number of project-specific configure options from
meillo@72 481 fifteen to three.
meillo@74 482
meillo@76 483 .U3 "Mail Transfer Facilities
meillo@74 484 .P
meillo@85 485 With the removal of the mail transfer facilities five configure
meillo@85 486 options vanished:
meillo@85 487 .P
meillo@85 488 The switches
meillo@85 489 .Sw --with-tls
meillo@85 490 and
meillo@85 491 .Sw --with-cyrus-sasl
meillo@85 492 had activated the support for transfer encryption and authetication.
meillo@85 493 This is not needed anymore.
meillo@85 494 .Ci fecd5d34f65597a4dfa16aeabea7d74b191532c3
meillo@85 495 .Ci 156d35f6425bea4c1ed3c4c79783dc613379c65b
meillo@85 496 .P
meillo@85 497 The configure switch
meillo@85 498 .Sw --enable-pop
meillo@85 499 activated the message retrieval facility.
meillo@85 500 The code area that would be conditionally compiled in for TLS and SASL
meillo@85 501 support had been small.
meillo@85 502 The conditionally compiled code area for POP support had been much larger.
meillo@85 503 Whereas the code base changes would only slightly change on toggling
meillo@85 504 TLS or SASL support, it changed much on toggling POP support.
meillo@85 505 The changes in the code base could hardly be overviewed.
meillo@85 506 By having POP support togglable a second code base had been created,
meillo@85 507 one that needed to be tested.
meillo@85 508 This situation is basically similar for the conditional TLS and SASL
meillo@85 509 code, but there the changes are minor and can yet be overviewed.
meillo@85 510 Still, conditional compilation of a code base creates variations
meillo@85 511 of the original program.
meillo@85 512 More variations require more testing and maintenance work.
meillo@85 513 .P
meillo@85 514 Two other options only specified default configuration values:
meillo@85 515 .Sw --with-mts=[smtp|sendmail]
meillo@85 516 defined the default transport service.
meillo@85 517 In mmh this fixed to
meillo@85 518 .Ar sendmail .
meillo@85 519 .Ci f6aa95b724fd8c791164abe7ee5468bf5c34f226
meillo@85 520 With
meillo@85 521 .Sw --with-smtpservers=[server1...]
meillo@85 522 default SMTP servers for the
meillo@85 523 .Ar smtp
meillo@85 524 transport service could be specified.
meillo@72 525 .Ci 128545e06224233b7e91fc4c83f8830252fe16c9
meillo@85 526 Both of them became irrelevant.
meillo@72 527
meillo@74 528 .U3 "Backup Prefix
meillo@74 529 .P
meillo@76 530 The backup prefix is the string that was prepended to message
meillo@76 531 filenames to tag them as deleted.
meillo@76 532 By default it had been the comma character `\f(CW,\fP'.
meillo@78 533 In July 2000, Kimmo Suominen introduced
meillo@78 534 the configure option
meillo@78 535 .Sw --with-hash-backup
meillo@78 536 to change the default to the hash symbol `\f(CW#\fP'.
meillo@78 537 The choice was probably personal preference, because first, the
meillo@78 538 option was named
meillo@78 539 .Sw --with-backup-prefix.
meillo@78 540 and had the prefix symbol as argument.
meillo@78 541 Because giving the hash symbol as argument caused to many problems
meillo@78 542 for configure,
meillo@78 543 the option was limited to use the hash symbol as the default prefix.
meillo@78 544 This makes me believe, that the choice for the hash was personal preference.
meillo@78 545 Being it related or not, words that start with the hash symbol
meillo@78 546 introduce a comment in the Unix shell.
meillo@72 547 Thus, the command line
meillo@72 548 .Cl "rm #13 #15
meillo@72 549 calls
meillo@72 550 .Pn rm
meillo@72 551 without arguments because the first hash symbol starts the comment
meillo@72 552 that reaches until the end of the line.
meillo@72 553 To delete the backup files,
meillo@72 554 .Cl "rm ./#13 ./#15"
meillo@72 555 needs to be used.
meillo@78 556 Using the hash as backup prefix can be seen as a precaution agains
meillo@78 557 data loss.
meillo@78 558 .P
meillo@72 559 I removed the configure option but added the profile entry
meillo@72 560 .Pe backup-prefix ,
meillo@72 561 which allows to specify an arbitrary string as backup prefix.
meillo@72 562 .Ci 6c40d481d661d532dd527eaf34cebb6d3f8ed086
meillo@76 563 Profile entries are the common method to change mmh's behavior.
meillo@76 564 This change did not remove the choice but moved it to a location where
meillo@72 565 it suited better.
meillo@76 566 .P
meillo@78 567 Eventually, however, the new trash folder concept
meillo@78 568 .Cf "Sec. XXX
meillo@78 569 obsoleted the concept of the backup prefix completely.
meillo@78 570 .Ci 8edc5aaf86f9f77124664f6801bc6c6cdf258173
meillo@72 571 (Well, there still are corner-cases to remove until the backup
meillo@72 572 prefix can be layed to rest, eventually.)
meillo@72 573 .\" FIXME: Do this work in the code!
meillo@76 574
meillo@76 575 .U3 "Editor and Pager
meillo@74 576 .P
meillo@74 577 The two configure options
meillo@74 578 .CW --with-editor=EDITOR
meillo@74 579 .CW --with-pager=PAGER
meillo@74 580 were used to specify the default editor and pager at configure time.
meillo@74 581 Doing so at configure time made sense in the Eighties,
meillo@76 582 when the set of available editors and pagers varied much across
meillo@76 583 different systems.
meillo@76 584 Today, the situation is more homegeneic.
meillo@74 585 The programs
meillo@74 586 .Pn vi
meillo@74 587 and
meillo@74 588 .Pn more
meillo@76 589 can be expected to be available on every Unix system,
meillo@74 590 as they are specified by POSIX since two decades.
meillo@74 591 (The specifications for
meillo@74 592 .Pn vi
meillo@74 593 and
meillo@74 594 .Pn more
meillo@74 595 appeared in
meillo@74 596 .[
meillo@74 597 posix 1987
meillo@74 598 .]
meillo@74 599 and,
meillo@74 600 .[
meillo@74 601 posix 1992
meillo@74 602 .]
meillo@74 603 respectively.)
meillo@74 604 As a first step, these two tools were hard-coded as defaults.
meillo@74 605 .Ci 5d43a99db70c12a673028c7758c20cbe3e13ef5f
meillo@74 606 Not changed were the
meillo@74 607 .Pe editor
meillo@74 608 and
meillo@74 609 .Pe moreproc
meillo@76 610 profile entries, which allowed the user to override the system defaults.
meillo@74 611 Later, the concept was reworked to respect the standard environment
meillo@74 612 variables
meillo@74 613 .Ev VISUAL
meillo@74 614 and
meillo@74 615 .Ev PAGER
meillo@76 616 if they are set.
meillo@74 617 Today, mmh determines the editor to use in the following order,
meillo@74 618 taking the first available and non-empty item:
meillo@74 619 .IP (1)
meillo@74 620 Environment variable
meillo@74 621 .Ev MMHEDITOR
meillo@74 622 .IP (2)
meillo@74 623 Profile entry
meillo@74 624 .Pe Editor
meillo@74 625 .IP (3)
meillo@74 626 Environment variable
meillo@74 627 .Ev VISUAL
meillo@74 628 .IP (4)
meillo@74 629 Environment variable
meillo@74 630 .Ev EDITOR
meillo@74 631 .IP (5)
meillo@74 632 Command
meillo@74 633 .Pn vi .
meillo@74 634 .P
meillo@76 635 .Ci f85f4b7ae62e3d05a945dcd46ead51f0a2a89a9b
meillo@76 636 .P
meillo@76 637 The pager to use is deteminded in a similar order,
meillo@74 638 also taking the first available and non-empty item:
meillo@74 639 .IP (1)
meillo@74 640 Environment variable
meillo@74 641 .Ev MMHPAGER
meillo@74 642 .IP (2)
meillo@74 643 Profile entry
meillo@74 644 .Pe Pager
meillo@74 645 (replaces
meillo@74 646 .Pe moreproc )
meillo@74 647 .IP (3)
meillo@74 648 Environment variable
meillo@74 649 .Ev PAGER
meillo@74 650 .IP (4)
meillo@74 651 Command
meillo@74 652 .Pn more .
meillo@74 653 .P
meillo@74 654 .Ci 0c4214ea2aec6497d0d67b436bbee9bc1d225f1e
meillo@74 655 .P
meillo@76 656 By respecting the
meillo@74 657 .Ev VISUAL /\c
meillo@74 658 .Ev EDITOR
meillo@74 659 and
meillo@74 660 .Ev PAGER
meillo@76 661 environment variables,
meillo@76 662 the new behavior confirms better to the common style on Unix systems.
meillo@76 663 Additionally, the new approach is more uniform and clearer to users.
meillo@72 664
meillo@74 665 .U3 "Locale
meillo@74 666 .P
meillo@74 667 The configure option
meillo@74 668 .Sw --disable-locale
meillo@85 669 was removed because POSIX provides locale support and there's
meillo@85 670 hardly any need to disable locale support.
meillo@74 671 .Ci ccf4f175ef4c4e7522f9510a4a1149c15d810dd9
meillo@72 672
meillo@76 673 .U3 "ndbm
meillo@72 674 .P
meillo@74 675 .Pn slocal
meillo@78 676 used to depend on
meillo@74 677 .I ndbm ,
meillo@74 678 a database library.
meillo@76 679 The database is used to store the `\fLMessage-ID\fP's of all
meillo@76 680 messages delivered.
meillo@74 681 This enables
meillo@74 682 .Pn slocal
meillo@74 683 to suppress delivering the same message to the same user twice.
meillo@74 684 (This features was enabled by the
meillo@74 685 .Sw -suppressdup
meillo@74 686 switch.)
meillo@74 687 .P
meillo@74 688 A variety of version of the database library exist.
meillo@78 689 .[
meillo@78 690 wolter unix incompat notes dbm
meillo@78 691 .]
meillo@74 692 Complicated autoconf code was needed to detect them correctly.
meillo@74 693 Further more, the configure switches
meillo@74 694 .Sw --with-ndbm=ARG
meillo@74 695 and
meillo@74 696 .Sw --with-ndbmheader=ARG
meillo@74 697 were added to help with difficult setups that would
meillo@78 698 not be detected automatically or correctly.
meillo@74 699 .P
meillo@74 700 By removing the suppress duplicates feature of
meillo@74 701 .Pn slocal ,
meillo@74 702 the dependency on
meillo@74 703 .I ndbm
meillo@78 704 vanished and 120 lines of complex autoconf code could be saved.
meillo@74 705 .Ci ecd6d6a20cb7a1507e3a20d6c4cb3a1cf14c6bbf
meillo@78 706 The change removed funtionality too, but that is minor to the
meillo@78 707 improvement by dropping the dependency and the complex autoconf code.
meillo@72 708
meillo@74 709 .U3 "mh-e Support
meillo@72 710 .P
meillo@74 711 The configure option
meillo@74 712 .Sw --disable-mhe
meillo@74 713 was removed when the mh-e support was reworked.
meillo@74 714 Mh-e is the Emacs front-end to MH.
meillo@76 715 It requires MH to provide minor additional functions.
meillo@76 716 The
meillo@76 717 .Sw --disable-mhe
meillo@76 718 configure option could switch these extensions off.
meillo@76 719 After removing the support for old versions of mh-e,
meillo@74 720 only the
meillo@74 721 .Sw -build
meillo@76 722 switches of
meillo@74 723 .Pn forw
meillo@74 724 and
meillo@74 725 .Pn repl
meillo@76 726 are left to be mh-e extensions.
meillo@76 727 They are now always built in because they add little code and complexity.
meillo@76 728 In consequence, the
meillo@74 729 .Sw --disable-mhe
meillo@76 730 configure option was removed
meillo@72 731 .Ci a7ce7b4a580d77b6c2c4d980812beb589aa4c643
meillo@74 732 Removing the option removed a second code setup that would have
meillo@74 733 needed to be tested.
meillo@76 734 This change was first done in nmh and thereafter merged into mmh.
meillo@76 735 .P
meillo@76 736 The interface changes in mmh require mh-e to be adjusted in order
meillo@76 737 to be able to use mmh as back-end.
meillo@76 738 This will require minor changes to mh-e, but removing the
meillo@76 739 .Sw -build
meillo@76 740 switches would require more rework.
meillo@72 741
meillo@74 742 .U3 "Masquerading
meillo@72 743 .P
meillo@74 744 The configure option
meillo@74 745 .Sw --enable-masquerade
meillo@76 746 could take up to three arguments:
meillo@76 747 `draft_from', `mmailid', and `username_extension'.
meillo@74 748 They activated different types of address masquerading.
meillo@74 749 All of them were implemented in the SMTP-speaking
meillo@74 750 .Pn post
meillo@76 751 command, which provided an MSA.
meillo@76 752 Address masquerading is an MTA's task and mmh does not cover
meillo@76 753 this field anymore.
meillo@76 754 Hence, true masquerading needs to be implemented in the external MTA.
meillo@74 755 .P
meillo@74 756 The
meillo@74 757 .I mmailid
meillo@74 758 masquerading type is the oldest one of the three and the only one
meillo@74 759 available in the original MH.
meillo@74 760 It provided a
meillo@74 761 .I username
meillo@74 762 to
meillo@74 763 .I fakeusername
meillo@76 764 mapping, based on the password file's GECOS field.
meillo@74 765 The man page
meillo@74 766 .Mp mh-tailor(5)
meillo@74 767 described the use case as being the following:
meillo@74 768 .QP
meillo@74 769 This is useful if you want the messages you send to always
meillo@74 770 appear to come from the name of an MTA alias rather than your
meillo@74 771 actual account name. For instance, many organizations set up
meillo@74 772 `First.Last' sendmail aliases for all users. If this is
meillo@74 773 the case, the GECOS field for each user should look like:
meillo@74 774 ``First [Middle] Last <First.Last>''
meillo@74 775 .P
meillo@74 776 As mmh sends outgoing mail via the local MTA only,
meillo@76 777 the best location to do such global rewrites is there.
meillo@74 778 Besides, the MTA is conceptionally the right location because it
meillo@74 779 does the reverse mapping for incoming mail (aliasing), too.
meillo@76 780 Further more, masquerading set up there is readily available for all
meillo@74 781 mail software on the system.
meillo@76 782 Hence, mmailid masquerading was removed.
meillo@74 783 .Ci 0836c8000ccb34b59410ef1c15b1b7feac70ce5f
meillo@74 784 .P
meillo@74 785 The
meillo@74 786 .I username_extension
meillo@76 787 masquerading type did not replace the username but would append a suffix,
meillo@76 788 specified by the
meillo@74 789 .Ev USERNAME_EXTENSION
meillo@76 790 environment variable, to it.
meillo@76 791 This provided support for the
meillo@74 792 .I user-extension
meillo@74 793 feature of qmail and the similar
meillo@74 794 .I "plussed user
meillo@74 795 processing of sendmail.
meillo@74 796 The decision to remove this username_extension masquerading was
meillo@74 797 motivated by the fact that
meillo@74 798 .Pn spost
meillo@76 799 hadn't supported it already.
meillo@76 800 .Ci 2abae0bfd0ad5bf898461e50aa4b466d641f23d9
meillo@76 801 Username extensions are possible in mmh, but less convenient to use.
meillo@76 802 .\" XXX format file %(getenv USERNAME_EXTENSION)
meillo@74 803 .P
meillo@74 804 The
meillo@74 805 .I draft_from
meillo@74 806 masquerading type instructed
meillo@74 807 .Pn post
meillo@84 808 to use the value of the
meillo@84 809 .Hd From
meillo@84 810 header field as SMTP envelope sender.
meillo@76 811 Sender addresses could be replaced completely.
meillo@74 812 .Ci b14ea6073f77b4359aaf3fddd0e105989db9
meillo@76 813 Mmh offers a kind of masquerading similar in effect, but
meillo@74 814 with technical differences.
meillo@76 815 As mmh does not transfer messages itself, the local MTA has final control
meillo@76 816 over the sender's address. Any masquerading mmh introduces may be reverted
meillo@76 817 by the MTA.
meillo@76 818 In times of pedantic spam checking, an MTA will take care to use
meillo@76 819 sensible envelope sender addresses to keep its own reputation up.
meillo@84 820 Nonetheless, the MUA can set the
meillo@84 821 .Hd From
meillo@84 822 header field and thereby propose
meillo@76 823 a sender address to the MTA.
meillo@74 824 The MTA may then decide to take that one or generate the canonical sender
meillo@74 825 address for use as envelope sender address.
meillo@74 826 .P
meillo@74 827 In mmh, the MTA will always extract the recipient and sender from the
meillo@84 828 message header (\c
meillo@74 829 .Pn sendmail 's
meillo@74 830 .Sw -t
meillo@74 831 switch).
meillo@84 832 The
meillo@84 833 .Hd From
meillo@84 834 header field of the draft may be set arbitrary by the user.
meillo@74 835 If it is missing, the canonical sender address will be generated by the MTA.
meillo@74 836
meillo@74 837 .U3 "Remaining Options
meillo@74 838 .P
meillo@74 839 Two configure options remain in mmh.
meillo@74 840 One is the locking method to use:
meillo@74 841 .Sw --with-locking=[dot|fcntl|flock|lockf] .
meillo@76 842 The idea of removing all methods except the portable dot locking
meillo@76 843 and having that one as the default is appealing, but this change
meillo@76 844 requires deeper technical investigation into the topic.
meillo@76 845 The other option,
meillo@74 846 .Sw --enable-debug ,
meillo@74 847 compiles the programs with debugging symbols and does not strip them.
meillo@74 848 This option is likely to stay.
meillo@72 849
meillo@72 850
meillo@58 851
meillo@63 852
meillo@58 853 .H2 "Removal of switches
meillo@58 854 .P
meillo@58 855
meillo@58 856
meillo@58 857
meillo@58 858
meillo@74 859 .H1 "Modernizing
meillo@58 860
meillo@58 861
meillo@58 862 .H2 "Removal of Code Relicts
meillo@0 863 .P
meillo@51 864 The code base of mmh originates from the late Seventies,
meillo@51 865 had been extensively
meillo@51 866 worked on in the mid Eighties, and had been partly reorganized and extended
meillo@51 867 in the Nineties. Relicts of all those times had gathered in the code base.
meillo@12 868 My goal was to remove any ancient code parts. One part of the task was
meillo@12 869 converting obsolete code constructs to standard constructs, the other part
meillo@12 870 was dropping obsolete functions.
meillo@12 871 .P
meillo@12 872 As I'm not even thirty years old and have no more than seven years of
meillo@51 873 Unix experience, I needed to learn about the history in retrospective.
meillo@51 874 Older people likely have used those ancient constructs themselves
meillo@51 875 and have suffered from their incompatibilities and have longed for
meillo@12 876 standardization. Unfortunately, I have only read that others had done so.
meillo@12 877 This put me in a much more difficult positions when working on the old
meillo@12 878 code. I needed to recherche what other would have known by heart from
meillo@12 879 experience. All my programming experience comes from a time past ANSI C
meillo@12 880 and past POSIX. Although I knew about the times before, I took the
meillo@51 881 current state implicitly for granted most of the time.
meillo@12 882 .P
meillo@12 883 Being aware of
meillo@12 884 these facts, I rather let people with more historic experience solve the
meillo@12 885 task of converting the ancient code constructs to standardized ones.
meillo@12 886 Luckily, Lyndon Nerenberg focused on this task at the nmh project.
meillo@12 887 He converted large parts of the code to POSIX constructs, removing
meillo@12 888 the conditionals compilation for now standardized features.
meillo@12 889 I'm thankful for this task being solved. I only pulled the changes into
meillo@12 890 mmh.
meillo@12 891 .P
meillo@20 892 The other task \(en dropping ancient functionality to remove old code \(en
meillo@12 893 I did myself, though. My position to strip mmh to the bare minimum of
meillo@12 894 frequently used features is much more revolutional than the nmh community
meillo@20 895 likes it. Without the need to justify my decisions, I was able to quickly
meillo@20 896 remove functionality I considered ancient.
meillo@20 897 The need to discuss my decisions with
meillo@20 898 peers likely would have slowed this process down. Of course, I researched
meillo@12 899 if a particular feature really should be dropped. Having not had any
meillo@12 900 contact to this feature within my computer life was a first indicator to
meillo@12 901 drop it, but I also asked others and searched the literature for modern
meillo@12 902 usage of the feature. If it appeared to be truly ancient, I dropped it.
meillo@12 903 The reason for dropping is always part of the commit message in the
meillo@12 904 version control system. Thus, it is easy for others to check their
meillo@12 905 view on the topic with mine and possibly to argue for reinclusion.
meillo@12 906
meillo@12 907 .U2 "MMDF maildrop support
meillo@12 908 .P
meillo@12 909 I did drop any support for the MMDF maildrop format. This type of format
meillo@12 910 is conceptionally similar to the mbox format, but uses four bytes with
meillo@12 911 value 1 (\fL^A^A^A^A\fP) as message delimiter,
meillo@18 912 instead of the string ``\fLFrom\ \fP''.
meillo@12 913 Due to the similarity and mbox being the de-facto standard maildrop
meillo@12 914 format on Unix, but also due to the larger influence of Sendmail than MMDF,
meillo@12 915 the MMDF maildrop format had vanished.
meillo@12 916 .P
meillo@12 917 The simplifications within the code were only moderate. Switches could
meillo@12 918 be removed from tools like
meillo@12 919 .L packf ,
meillo@12 920 which generate packed mailboxes. Only one packed mailbox format remained:
meillo@12 921 mbox.
meillo@12 922 The most important changes affect the equally named mail parsing routine in
meillo@12 923 .L sbr/m_getfld.c .
meillo@12 924 The direct MMDF code had been removed, but as now only one packed mailbox
meillo@12 925 format is left, code structure simplifications are likely possible.
meillo@12 926 The reason why they are still outstanding is the heavily optimized code
meillo@18 927 of
meillo@18 928 .Fu m_getfld() .
meillo@18 929 Changes beyond a small local scope \(en
meillo@12 930 which restructuring in its core is \(en cause a high risk of damaging
meillo@12 931 the intricate workings of the optimized code. This problem is know
meillo@12 932 to the developers of nmh, too. They also avoid touching this minefield
meillo@12 933 if possible.
meillo@12 934
meillo@12 935 .U2 "UUCP Bang Paths
meillo@12 936 .P
meillo@12 937 More questionably than the former topic is the removal of support for the
meillo@12 938 UUCP bang path address style. However, the user may translate the bang
meillo@12 939 paths on retrieval to Internet addresses and the other way on posting
meillo@12 940 messages. The former can be done my an MDA like procmail; the latter
meillo@12 941 by a sendmail wrapper. This would ensure that any address handling would
meillo@12 942 work as expected. However, it might just work well without any
meillo@12 943 such modifications, as mmh does not touch addresses much, in general.
meillo@12 944 But I can't ensure as I have never used an environment with bang paths.
meillo@12 945 Also, the behavior might break at any point in further development.
meillo@12 946
meillo@12 947 .U2 "Hardcopy terminal support
meillo@12 948 .P
meillo@12 949 More of a funny anecdote is the remaining of a check for printing to a
meillo@12 950 hardcopy terminal until Spring 2012, when I finally removed it.
meillo@12 951 I surely would be very happy to see such a terminal in action, maybe
meillo@12 952 actually being able to work on it, but I fear my chances are null.
meillo@12 953 .P
meillo@12 954 The check only prevented a pager to be placed between the outputting
meillo@18 955 program (\c
meillo@18 956 .Pn mhl )
meillo@18 957 and the terminal. This could have been ensured with
meillo@18 958 the
meillo@82 959 .Sw -nomoreproc
meillo@18 960 at the command line statically, too.
meillo@12 961
meillo@12 962 .U2 "Removed support for header fields
meillo@12 963 .P
meillo@84 964 The
meillo@84 965 .Hd Encrypted
meillo@84 966 header field had been introduced by RFC\^822, but already
meillo@12 967 marked legacy in RFC 2822. It was superseded by FIXME.
meillo@84 968 Mmh does no more support this header field.
meillo@12 969 .P
meillo@84 970 Native support for
meillo@84 971 .Hd Face
meillo@84 972 header fields had been removed, as well.
meillo@84 973 The feature is similar to the
meillo@84 974 .Hd X-Face
meillo@84 975 header field in its intent,
meillo@21 976 but takes a different approach to store the image.
meillo@84 977 Instead of encoding the image data directly into the header field,
meillo@84 978 the it contains the hostname and UDP port where the image
meillo@21 979 date could be retrieved.
meillo@84 980 Neither
meillo@84 981 .Hd X-Face
meillo@84 982 nor the here described
meillo@84 983 .Hd Face
meillo@84 984 system
meillo@21 985 \**
meillo@21 986 .FS
meillo@21 987 There is also a newer but different system, invented 2005,
meillo@84 988 using
meillo@84 989 .Hd Face
meillo@84 990 headers.
meillo@84 991 It is the successor of
meillo@84 992 .Hd X-Face
meillo@84 993 providing colored PNG images.
meillo@21 994 .FE
meillo@21 995 became well used in the large scale.
meillo@21 996 It's still possible to use a Face systems,
meillo@21 997 although mmh does not provide support for any of the different systems
meillo@21 998 anymore. It's fairly easy to write a small shell script to
meillo@21 999 extract the embedded or fetch the external Face data and display the image.
meillo@84 1000 Own
meillo@84 1001 .Hd Face
meillo@84 1002 header field can be added into the draft template files.
meillo@21 1003 .P
meillo@84 1004 .Hd Content-MD5
meillo@84 1005 header fields were introduced by RFC\^1864. They provide only
meillo@12 1006 a verification of data corruption during the transfer. By no means can
meillo@12 1007 they ensure verbatim end-to-end delivery of the contents. This is clearly
meillo@12 1008 stated in the RFC. The proper approach to provide verificationability
meillo@12 1009 of content in an end-to-end relationship is the use of digital cryptography
meillo@12 1010 (RFCs FIXME). On the other hand, transfer protocols should ensure the
meillo@12 1011 integrity of the transmission. In combinations these two approaches
meillo@84 1012 make the
meillo@84 1013 .Hd Content-MD5
meillo@84 1014 header field useless. In consequence, I removed
meillo@12 1015 the support for it. By this removal, MD5 computation is not needed
meillo@12 1016 anywhere in mmh. Hence, over 500 lines of code were removed by this one
meillo@84 1017 change. Even if the
meillo@84 1018 .Hd Content-MD5
meillo@84 1019 header field is useful sometimes,
meillo@12 1020 I value its usefulnes less than the improvement in maintainability, caused
meillo@12 1021 by the removal.
meillo@12 1022
meillo@20 1023 .U2 "Prompter's Control Keys
meillo@20 1024 .P
meillo@20 1025 The program
meillo@20 1026 .Pn prompter
meillo@20 1027 queries the user to fill in a message form. When used by
meillo@20 1028 .Pn comp
meillo@20 1029 as:
meillo@82 1030 .VS
meillo@82 1031 comp -editor prompter
meillo@82 1032 VE
meillo@20 1033 the resulting behavior is similar to
meillo@20 1034 .Pn mailx .
meillo@51 1035 Apparently,
meillo@20 1036 .Pn prompter
meillo@20 1037 hadn't been touched lately. Otherwise it's hardly explainable why it
meillo@20 1038 still offered the switches
meillo@84 1039 .Sw -erase
meillo@84 1040 .Ar chr
meillo@20 1041 and
meillo@84 1042 .Sw -kill
meillo@84 1043 .Ar chr
meillo@20 1044 to name the characters for command line editing.
meillo@21 1045 The times when this had been necessary are long time gone.
meillo@20 1046 Today these things work out-of-the-box, and if not, are configured
meillo@20 1047 with the standard tool
meillo@20 1048 .Pn stty .
meillo@20 1049
meillo@21 1050 .U2 "Vfork and Retry Loops
meillo@21 1051 .P
meillo@51 1052 MH creates many processes, which is a consequence of the tool chest approach.
meillo@21 1053 In earlier times
meillo@21 1054 .Fu fork()
meillo@21 1055 had been an expensive system call, as the process's whole image needed
meillo@21 1056 to be duplicated. One common case is replacing the image with
meillo@21 1057 .Fu exec()
meillo@21 1058 right after having forked the child process.
meillo@21 1059 To speed up this case, the
meillo@21 1060 .Fu vfork()
meillo@21 1061 system call was invented at Berkeley. It completely omits copying the
meillo@21 1062 image. If the image gets replaced right afterwards then unnecessary
meillo@21 1063 work is omited. On old systems this results in large speed ups.
meillo@21 1064 MH uses
meillo@21 1065 .Fu vfork()
meillo@21 1066 whenever possible.
meillo@21 1067 .P
meillo@21 1068 Memory management units that support copy-on-write semantics make
meillo@21 1069 .Fu fork()
meillo@21 1070 almost as fast as
meillo@21 1071 .Fu vfork()
meillo@21 1072 in the cases when they can be exchanged.
meillo@21 1073 With
meillo@21 1074 .Fu vfork()
meillo@51 1075 being more error-prone and hardly faster, it's preferable to simply
meillo@21 1076 use
meillo@21 1077 .Fu fork()
meillo@21 1078 instead.
meillo@21 1079 .P
meillo@21 1080 Related to the costs of
meillo@21 1081 .Fu fork()
meillo@21 1082 is the probability of its success.
meillo@21 1083 Today on modern systems, the system call will succeed almost always.
meillo@51 1084 In the Eighties on heavy loaded systems, as they were common at
meillo@21 1085 universities, this had been different. Thus, many of the
meillo@21 1086 .Fu fork()
meillo@21 1087 calls were wrapped into loops to retry to fork several times in
meillo@21 1088 short intervals, in case of previous failure.
meillo@21 1089 In mmh, the program aborts at once if the fork failed.
meillo@21 1090 The user can reexecute the command then. This is expected to be a
meillo@21 1091 very rare case on modern systems, especially personal ones, which are
meillo@21 1092 common today.
meillo@21 1093
meillo@12 1094
meillo@58 1095 .H2 "Attachments
meillo@22 1096 .P
meillo@58 1097 MIME
meillo@58 1098
meillo@58 1099
meillo@58 1100 .H2 "Digital Cryptography
meillo@22 1101 .P
meillo@58 1102 Signing and encryption.
meillo@58 1103
meillo@58 1104
meillo@58 1105 .H2 "Good Defaults
meillo@22 1106 .P
meillo@58 1107 foo
meillo@58 1108
meillo@58 1109
meillo@58 1110
meillo@58 1111
meillo@58 1112 .H1 "Code style
meillo@22 1113 .P
meillo@58 1114 foo
meillo@58 1115
meillo@58 1116
meillo@58 1117 .H2 "Standard Code
meillo@22 1118 .P
meillo@58 1119 POSIX
meillo@22 1120
meillo@22 1121
meillo@58 1122 .H2 "Separation
meillo@14 1123
meillo@58 1124 .U2 "MH Directory Split
meillo@0 1125 .P
meillo@19 1126 In MH and nmh, a personal setup had consisted of two parts:
meillo@19 1127 The MH profile, named
meillo@19 1128 .Fn \&.mh_profile
meillo@19 1129 and being located directly in the user's home directory.
meillo@19 1130 And the MH directory, where all his mail messages and also his personal
meillo@19 1131 forms, scan formats, other configuration files are stored. The location
meillo@19 1132 of this directory could be user-chosen. The default was to name it
meillo@19 1133 .Fn Mail
meillo@19 1134 and have it directly in the home directory.
meillo@19 1135 .P
meillo@19 1136 I've never liked the data storage and the configuration to be intermixed.
meillo@19 1137 They are different kinds of data. One part, are the messages,
meillo@19 1138 which are the data to operate on. The other part, are the personal
meillo@19 1139 configuration files, which are able to change the behavior of the operations.
meillo@19 1140 The actual operations are defined in the profile, however.
meillo@19 1141 .P
meillo@19 1142 When storing data, one should try to group data by its type.
meillo@19 1143 There's sense in the Unix file system hierarchy, where configuration
meillo@19 1144 file are stored separate (\c
meillo@19 1145 .Fn /etc )
meillo@19 1146 to the programs (\c
meillo@19 1147 .Fn /bin
meillo@19 1148 and
meillo@19 1149 .Fn /usr/bin )
meillo@19 1150 to their sources (\c
meillo@19 1151 .Fn /usr/src ).
meillo@19 1152 Such separation eases the backup management, for instance.
meillo@19 1153 .P
meillo@19 1154 In mmh, I've reorganized the file locations.
meillo@19 1155 Still there are two places:
meillo@19 1156 There's the mail storage directory, which, like in MH, contains all the
meillo@19 1157 messages, but, unlike in MH, nothing else.
meillo@19 1158 Its location still is user-chosen, with the default name
meillo@19 1159 .Fn Mail ,
meillo@19 1160 in the user's home directory. This is much similar to the case in nmh.
meillo@19 1161 The configuration files, however, are grouped together in the new directory
meillo@19 1162 .Fn \&.mmh
meillo@19 1163 in the user's home directory.
meillo@19 1164 The user's profile now is a file, named
meillo@19 1165 .Fn profile ,
meillo@19 1166 in this mmh directory.
meillo@19 1167 Consistently, the context file and all the personal forms, scan formats,
meillo@19 1168 and the like, are also there.
meillo@19 1169 .P
meillo@19 1170 The naming changed with the relocation.
meillo@19 1171 The directory where everything, except the profile, had been stored (\c
meillo@19 1172 .Fn $HOME/Mail ),
meillo@19 1173 used to be called \fIMH directory\fP. Now, this directory is called the
meillo@19 1174 user's \fImail storage\fP. The name \fImmh directory\fP is now given to
meillo@19 1175 the new directory
meillo@19 1176 (\c
meillo@19 1177 .Fn $HOME/.mmh ),
meillo@19 1178 containing all the personal configuration files.
meillo@19 1179 .P
meillo@19 1180 The separation of the files by type of content is logical and convenient.
meillo@19 1181 There are no functional differences as any possible setup known to me
meillo@19 1182 can be implemented with both approaches, although likely a bit easier
meillo@19 1183 with the new approach. The main goal of the change had been to provide
meillo@19 1184 sensible storage locations for any type of personal mmh file.
meillo@19 1185 .P
meillo@19 1186 In order for one user to have multiple MH setups, he can use the
meillo@19 1187 environment variable
meillo@19 1188 .Ev MH
meillo@19 1189 the point to a different profile file.
meillo@19 1190 The MH directory (mail storage plus personal configuration files) is
meillo@19 1191 defined by the
meillo@19 1192 .Pe Path
meillo@19 1193 profile entry.
meillo@19 1194 The context file could be defined by the
meillo@19 1195 .Pe context
meillo@19 1196 profile entry or by the
meillo@19 1197 .Ev MHCONTEXT
meillo@19 1198 environment variable.
meillo@19 1199 The latter is useful to have a distinct context (e.g. current folders)
meillo@19 1200 in each terminal window, for instance.
meillo@19 1201 In mmh, there are three environment variables now.
meillo@19 1202 .Ev MMH
meillo@19 1203 may be used to change the location of the mmh directory.
meillo@19 1204 .Ev MMHP
meillo@19 1205 and
meillo@19 1206 .Ev MMHC
meillo@19 1207 change the profile and context files, respectively.
meillo@19 1208 Besides providing a more consistent feel (which simply is the result
meillo@19 1209 of being designed anew), the set of personal configuration files can
meillo@19 1210 be chosen independently from the profile (including mail storage location)
meillo@19 1211 and context, now. Being it relevant for practical use or not, it
meillo@19 1212 de-facto is an improvement. However, the main achievement is the
meillo@19 1213 split between mail storage and personal configuration files.
meillo@17 1214
meillo@0 1215
meillo@58 1216 .H2 "Modularization
meillo@0 1217 .P
meillo@58 1218 whatnowproc
meillo@0 1219 .P
meillo@49 1220 The \fIMH library\fP
meillo@49 1221 .Fn libmh.a
meillo@49 1222 collects a bunch of standard functions that many of the MH tools need,
meillo@49 1223 like reading the profile or context files.
meillo@49 1224 This doesn't hurt the separation.
meillo@49 1225
meillo@58 1226
meillo@58 1227 .H2 "Style
meillo@58 1228 .P
meillo@58 1229 Code layout, goto, ...
meillo@58 1230
meillo@58 1231
meillo@58 1232
meillo@58 1233
meillo@58 1234 .H1 "Concept Exploitation/Homogeniety
meillo@58 1235
meillo@58 1236
meillo@58 1237 .H2 "Draft Folder
meillo@58 1238 .P
meillo@58 1239 Historically, MH provided exactly one draft message, named
meillo@58 1240 .Fn draft
meillo@58 1241 and
meillo@58 1242 being located in the MH directory. When starting to compose another message
meillo@58 1243 before the former one was sent, the user had been questioned whether to use,
meillo@58 1244 refile or replace the old draft. Working on multiple drafts at the same time
meillo@58 1245 was impossible. One could only work on them in alteration by refiling the
meillo@58 1246 previous one to some directory and fetching some other one for reediting.
meillo@58 1247 This manual draft management needed to be done each time the user wanted
meillo@58 1248 to switch between editing one draft to editing another.
meillo@58 1249 .P
meillo@58 1250 To allow true parallel editing of drafts, in a straight forward way, the
meillo@58 1251 draft folder facility exists. It had been introduced already in July 1984
meillo@58 1252 by Marshall T. Rose. The facility was deactivated by default.
meillo@58 1253 Even in nmh, the draft folder facility remained deactivated by default.
meillo@58 1254 At least, Richard Coleman added the man page
meillo@58 1255 .Mp mh-draft(5)
meillo@58 1256 to document
meillo@58 1257 the feature well.
meillo@58 1258 .P
meillo@58 1259 The only advantage of not using the draft folder facility is the static
meillo@58 1260 name of the draft file. This could be an issue for MH frontends like mh-e.
meillo@58 1261 But as they likely want to provide working on multiple drafts in parallel,
meillo@58 1262 the issue is only concerning compatibility. The aim of nmh to stay compatible
meillo@58 1263 prevented the default activation of the draft folder facility.
meillo@58 1264 .P
meillo@58 1265 On the other hand, a draft folder is the much more natural concept than
meillo@58 1266 a draft message. MH's mail storage consists of folders and messages,
meillo@58 1267 the messages named with ascending numbers. A draft message breaks with this
meillo@58 1268 concept by introducing a message in a file named
meillo@58 1269 .Fn draft .
meillo@58 1270 This draft
meillo@58 1271 message is special. It can not be simply listed with the available tools,
meillo@58 1272 but instead requires special switches. I.e. corner-cases were
meillo@58 1273 introduced. A draft folder, in contrast, does not introduce such
meillo@58 1274 corner-cases. The available tools can operate on the messages within that
meillo@58 1275 folder like on any messages within any mail folders. The only difference
meillo@58 1276 is the fact that the default folder for
meillo@58 1277 .Pn send
meillo@58 1278 is the draft folder,
meillo@58 1279 instead of the current folder, like for all other tools.
meillo@58 1280 .P
meillo@58 1281 The trivial part of the change was activating the draft folder facility
meillo@58 1282 by default and setting a default name for this folder. Obviously, I chose
meillo@58 1283 the name
meillo@58 1284 .Fn +drafts .
meillo@58 1285 This made the
meillo@82 1286 .Sw -draftfolder
meillo@58 1287 and
meillo@82 1288 .Sw -draftmessage
meillo@58 1289 switches useless, and I could remove them.
meillo@58 1290 The more difficult but also the part that showed the real improvement,
meillo@58 1291 was updating the tools to the new concept.
meillo@82 1292 .Sw -draft
meillo@58 1293 switches could
meillo@58 1294 be dropped, as operating on a draft message became indistinguishable to
meillo@58 1295 operating on any other message for the tools.
meillo@58 1296 .Pn comp
meillo@58 1297 still has its
meillo@82 1298 .Sw -use
meillo@58 1299 switch for switching between its two modes: (1) Compose a new
meillo@58 1300 draft, possibly by taking some existing message as a form. (2) Modify
meillo@58 1301 an existing draft. In either case, the behavior of
meillo@58 1302 .Pn comp is
meillo@58 1303 deterministic. There is no more need to query the user. I consider this
meillo@58 1304 a major improvement. By making
meillo@58 1305 .Pn send
meillo@58 1306 simply operate on the current
meillo@58 1307 message in the draft folder by default, with message and folder both
meillo@58 1308 overridable by specifying them on the command line, it is now possible
meillo@58 1309 to send a draft anywhere within the storage by simply specifying its folder
meillo@58 1310 and name.
meillo@58 1311 .P
meillo@58 1312 All theses changes converted special cases to regular cases, thus
meillo@58 1313 simplifying the tools and increasing the flexibility.
meillo@58 1314
meillo@58 1315
meillo@58 1316 .H2 "Trash Folder
meillo@58 1317 .P
meillo@58 1318 Similar to the situation for drafts is the situation for removed messages.
meillo@58 1319 Historically, a message was deleted by renaming. A specific
meillo@58 1320 \fIbackup prefix\fP, often comma (\c
meillo@58 1321 .Fn , )
meillo@58 1322 or hash (\c
meillo@58 1323 .Fn # ),
meillo@58 1324 being prepended to the file name. Thus, MH wouldn't recognize the file
meillo@58 1325 as a message anymore, as only files whose name consists of digits only
meillo@58 1326 are treated as messages. The removed messages remained as files in the
meillo@58 1327 same directory and needed some maintenance job to truly delete them after
meillo@58 1328 some grace time. Usually, by running a command similar to
meillo@82 1329 .VS
meillo@82 1330 find /home/user/Mail -ctime +7 -name ',*' | xargs rm
meillo@82 1331 VE
meillo@58 1332 in a cron job. Within the grace time interval
meillo@58 1333 the original message could be restored by stripping the
meillo@58 1334 the backup prefix from the file name. If however, the last message of
meillo@58 1335 a folder is been removed \(en say message
meillo@58 1336 .Fn 6
meillo@58 1337 becomes file
meillo@58 1338 .Fn ,6
meillo@58 1339 \(en and a new message enters the same folder, thus the same
meillo@58 1340 numbered being given again \(en in our case
meillo@58 1341 .Fn 6
meillo@58 1342 \(en, if that one
meillo@58 1343 is removed too, then the backup of the former message gets overwritten.
meillo@58 1344 Thus, the ability to restore removed messages does not only depend on
meillo@58 1345 the ``sweeping cron job'' but also on the removing of further messages.
meillo@58 1346 This is undesirable, because the real mechanism is hidden from the user
meillo@58 1347 and the consequences of further removals are not always obvious.
meillo@58 1348 Further more, the backup files are scattered within the whole mail
meillo@58 1349 storage, instead of being collected at one place.
meillo@58 1350 .P
meillo@58 1351 To improve the situation, the profile entry
meillo@58 1352 .Pe rmmproc
meillo@58 1353 (previously named
meillo@58 1354 .Pe Delete-Prog )
meillo@58 1355 was introduced, very early.
meillo@58 1356 It could be set to any command, which would care for the mail removal
meillo@58 1357 instead of taking the default action, described above.
meillo@58 1358 Refiling the to-be-removed files to some garbage folder was a common
meillo@58 1359 example. Nmh's man page
meillo@58 1360 .Mp rmm(1)
meillo@58 1361 proposes
meillo@58 1362 .Cl "refile +d
meillo@58 1363 to move messages to the garbage folder and
meillo@58 1364 .Cl "rm `mhpath +d all`
meillo@58 1365 the empty the garbage folder.
meillo@58 1366 Managing the message removal this way is a sane approach. It keeps
meillo@58 1367 the removed messages in one place, makes it easy to remove the backup
meillo@58 1368 files, and, most important, enables the user to use the tools of MH
meillo@58 1369 itself to operate on the removed messages. One can
meillo@58 1370 .Pn scan
meillo@58 1371 them,
meillo@58 1372 .Pn show
meillo@58 1373 them, and restore them with
meillo@58 1374 .Pn refile .
meillo@58 1375 There's no more
meillo@58 1376 need to use
meillo@58 1377 .Pn mhpath
meillo@58 1378 to switch over from MH tools to Unix tools \(en MH can do it all itself.
meillo@58 1379 .P
meillo@58 1380 This approach matches perfect with the concepts of MH, thus making
meillo@58 1381 it powerful. Hence, I made it the default. And even more, I also
meillo@58 1382 removed the old backup prefix approach, as it is clearly less powerful.
meillo@58 1383 Keeping unused alternative in the code is a bad choice as they likely
meillo@58 1384 gather bugs, by not being constantly tested. Also, the increased code
meillo@58 1385 size and more conditions crease the maintenance costs. By strictly
meillo@58 1386 converting to the trash folder approach, I simplified the code base.
meillo@58 1387 .Pn rmm
meillo@58 1388 calls
meillo@58 1389 .Pn refile
meillo@58 1390 internally to move the to-be-removed
meillo@58 1391 message to the trash folder (\c
meillo@58 1392 .Fn +trash
meillo@58 1393 by default). Messages
meillo@58 1394 there can be operated on like on any other message in the storage.
meillo@58 1395 The sweep clean, one can use
meillo@82 1396 .Cl "rmm -unlink +trash a" ,
meillo@58 1397 where the
meillo@82 1398 .Sw -unlink
meillo@58 1399 switch causes the files to be truly unliked instead
meillo@58 1400 of moved to the trash folder.
meillo@58 1401
meillo@58 1402
meillo@58 1403 .H2 "Path Notations
meillo@58 1404 .P
meillo@58 1405 foo
meillo@58 1406
meillo@58 1407
meillo@58 1408 .H2 "MIME Integration
meillo@58 1409 .P
meillo@58 1410 user-visible access to whole messages and MIME parts are inherently
meillo@58 1411 different
meillo@58 1412
meillo@58 1413
meillo@58 1414 .H2 "Of One Cast
meillo@58 1415 .P