4 .TH MHSTORE %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
6 mhstore \- store contents of MIME messages into files
21 .RB [ \-auto " | " \-noauto ]
22 .RB [ \-verbose " | " \-noverbose ]
27 .RB [ \-check " | " \-nocheck ]
34 command allows you to store the contents of a
35 collection of MIME (multi-media) messages into files or other
39 manipulates multi-media messages as specified in
40 RFC\-2045 thru RFC\-2049.
44 will store all the parts of each message.
45 Each part will be store in a separate file. The header fields of
46 the message are not stored. By using the
50 switches, you may limit the scope of
53 subparts (of a multipart content) and/or particular content types.
61 file as the source message, rather than a message from a folder.
62 If you specify this file as \*(lq-\*(rq, then
65 accept the source message on the standard input. Note that the
66 file, or input from standard input should be a validly formatted
67 message, just like any other
71 be in mail drop format (to convert a file in mail drop format to
77 A part specification consists of a series of numbers separated by
78 dots. For example, in a multipart content containing three parts,
79 these would be named as 1, 2, and 3, respectively. If part 2 was
80 also a multipart content containing two parts, these would be named
81 as 2.1 and 2.2, respectively. Note that the
84 effective for only messages containing a multipart content. If a
85 message has some other kind of content, or if the part is itself
86 another multipart content, the
88 switch will not prevent
89 the content from being acted upon.
91 A content specification consists of a content type and a subtype.
92 The initial list of \*(lqstandard\*(rq content types and subtypes
93 can be found in RFC\-2046.
95 A list of commonly used contents is briefly reproduced here:
103 multipart mixed, alternative, digest, parallel
104 message rfc822, partial, external-body
105 application octet-stream, postscript
112 A legal MIME message must contain a subtype specification.
114 To specify a content, regardless of its subtype, just use the name
115 of the content, e.g., \*(lqaudio\*(rq. To specify a specific
116 subtype, separate the two with a slash, e.g., \*(lqaudio/basic\*(rq.
117 Note that regardless of the values given to the
120 a multipart content (of any subtype listed above) is always acted
121 upon. Further note that if the
123 switch is used, and it is
124 desirable to act on a message/external-body content, then the
126 switch must be used twice: once for message/external-body
127 and once for the content externally referenced.
128 .SS "Checking the Contents"
133 to check each content for
134 an integrity checksum. If a content has such a checksum (specified
135 as a Content-MD5 header field), then
138 verify the integrity of the content.
139 .SS "Storing the Contents"
142 will store the contents of the named messages in
143 \*(lqnative\*(rq (decoded) format. Two things must be determined:
144 the directory to store the content, and the filenames. Files are
145 written in the directory given by the \*(lqnmh-storage\*(rq profile
152 If this entry isn't present,
153 the current working directory is used.
157 switch is given, then
160 the message contains information indicating the filename that should
161 be used to store the content. This information should be specified
162 as the attribute \*(lqname=filename\*(rq in the \*(lqContent-Type\*(rq header
163 for the content you are storing. For security reasons, this filename
164 will be ignored if it begins with the character '/', '.', '|', or '!',
165 or if it contains the character '%'. For the sake of security,
166 this switch is not the default, and it is recommended that you do
175 switch is not given (or is being ignored for security
178 will look in the user's profile for a
179 \*(lqformatting string\*(rq to determine how the different contents
180 should be stored. First,
182 will look for an entry of
186 mhstore-store-<type>/<subtype>
189 to determine the formatting string. If this isn't found,
191 will look for an entry of the form:
197 to determine the formatting string.
199 If the formatting string starts with a \*(lq+\*(rq character, then
200 content is stored in the named folder. A formatting string consisting
201 solely of a \*(lq+\*(rq character is interpreted to be the current
204 If the formatting string consists solely of a \*(lq-\*(rq character,
205 then the content is sent to the standard output.
207 If the formatting string starts with a '|', then the display string
208 will represent a command for
210 to execute which should
211 ultimately store the content. The content will be passed to the
212 standard input of the command. Before the command is executed,
214 will change to the appropriate directory, and any
215 escapes (given below) in the display string will be expanded.
217 Otherwise the formatting string will represent a pathname in which
218 to store the content. If the formatting string starts with a '/',
219 then the content will be stored in the full path given, else the
220 file name will be relative to the value of \*(lqnmh-storage\*(rq or
221 the current working directory. Any escapes (given below) will be
222 expanded, except for the a-escape.
224 A command or pathname formatting string may contain the following
225 escapes. If the content isn't part of a multipart (of any subtype
226 listed above) content, the p-escapes are ignored.
231 %a Parameters from Content-type (only valid with command)
232 %m Insert message number
233 %P Insert part number with leading dot
234 %p Insert part number without leading dot
235 %t Insert content type
236 %s Insert content subtype
237 %% Insert character %
241 If no formatting string is found,
244 if the content is application/octet-stream with parameter
245 \*(lqtype=tar\*(rq. If so,
247 will choose an appropriate
248 filename. If the content is not application/octet-stream, then
250 will check to see if the content is a message. If
253 will use the value \*(lq+\*(rq. As a last resort,
255 will use the value \*(lq%m%P.%s\*(rq.
257 Example profile entries might be:
261 mhstore-store-text: %m%P.txt
262 mhstore-store-text: +inbox
263 mhstore-store-message/partial: +
264 mhstore-store-audio/basic: | raw2audio -e ulaw -s 8000 -c 1 > %m%P.au
265 mhstore-store-image/jpeg: %m%P.jpg
266 mhstore-store-application/PostScript: %m%P.ps
270 .SS "Reassembling Messages of Type message/partial"
272 is also able to reassemble messages that have been
273 split into multiple messages of type \*(lqmessage/partial\*(rq.
275 When asked to store a content containing a partial message,
277 will try to locate all of the portions and combine
278 them accordingly. The default is to store the combined parts as
279 a new message in the current folder, although this can be changed
280 using formatting strings as discussed above. Thus, if someone has
281 sent you a message in several parts (such as the output from
283 you can easily reassemble them all into a single
284 message in the following fashion:
289 msg part type/subtype size description
290 5 message/partial 47K part 1 of 4
291 6 message/partial 47K part 2 of 4
292 7 message/partial 47K part 3 of 4
293 8 message/partial 18K part 4 of 4
295 reassembling partials 5,6,7,8 to folder inbox as message 9
297 msg part type/subtype size description
298 9 application/octet-stream 118K
299 (extract with uncompress | tar xvpf -)
305 This will store exactly one message, containing the sum of the
306 parts. It doesn't matter whether the partials are specified in
309 will sort the partials, so that they
310 are combined in the correct order. But if
313 locate every partial necessary to reassemble the message, it will
315 .SS "External Access"
316 For contents of type message/external-body,
317 \fImhstore\fR supports these access-types:
330 For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types,
332 will look for the \*(lqnmh-access-ftp\*(rq
336 nmh-access-ftp: myftp.sh
339 to determine the pathname of a program to perform the FTP retrieval.
340 This program is invoked with these arguments:
344 domain name of FTP-site
350 \*(lqascii\*(rq or \*(lqbinary\*(rq
354 The program should terminate with an exit status of zero if the
355 retrieval is successful, and a non-zero exit status otherwise.
356 .SS "The Content Cache"
359 encounters an external content containing a
360 \*(lqContent-ID:\*(rq field, and if the content allows caching, then
361 depending on the caching behavior of
363 the content might be read from or written to a cache.
365 The caching behavior of
367 is controlled with the
371 switches, which define the policy for reading from,
372 and writing to, the cache, respectively. One of four policies may be
373 specified: \*(lqpublic\*(rq, indicating that
376 of a publically-accessible content cache; \*(lqprivate\*(rq, indicating
379 should make use of the user's private content cache;
380 \*(lqnever\*(rq, indicating that
382 should never make use of
383 caching; and, \*(lqask\*(rq, indicating that
387 There are two directories where contents may be cached: the profile entry
388 \*(lqnmh-cache\*(rq names a directory containing world-readable contents, and,
389 the profile entry \*(lqnmh-private-cache\*(rq names a directory containing
390 private contents. The former should be an absolute (rooted) directory
399 might be used if you didn't care that the cache got wiped after each
400 reboot of the system. The private chace is interpreted relative to the user's
401 mail storage, if not rooted, e.g.,
404 nmh-private-cache: .cache
407 (which is the default value).
408 .SS "User Environment"
409 Because the display environment in which
411 operates may vary for
414 will look for the environment variable
416 If present, this specifies the name of an additional
417 user profile which should be read. Hence, when a user logs in on a
418 particular machine, this environment variable should be set to
419 refer to a file containing definitions useful for that machine.
422 will attempt to consult one other additional
426 %etcdir%/mhn.defaults
429 which is created automatically during
436 .ta \w'%etcdir%/ExtraBigFileName 'u
437 ^$HOME/.mmh/profile~^The user profile
438 ^$MHSTORE~^Additional profile entries
439 ^%etcdir%/mhn.defaults~^System default MIME profile entries
442 .SH "PROFILE COMPONENTS"
446 .ta \w'ExtraBigProfileName 'u
447 ^Path:~^To determine the user's mail storage
448 ^Current\-Folder:~^To find the default current folder
449 ^nmh-access-ftp:~^Program to retrieve contents via FTP
450 ^nmh-cache~^Public directory to store cached external contents
451 ^nmh-private-cache~^Personal directory to store cached external contents
452 ^nmh-storage~^Directory to store contents
453 ^mhstore-store-<type>*~^Template for storing contents
457 mhbuild(1), mhlist(1), mhshow(1), sendfiles(1)
461 .RB ` +folder "' defaults to the current folder"
462 .RB ` msgs "' defaults to cur"
470 If a folder is given, it will become the current folder. The last
471 message selected will become the current message.
474 Partial messages contained within a multipart content are not reassembled.