Mercurial > docs > master
comparison ch03.roff @ 102:a782488c85f5
More text about attachments mainly, plus some rearrangements.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Wed, 20 Jun 2012 17:57:37 +0200 |
parents | e8e6adb14beb |
children | 2818ca27d24c |
comparison
equal
deleted
inserted
replaced
101:e8e6adb14beb | 102:a782488c85f5 |
---|---|
1094 The draft folder facility, together with the | 1094 The draft folder facility, together with the |
1095 .Sw -form | 1095 .Sw -form |
1096 switch, are sufficient. | 1096 switch, are sufficient. |
1097 | 1097 |
1098 | 1098 |
1099 .U3 "Inplace Editing | 1099 .U3 "In Place Editing |
1100 .P | 1100 .P |
1101 .Pn anno | 1101 .Pn anno |
1102 had the switches | 1102 had the switches |
1103 .Sw -[no]inplace | 1103 .Sw -[no]inplace |
1104 to either annotate the message in place and thus preserve hard links, | 1104 to either annotate the message in place and thus preserve hard links, |
1606 | 1606 |
1607 | 1607 |
1608 .ig | 1608 .ig |
1609 | 1609 |
1610 .P | 1610 .P |
1611 To ease typing, the switches can be abbreviated as much as the remaining | |
1612 prefix remains unambiguous. | |
1613 If in our example no other switch would start with the letter `t', then | |
1614 .Cl "-truncate" , | |
1615 .Cl "-trunc" , | |
1616 .Cl "-tr" , | |
1617 and | |
1618 .Cl "-t | |
1619 would all be the same. | |
1620 As a result, switches can neither be grouped (as in | |
1621 .Cl "ls -ltr" ) | |
1622 nor can switch arguments be appended directly to the switch (as in | |
1623 .Cl "sendmail -q30m" ). | |
1624 .P | |
1625 Many switches have negating counter-parts, which start with `no'. | |
1626 For example | |
1627 .Cl "-notruncate | |
1628 inverts the | |
1629 .Cl "-truncate | |
1630 switch. | |
1631 They exist to undo the effect of default switches in the profile. | |
1632 If the user has chosen to change the default behavior of some tool | |
1633 by adding a default switch to the profile, | |
1634 he can still undo this change in behavior by specifying the inverse | |
1635 switch on the command line. | |
1636 .P | |
1637 In the best case, all switches are unambiguous on the first character, | 1611 In the best case, all switches are unambiguous on the first character, |
1638 or on the three-letter prefix for the `no' variants. | 1612 or on the three-letter prefix for the `no' variants. |
1639 Reducing switch prefix collisions, shortens the necessary prefix length | 1613 Reducing switch prefix collisions, shortens the necessary prefix length |
1640 the user must type. | 1614 the user must type. |
1641 Having less switches helps best. | 1615 Having less switches helps best. |
1642 | 1616 |
1643 .. | 1617 .. |
1644 | 1618 |
1645 | 1619 |
1620 .\" XXX: whatnow prompt commands | |
1621 | |
1622 | |
1646 | 1623 |
1647 | 1624 |
1648 .H1 "Modernizing | 1625 .H1 "Modernizing |
1626 .P | |
1627 The code base of mmh originates from the late Seventies. | |
1628 Through the Eighties, extensive work had been done on it. | |
1629 In the Nineties, it had been partly reorganized and extended. | |
1630 Relicts from each decade have gathered in the code base. | |
1631 My goal was to modernize the code base. | |
1632 | |
1633 .P | |
1634 FIXME functional aspect only here | |
1635 .P | |
1636 FIXME ref to `code style' for non-functional aspects. | |
1649 | 1637 |
1650 | 1638 |
1651 .H2 "Code Relicts | 1639 .H2 "Code Relicts |
1652 .P | 1640 .P |
1653 The code base of mmh originates from the late Seventies, | 1641 My position to drop obsolete functionality of mmh to remove old code |
1654 had been extensively | 1642 is much more revolutional than the nmh community likes it. |
1655 worked on in the mid Eighties, and had been partly reorganized and extended | 1643 Without the need to justify my decisions, I was able to quickly |
1656 in the Nineties. Relicts of all those times had gathered in the code base. | |
1657 My goal was to remove any ancient code parts. One part of the task was | |
1658 converting obsolete code constructs to standard constructs, the other part | |
1659 was dropping obsolete functions. | |
1660 .P | |
1661 As I'm not even thirty years old and have no more than seven years of | |
1662 Unix experience, I needed to learn about the history in retrospective. | |
1663 Older people likely have used those ancient constructs themselves | |
1664 and have suffered from their incompatibilities and have longed for | |
1665 standardization. Unfortunately, I have only read that others had done so. | |
1666 This put me in a much more difficult positions when working on the old | |
1667 code. I needed to recherche what other would have known by heart from | |
1668 experience. All my programming experience comes from a time past ANSI C | |
1669 and past POSIX. Although I knew about the times before, I took the | |
1670 current state implicitly for granted most of the time. | |
1671 .P | |
1672 Being aware of | |
1673 these facts, I rather let people with more historic experience solve the | |
1674 task of converting the ancient code constructs to standardized ones. | |
1675 Luckily, Lyndon Nerenberg focused on this task at the nmh project. | |
1676 He converted large parts of the code to POSIX constructs, removing | |
1677 the conditionals compilation for now standardized features. | |
1678 I'm thankful for this task being solved. I only pulled the changes into | |
1679 mmh. | |
1680 .P | |
1681 The other task \(en dropping ancient functionality to remove old code \(en | |
1682 I did myself, though. My position to strip mmh to the bare minimum of | |
1683 frequently used features is much more revolutional than the nmh community | |
1684 likes it. Without the need to justify my decisions, I was able to quickly | |
1685 remove functionality I considered ancient. | 1644 remove functionality I considered ancient. |
1686 The need to discuss my decisions with | 1645 The need to discuss my decisions with |
1687 peers likely would have slowed this process down. Of course, I researched | 1646 peers likely would have slowed this process down. |
1688 if a particular feature really should be dropped. Having not had any | 1647 Of course, I researched if a particular feature really should be dropped. |
1648 Having not had any | |
1689 contact to this feature within my computer life was a first indicator to | 1649 contact to this feature within my computer life was a first indicator to |
1690 drop it, but I also asked others and searched the literature for modern | 1650 drop it, but I also asked others and searched the literature for modern |
1691 usage of the feature. If it appeared to be truly ancient, I dropped it. | 1651 usage of the feature. |
1652 If it appeared to be truly ancient, I dropped it. | |
1692 The reason for dropping is always part of the commit message in the | 1653 The reason for dropping is always part of the commit message in the |
1693 version control system. Thus, it is easy for others to check their | 1654 version control system. |
1655 Thus, it is easy for others to check their | |
1694 view on the topic with mine and possibly to argue for reinclusion. | 1656 view on the topic with mine and possibly to argue for reinclusion. |
1695 | 1657 |
1658 | |
1696 .U3 "MMDF maildrop support | 1659 .U3 "MMDF maildrop support |
1697 .P | 1660 .P |
1698 I did drop any support for the MMDF maildrop format. This type of format | 1661 I did drop any support for the MMDF maildrop format. |
1662 This type of format | |
1699 is conceptionally similar to the mbox format, but uses four bytes with | 1663 is conceptionally similar to the mbox format, but uses four bytes with |
1700 value 1 (\fL^A^A^A^A\fP) as message delimiter, | 1664 value 1 (\fL^A^A^A^A\fP) as message delimiter, |
1701 instead of the string ``\fLFrom\ \fP''. | 1665 instead of the string ``\fLFrom\ \fP''. |
1702 Due to the similarity and mbox being the de-facto standard maildrop | 1666 Due to the similarity and mbox being the de-facto standard maildrop |
1703 format on Unix, but also due to the larger influence of Sendmail than MMDF, | 1667 format on Unix, but also due to the larger influence of Sendmail than MMDF, |
1704 the MMDF maildrop format had vanished. | 1668 the MMDF maildrop format had vanished. |
1705 .P | 1669 .P |
1706 The simplifications within the code were only moderate. Switches could | 1670 The simplifications within the code were only moderate. |
1707 be removed from tools like | 1671 Switches could be removed from tools like |
1708 .L packf , | 1672 .L packf , |
1709 which generate packed mailboxes. Only one packed mailbox format remained: | 1673 which generate packed mailboxes. |
1710 mbox. | 1674 Only one packed mailbox format remained: mbox. |
1711 The most important changes affect the equally named mail parsing routine in | 1675 The most important changes affect the equally named mail parsing routine in |
1712 .L sbr/m_getfld.c . | 1676 .L sbr/m_getfld.c . |
1713 The direct MMDF code had been removed, but as now only one packed mailbox | 1677 The direct MMDF code had been removed, but as now only one packed mailbox |
1714 format is left, code structure simplifications are likely possible. | 1678 format is left, code structure simplifications are likely possible. |
1715 The reason why they are still outstanding is the heavily optimized code | 1679 The reason why they are still outstanding is the heavily optimized code |
1716 of | 1680 of |
1717 .Fu m_getfld() . | 1681 .Fu m_getfld() . |
1718 Changes beyond a small local scope \(en | 1682 Changes beyond a small local scope \(en |
1719 which restructuring in its core is \(en cause a high risk of damaging | 1683 which restructuring in its core is \(en cause a high risk of damaging |
1720 the intricate workings of the optimized code. This problem is know | 1684 the intricate workings of the optimized code. |
1721 to the developers of nmh, too. They also avoid touching this minefield | 1685 This problem is know to the developers of nmh, too. |
1722 if possible. | 1686 They also avoid touching this minefield if possible. |
1723 | 1687 |
1724 .U3 "UUCP Bang Paths | 1688 .U3 "UUCP Bang Paths |
1725 .P | 1689 .P |
1726 More questionably than the former topic is the removal of support for the | 1690 More questionably than the former topic is the removal of support for the |
1727 UUCP bang path address style. However, the user may translate the bang | 1691 UUCP bang path address style. |
1692 However, the user may translate the bang | |
1728 paths on retrieval to Internet addresses and the other way on posting | 1693 paths on retrieval to Internet addresses and the other way on posting |
1729 messages. The former can be done my an MDA like procmail; the latter | 1694 messages. |
1730 by a sendmail wrapper. This would ensure that any address handling would | 1695 The former can be done my an MDA like procmail; the latter |
1731 work as expected. However, it might just work well without any | 1696 by a sendmail wrapper. |
1697 This would ensure that any address handling would work as expected. | |
1698 However, it might just work well without any | |
1732 such modifications, as mmh does not touch addresses much, in general. | 1699 such modifications, as mmh does not touch addresses much, in general. |
1733 But I can't ensure as I have never used an environment with bang paths. | 1700 But I can't ensure as I have never used an environment with bang paths. |
1734 Also, the behavior might break at any point in further development. | 1701 Also, the behavior might break at any point in further development. |
1735 | 1702 |
1736 .U3 "Hardcopy terminal support | 1703 .U3 "Hardcopy terminal support |
1741 actually being able to work on it, but I fear my chances are null. | 1708 actually being able to work on it, but I fear my chances are null. |
1742 .P | 1709 .P |
1743 The check only prevented a pager to be placed between the outputting | 1710 The check only prevented a pager to be placed between the outputting |
1744 program (\c | 1711 program (\c |
1745 .Pn mhl ) | 1712 .Pn mhl ) |
1746 and the terminal. This could have been ensured with | 1713 and the terminal. |
1747 the | 1714 This could have been ensured with the |
1748 .Sw -nomoreproc | 1715 .Sw -nomoreproc |
1749 at the command line statically, too. | 1716 at the command line statically, too. |
1750 | 1717 |
1751 .U3 "Removed support for header fields | 1718 .U3 "Removed support for header fields |
1752 .P | 1719 .P |
1753 The | 1720 The |
1754 .Hd Encrypted | 1721 .Hd Encrypted |
1755 header field had been introduced by RFC\^822, but already | 1722 header field had been introduced by RFC\^822, but already |
1756 marked legacy in RFC 2822. It was superseded by FIXME. | 1723 marked legacy in RFC 2822. |
1724 It was superseded by FIXME. | |
1757 Mmh does no more support this header field. | 1725 Mmh does no more support this header field. |
1758 .P | 1726 .P |
1759 Native support for | 1727 Native support for |
1760 .Hd Face | 1728 .Hd Face |
1761 header fields had been removed, as well. | 1729 header fields had been removed, as well. |
1905 The perception of the topic described in the RFCs is clearly visible | 1873 The perception of the topic described in the RFCs is clearly visible |
1906 in MH's implementation. | 1874 in MH's implementation. |
1907 Thus, MH had all the MIME features but no idea of attachments. | 1875 Thus, MH had all the MIME features but no idea of attachments. |
1908 Today, however, users don't need all the MIME features but they want | 1876 Today, however, users don't need all the MIME features but they want |
1909 convenient attachment handling. | 1877 convenient attachment handling. |
1910 In order to solve this problem, in 2002, Jon Steinhart had added an | 1878 |
1911 attachment system to nmh. | 1879 .U3 "Composing MIME Messages |
1880 .P | |
1881 In order to improve the situation on the message composing side, | |
1882 Jon Steinhart had added an attachment system to nmh in 2002. | |
1912 .Ci 7480dbc14bc90f2d872d434205c0784704213252 | 1883 .Ci 7480dbc14bc90f2d872d434205c0784704213252 |
1913 He described his motivation to do so as such: | 1884 In the file |
1885 .Fn docs/README-ATTACHMENTS , | |
1886 he described his motivation to do so as such: | |
1914 .QS | 1887 .QS |
1915 Although nmh contains the necessary functionality for MIME message handing, | 1888 Although nmh contains the necessary functionality for MIME message handing, |
1916 the interface to this functionality is pretty obtuse. | 1889 the interface to this functionality is pretty obtuse. |
1917 There's no way that I'm ever going to convince my partner to write | 1890 There's no way that I'm ever going to convince my partner to write |
1918 .Pn mhbuild | 1891 .Pn mhbuild |
1919 composition files! | 1892 composition files! |
1920 .QE | 1893 .QE |
1921 With this change, the mind model of attachments entered nmh: | 1894 .LP |
1895 With this change, the mind model of attachments entered nmh. | |
1896 In the same document: | |
1922 .QS | 1897 .QS |
1923 These changes simplify the task of managing attachments on draft files. | 1898 These changes simplify the task of managing attachments on draft files. |
1924 They allow attachments to be added, listed, and deleted. | 1899 They allow attachments to be added, listed, and deleted. |
1925 MIME messages are automatically created when drafts with attachments | 1900 MIME messages are automatically created when drafts with attachments |
1926 are sent. | 1901 are sent. |
1927 .QE | 1902 .QE |
1928 Unfortunately, the system had been deactivated by default, | 1903 .LP |
1929 like any new facilities in nmh. | 1904 Unfortunately, the attachment system, |
1930 .\" XXX move this paragraph somewhere else | 1905 like any new facilities in nmh, |
1931 Just to give one example, for me it took one year of using nmh | 1906 was deactive by default. |
1932 before I became aware of the existence of the attachment system. | |
1933 One could argue that this fact disqualifies my reading of the | |
1934 documentation. | |
1935 If I would have installed nmh from source back then, I could agree. | |
1936 Yet I had used a prepackaged version and had expected that it would | |
1937 just work. | |
1938 .P | 1907 .P |
1939 During my work in Argentina, I tried to improve the attachment system. | 1908 During my work in Argentina, I tried to improve the attachment system. |
1940 Because of great opposition in the nmh community, after long discussions, | 1909 But, because of great opposition in the nmh community, |
1941 my patch died as a proposal on the mailing list. | 1910 my patch died as a proposal on the mailing list, after long discussions. |
1942 .[ | 1911 .[ |
1943 nmh-workers attachment proposal | 1912 nmh-workers attachment proposal |
1944 .] | 1913 .] |
1945 In Januar 2012, I applied the patch in an extended form to mmh. | 1914 In Januar 2012, I extended the patch and applied it to mmh. |
1946 .Ci 8ff284ff9167eff8f5349481529332d59ed913b1 | 1915 .Ci 8ff284ff9167eff8f5349481529332d59ed913b1 |
1947 .P | |
1948 In mmh, the attachment system is active by default. | 1916 In mmh, the attachment system is active by default. |
1949 There are no command line switches anymore, but a pre-defined attachment | 1917 Instead of command line switches, the |
1950 header field. | |
1951 It is named | |
1952 .Hd Attach | |
1953 by default, but can be renamed with the | |
1954 .Pe Attachment-Header | 1918 .Pe Attachment-Header |
1955 profile entry. | 1919 profile entry is used to specify |
1920 the name of the attachment header field. | |
1921 It is pre-defined to | |
1922 .Hd Attach . | |
1923 .P | |
1956 To add an attachment to a draft, simply add an attachment header: | 1924 To add an attachment to a draft, simply add an attachment header: |
1957 .VS | 1925 .VS |
1958 To: bob | 1926 To: bob |
1959 Subject: The file you wanted | 1927 Subject: The file you wanted |
1960 Attach: /path/to/the/file-bob-wanted | 1928 Attach: /path/to/the/file-bob-wanted |
1961 -------- | 1929 -------- |
1962 Here it is. | 1930 Here it is. |
1963 VE | 1931 VE |
1964 The header field can be added to the draft manually in the editor, | 1932 The header field can be added to the draft manually in the editor, |
1965 by using the `attach' command at the WhatNow prompt, or with | 1933 or by using the `attach' command at the WhatNow prompt, or |
1934 non-interactively with | |
1966 .Pn anno : | 1935 .Pn anno : |
1967 .VS | 1936 .VS |
1968 anno -append -nodate -component Attach -text /path/to/file | 1937 anno -append -nodate -component Attach -text /path/to/attachment |
1969 VE | 1938 VE |
1970 Drafts with attachment headers are converted to MIME automatically | 1939 Drafts with attachment headers are converted to MIME automatically by |
1971 on sending. | 1940 .Pn send . |
1972 The draft stored in the draft folder is always in source form with | 1941 The conversion to MIME is invisible to the user. |
1942 The draft stored in the draft folder is always in source form, with | |
1973 attachment headers. | 1943 attachment headers. |
1974 The convertion to MIME is done invisible to the user. | |
1975 If the MIMEification fails, for instance because the file to attach | 1944 If the MIMEification fails, for instance because the file to attach |
1976 is not accessible, the original draft is not changed. | 1945 is not accessible, the original draft is not changed. |
1977 .P | 1946 .P |
1978 Forwarding message is handled by the same attachment system. | 1947 The attachment system handles the forwarding of messages, too. |
1979 If the attachment header value starts with a plus character (`+'), | 1948 If the attachment header value starts with a plus character (`+'), |
1980 like in | 1949 like in |
1981 .Cl "Attach: +bob 30 42" , | 1950 .Cl "Attach: +bob 30 42" , |
1982 The given messages in the specified folder will be attached. | 1951 The given messages in the specified folder will be attached. |
1983 This allowed to simplify | 1952 This allowed to simplify |
1984 .Pn forw . | 1953 .Pn forw . |
1985 .Ci f41f04cf4ceca7355232cf7413e59afafccc9550 | 1954 .Ci f41f04cf4ceca7355232cf7413e59afafccc9550 |
1986 .P | 1955 .P |
1987 Closely related to attachments is non-ASCII text content, | 1956 Closely related to attachments is non-ASCII text content, |
1988 because it requires MIME too. | 1957 because it requires MIME too. |
1989 In nmh it the user needed to invoke `mime' at the WhatNow prompt | 1958 In nmh, the user needed to call `mime' at the WhatNow prompt |
1990 to have the draft converted to MIME. | 1959 to have the draft converted to MIME. |
1991 This was necessary if the draft contained non-ASCII characters. | 1960 This was necessary whenever the draft contained non-ASCII characters. |
1992 If the user did not call `mime', a broken message would be sent. | 1961 If the user did not call `mime', a broken message would be sent. |
1993 Therefore, the | 1962 Therefore, the |
1994 .Pe automimeproc | 1963 .Pe automimeproc |
1995 profile entry could be specified to have the `mime' command invoked | 1964 profile entry could be specified to have the `mime' command invoked |
1996 automatically for each message. | 1965 automatically each time. |
1997 Unfortunately, this approach conflicted with with attachment system | 1966 Unfortunately, this approach conflicted with with attachment system |
1998 because the draft would already be in MIME format at the time | 1967 because the draft would already be in MIME format at the time |
1999 when the attachment system wanted to MIMEify it. | 1968 when the attachment system wanted to MIMEify it. |
2000 To use the attachment system, the user must not run `mime' at the | 1969 To use nmh's attachment system, `mime' must not be called at the |
2001 WhatNow prompt nor have | 1970 WhatNow prompt and |
2002 .Pe automimeproc | 1971 .Pe automimeproc |
2003 set in the profile. | 1972 must not be set in the profile. |
2004 But then the case of non-ASCII text without attachment headers was | 1973 But then the case of non-ASCII text without attachment headers was |
2005 not caught. | 1974 not caught. |
2006 All in all a bad solution. | 1975 All in all, the solution was complex and irritating. |
2007 My patch from December 2010 already solved this situation. | 1976 My patch from December 2010 would have simplified the situation. |
1977 .P | |
2008 Mmh's current solution is even more elaborate. | 1978 Mmh's current solution is even more elaborate. |
2009 Any necessary MIMEification is done automatically. | 1979 Any necessary MIMEification is done automatically. |
2010 There is no `mime' command at the WhatNow prompt anymore. | 1980 There is no `mime' command at the WhatNow prompt anymore. |
2011 The draft will be converted to MIME when either an attachment header | 1981 The draft will be converted automatically to MIME when either an |
2012 or non-ASCII text is present. | 1982 attachment header or non-ASCII text is present. |
2013 Further more, the special meaning of the hash character (`#') | 1983 Further more, the special meaning of the hash character (`#') |
2014 at the beginning of the line in the draft message is removed. | 1984 at line beginnings in the draft message is removed. |
2015 The user needs not at all deal about the topic. | 1985 Users need not at all deal with the whole topic. |
2016 .P | 1986 .P |
2017 This improvement has a price: The new approach does not directly | 1987 Although the new approach does not anymore support arbitrary MIME |
2018 support arbitrary MIME compositions. | 1988 compositions directly, the full power of |
2019 Nonetheless, the full power of | |
2020 .Pn mhbuild | 1989 .Pn mhbuild |
2021 can still be accessed. | 1990 can still be accessed. |
2022 As long as no attachment headers are included, the user can create a | 1991 Given no attachment headers are included, the user can create |
2023 nonlimited | |
2024 .Pn mhbuild | 1992 .Pn mhbuild |
2025 composition draft like in nmh. | 1993 composition drafts like in nmh. |
2026 Then, at the WhatNow prompt, he needs to invoke | 1994 Then, at the WhatNow prompt, he needs to invoke |
2027 .Cl "edit mhbuild | 1995 .Cl "edit mhbuild |
2028 to convert it to MIME. | 1996 to convert it to MIME. |
2029 Because the resulting draft does only contain ASCII characters | 1997 Because the resulting draft does neither contain non-aASCII characters |
2030 and has no attachment headers, the attachment system will not touch it. | 1998 nor has it attachment headers, the attachment system will not touch it. |
2031 .P | 1999 .P |
2032 The approach taken in mmh is taylored towards todays most common case: | 2000 The approach taken in mmh is taylored towards todays most common case: |
2033 a text part with possibly attachments. | 2001 a text part with possibly attachments. |
2034 Still, the full power of | 2002 This case is simplified a lot for users. |
2003 | |
2004 .U3 "MIME Type Guessing | |
2005 .P | |
2006 The use of | |
2035 .Pn mhbuild | 2007 .Pn mhbuild |
2036 can be accessed with a bit of overhead. | 2008 composition drafts had one notable advantage over attachment headers |
2037 | 2009 from the programmer's point of view: The user provides the appropriate |
2038 .\" XXX: MIME types | 2010 MIME types for files to include. |
2039 .\" XXX: whatnow prompt commands | 2011 The attachment system needs to find out the correct MIME type itself. |
2040 .\" XXX: anno rework | 2012 This is a difficult task, yet it spares the user irritating work. |
2013 Determining the correct MIME type of content is partly mechanical, | |
2014 partly intelligent work. | |
2015 Forcing the user to find out the correct MIME type, | |
2016 forces him to do partly mechanical work. | |
2017 Letting the computer do the work, can lead to bad choices for difficult | |
2018 content. | |
2019 For mmh, the latter option was chosen. | |
2020 .P | |
2021 Determining the MIME type by the suffix of the file name is a dumb | |
2022 approach, yet it is simple to implement and provides good results | |
2023 for the common cases. | |
2024 Mmh implements this approach in the | |
2025 .Pn print-mimetype | |
2026 script. | |
2027 Using it is the default choice. | |
2028 .P | |
2029 A far better but less portable approach is the use of | |
2030 .Pn file . | |
2031 This standard tool tries to determine the type of files. | |
2032 Unfortunately, its capabilities and accuracy varies from system to system. | |
2033 Additionally, its output was only intended for human beings, | |
2034 but not to be used by programs. | |
2035 It varies much. | |
2036 Nevertheless, modern versions of GNU | |
2037 .Pn file , | |
2038 which is prevalent on the popular GNU/Linux systems, | |
2039 provides MIME type output in machine-readable form. | |
2040 Although this solution is highly system-dependent, | |
2041 it solves the difficult problem well. | |
2042 On systems where GNU | |
2043 .Pn file , | |
2044 version 5.04 or higher, is available it should be used. | |
2045 One needs to specify the following profile entry to do so: | |
2046 .VS | |
2047 Mime-Type-Query: file -b --mime | |
2048 VE | |
2049 .LP | |
2050 Other versions of | |
2051 .Pn file | |
2052 might possibly be usable with wrapper scripts to reformat the output. | |
2053 The diversity among | |
2054 .Pn file | |
2055 implementations is great; one needs to check the local variant. | |
2056 .P | |
2057 If no MIME type can be determined, text content gets sent as | |
2058 `text/plain' and anything else under the generic fall-back type | |
2059 `application/octet-stream'. | |
2060 It is not possible in mmh to override the automatic MIME type guessing | |
2061 for a specific file. | |
2062 To do so, the user would need to know in advance for which file | |
2063 the automatic guessing does fail, or the system would require interaction. | |
2064 I consider both cases impractical. | |
2065 The existing solution should be sufficient. | |
2066 If not, the user may always fall back to | |
2067 .Pn mhbuild | |
2068 composition drafts and ignore the attachment system. | |
2069 | |
2070 | |
2071 .U3 "Storing Attachments | |
2072 .P | |
2073 FIXME | |
2074 | |
2075 | |
2076 .U3 "Showing MIME Messages | |
2077 .P | |
2078 FIXME | |
2079 | |
2041 | 2080 |
2042 | 2081 |
2043 .H2 "Digital Cryptography | 2082 .H2 "Digital Cryptography |
2044 .P | 2083 .P |
2045 Signing and encryption. | 2084 Signing and encryption. |
2046 | 2085 |
2047 | 2086 |
2048 .H2 "Good Defaults | 2087 |
2088 .H2 "Modern Defaults | |
2089 .P | |
2090 Just to give one example, for me it took one year of using nmh | |
2091 before I became aware of the existence of the attachment system. | |
2092 One could argue that this fact disqualifies my reading of the | |
2093 documentation. | |
2094 If I would have installed nmh from source back then, I could agree. | |
2095 Yet I had used a prepackaged version and had expected that it would | |
2096 just work. | |
2097 | |
2098 | |
2099 | |
2100 .H1 "Code Style | |
2049 .P | 2101 .P |
2050 foo | 2102 foo |
2051 | 2103 |
2052 | 2104 |
2053 | |
2054 | |
2055 .H1 "Code Style | |
2056 .P | |
2057 foo | |
2058 | |
2059 | |
2060 .H2 "Standard Code | 2105 .H2 "Standard Code |
2061 .P | 2106 .P |
2062 POSIX | 2107 POSIX |
2108 | |
2109 .U3 "Converting to Standard Code | |
2110 .P | |
2111 One part of this task was converting obsolete code constructs | |
2112 to standard constructs. | |
2113 As I'm not even thirty years old and have no more than seven years of | |
2114 Unix experience, I needed to learn about the history in retrospective. | |
2115 Older people likely have used those ancient constructs themselves | |
2116 and have suffered from their incompatibilities and have longed for | |
2117 standardization. | |
2118 Unfortunately, I have only read that others had done so. | |
2119 This put me in a much more difficult positions when working on the old | |
2120 code. | |
2121 I needed to recherche what other would have known by heart from | |
2122 experience. | |
2123 All my programming experience comes from a time past ANSI C | |
2124 and past POSIX. | |
2125 Although I knew about the times before, I took the | |
2126 current state implicitly for granted most of the time. | |
2127 .P | |
2128 Being aware of | |
2129 these facts, I rather let people with more historic experience solve the | |
2130 task of converting the ancient code constructs to standardized ones. | |
2131 Luckily, Lyndon Nerenberg focused on this task at the nmh project. | |
2132 He converted large parts of the code to POSIX constructs, removing | |
2133 the conditionals compilation for now standardized features. | |
2134 I'm thankful for this task being solved. I only pulled the changes into | |
2135 mmh. | |
2136 | |
2137 | |
2063 | 2138 |
2064 | 2139 |
2065 .H2 "Separation | 2140 .H2 "Separation |
2066 | 2141 |
2067 .U2 "MH Directory Split | 2142 .U2 "MH Directory Split |
2168 | 2243 |
2169 | 2244 |
2170 .H2 "Style | 2245 .H2 "Style |
2171 .P | 2246 .P |
2172 Code layout, goto, ... | 2247 Code layout, goto, ... |
2248 | |
2249 .P | |
2250 anno rework | |
2173 | 2251 |
2174 | 2252 |
2175 | 2253 |
2176 | 2254 |
2177 .H1 "Concept Exploitation/Homogeneity | 2255 .H1 "Concept Exploitation/Homogeneity |