]> diplodocus.org Git - nmh/blob - man/mh-mime.man
fgets() reserves space for the NUL itself.
[nmh] / man / mh-mime.man
1 .TH MH\-MIME %manext7% "September 25, 2016" "%nmhversion%"
2 .\"
3 .\" %nmhwarning%
4 .\"
5 .SH NAME
6 mh\-mime \- Overview of
7 .IR nmh (7)
8 MIME message composition and display
9 .\"
10 .SH DESCRIPTION
11 The acronym MIME stands for Multipurpose Internet Mail Extensions, the
12 format of Internet messages used to send multi\-media content.
13 The
14 .B nmh
15 command suite has support for the display and composition of MIME messages, but
16 currently MIME support is not completely integrated into all tools. This
17 document provides an overview as to which tools support MIME message display,
18 storage, and composition.
19 .SS
20 Local Character Set Conversion
21 All of the
22 .B nmh
23 commands convert non\-native character sets to the local character set,
24 as specified by the operating system locale settings. See
25 .IR locale (1)
26 for more details on the environment variables used to set the
27 local character set. Character set conversion will only take place if
28 .B nmh
29 was built with
30 .IR iconv (3)
31 support. See the
32 .IR mhparam (1)
33 man page for how determine whether your
34 .B nmh
35 installation includes
36 .IR iconv (3)
37 support.
38 .PP
39 Depending on the source and target character set, it may not be possible
40 to convert all characters to the local character set. In this case a
41 substitution character will be used for the characters that cannot be
42 converted.
43 .SS
44 Message Display
45 The default format used by
46 .IR scan (1)
47 will automatically decode MIME-encoded headers. If you have a custom
48 .B scan
49 format, see the examples provided with the
50 .B nmh
51 distribution (found in the
52 .RI \*(lq %nmhetcdir% \*(rq
53 directory) and
54 .IR mh\-format (5)
55 for details on how to make sure your MIME headers are properly
56 decoded.
57 .PP
58 By default, if
59 .B show
60 detects that it is reading a MIME message it will invoke
61 .IR mhshow (1).
62 The default behavior of
63 .B mhshow
64 is to only display text parts that are not marked as attachments. See
65 .IR mhshow (1)
66 for details on how to control what
67 .B mhshow
68 will display.
69 .SS
70 Message Interrogation and Storage
71 The
72 .IR mhlist (1)
73 command will display a listing of the MIME parts contained within a
74 message. That information can be used in conjunction with the
75 .B mhstore
76 command to save individual parts or content types of a message. See
77 .IR mhlist (1)
78 and
79 .IR mhstore (1)
80 for more details on how these commands work.
81 .SS
82 Message Composition and Reply
83 All messages sent by
84 .IR send (1)
85 will automatically be processed by
86 .IR mhbuild (1)
87 before being passed to
88 .IR post (1)
89 for message submission.
90 .B Mhbuild
91 will use the locale settings to mark text content with the appropriate
92 character set and apply any necessary encoding. If you wish to include
93 text in your message using a character set that does not match your
94 locale, you will need to specify the character set using a
95 .B mhbuild
96 directive; see
97 .IR mhbuild (1)
98 for more information.
99 .PP
100 For attaching files or composing other non-text content, there are two options: the attach system and
101 .B mhbuild
102 directives.
103 .PP
104 The attach system is best suited for content where one or more files are
105 being attached to a message. You can use the attach system by either
106 using the
107 .B attach
108 command at the \*(lqWhat now?\*(rq prompt, or by inserting an \*(lqAttach:\*(rq
109 header in the message draft containing the name of the file you wish to
110 attach to the message (it should be noted all that the
111 .B attach
112 command does is place an \*(lqAttach\*(rq header in the message draft).
113 .B Mhbuild
114 will then automatically include the specified file(s) in the outgoing
115 message. See
116 .IR send (1)
117 for details on how
118 .B mhbuild
119 determines the proper content type of attached files.
120 .PP
121 The other method of composing MIME messages is to use
122 .B mhbuild
123 directives. This allows exact control over the contents and format of
124 the MIME message, but has a more complicated syntax.
125 .IR mhbuild (1)
126 contains details on the directive syntax and examples of directives
127 for different media types. It is important to note that when using
128 .B mhbuild
129 directives the user must run
130 .B mhbuild
131 outside of
132 .B send
133 to have it process directives; when being run by
134 .BR send ,
135 .B mhbuild
136 is configured to not process directives so normal user text is not mistaken
137 for a directive. When using directives a user typically uses the
138 .B mime
139 command at the \*(lqWhat now?\*(rq prompt to process them.
140 .PP
141 When replying to messages using
142 .IR repl (1)
143 the traditional MH method of including the original text in the reply does
144 not interoperate with MIME messages. The
145 .B \-convertargs
146 switch to
147 .IR repl (1)
148 provides one solution. Another solution: the contrib directory
149 .RI ( %docdir%/contrib )
150 contains a Perl program called
151 .B replyfilter
152 which will decode text parts and present them in an appropriate manner
153 to be included in a message reply. See the comments at the top of
154 .B replyfilter
155 for instructions on how to configure
156 .B nmh
157 to work with it.
158 .SS
159 Message Rewrite
160 The
161 .IR mhfixmsg (1)
162 command can apply various transformations to MIME messages, including
163 decoding of text parts, converting the character set of text parts,
164 and insertion of text/plain parts to correspond to text parts of other
165 subtypes.
166 .B mhfixmsg
167 can also repair defects in MIME messages, such as mismatched top-level
168 boundary indicators and invalid Content-Transfer-Encoding values.
169 .SH "SEE ALSO"
170 .IR comp (1),
171 .IR iconv (3),
172 .IR mh\-format (5)
173 .IR mhbuild (1),
174 .IR mhfixmsg (1),
175 .IR mhparam (1),
176 .IR nmh (7),
177 .IR repl (1),
178 .IR whatnow (1),
179 .br
180 .IR %docdir%/contrib/replyfilter ,
181 .br
182 .I %docdir%/contrib/replaliases
183 .SH BUGS
184 MIME support should be more integrated into all of the
185 .B nmh
186 tools than it currently is.