4 .TH MHSTORE %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
6 mhstore \- store contents of MIME messages into files
21 .RB [ \-auto " | " \-noauto ]
28 command allows you to store the contents of a
29 collection of MIME (multi-media) messages into files or other
33 manipulates multi-media messages as specified in
34 RFC\-2045 thru RFC\-2049.
38 will store all the parts of each message.
39 Each part will be store in a separate file. The header fields of
40 the message are not stored. By using the
44 switches, you may limit the scope of
47 subparts (of a multipart content) and/or particular content types.
55 file as the source message, rather than a message from a folder.
56 If you specify this file as \*(lq-\*(rq, then
59 accept the source message on the standard input. Note that the
60 file, or input from standard input should be a validly formatted
61 message, just like any other
65 be in mail drop format (to convert a file in mail drop format to
71 A part specification consists of a series of numbers separated by
72 dots. For example, in a multipart content containing three parts,
73 these would be named as 1, 2, and 3, respectively. If part 2 was
74 also a multipart content containing two parts, these would be named
75 as 2.1 and 2.2, respectively. Note that the
78 effective for only messages containing a multipart content. If a
79 message has some other kind of content, or if the part is itself
80 another multipart content, the
82 switch will not prevent
83 the content from being acted upon.
85 A content specification consists of a content type and a subtype.
86 The initial list of \*(lqstandard\*(rq content types and subtypes
87 can be found in RFC\-2046.
89 A list of commonly used contents is briefly reproduced here:
97 multipart mixed, alternative, digest, parallel
98 message rfc822, partial, external-body
99 application octet-stream, postscript
106 A legal MIME message must contain a subtype specification.
108 To specify a content, regardless of its subtype, just use the name
109 of the content, e.g., \*(lqaudio\*(rq. To specify a specific
110 subtype, separate the two with a slash, e.g., \*(lqaudio/basic\*(rq.
111 Note that regardless of the values given to the
114 a multipart content (of any subtype listed above) is always acted
115 upon. Further note that if the
117 switch is used, and it is
118 desirable to act on a message/external-body content, then the
120 switch must be used twice: once for message/external-body
121 and once for the content externally referenced.
122 .SS "Storing the Contents"
125 will store the contents of the named messages in
126 \*(lqnative\*(rq (decoded) format. Two things must be determined:
127 the directory to store the content, and the filenames. Files are
128 written in the directory given by the \*(lqnmh-storage\*(rq profile
135 If this entry isn't present,
136 the current working directory is used.
140 switch is given, then
143 the message contains information indicating the filename that should
144 be used to store the content. This information should be specified
145 as the attribute \*(lqname=filename\*(rq in the \*(lqContent-Type\*(rq header
146 for the content you are storing. For security reasons, this filename
147 will be ignored if it begins with the character '/', '.', '|', or '!',
148 or if it contains the character '%'. For the sake of security,
149 this switch is not the default, and it is recommended that you do
158 switch is not given (or is being ignored for security
161 will look in the user's profile for a
162 \*(lqformatting string\*(rq to determine how the different contents
163 should be stored. First,
165 will look for an entry of
169 mhstore-store-<type>/<subtype>
172 to determine the formatting string. If this isn't found,
174 will look for an entry of the form:
180 to determine the formatting string.
182 If the formatting string starts with a \*(lq+\*(rq character, then
183 content is stored in the named folder. A formatting string consisting
184 solely of a \*(lq+\*(rq character is interpreted to be the current
187 If the formatting string consists solely of a \*(lq-\*(rq character,
188 then the content is sent to the standard output.
190 If the formatting string starts with a '|', then the display string
191 will represent a command for
193 to execute which should
194 ultimately store the content. The content will be passed to the
195 standard input of the command. Before the command is executed,
197 will change to the appropriate directory, and any
198 escapes (given below) in the display string will be expanded.
200 Otherwise the formatting string will represent a pathname in which
201 to store the content. If the formatting string starts with a '/',
202 then the content will be stored in the full path given, else the
203 file name will be relative to the value of \*(lqnmh-storage\*(rq or
204 the current working directory. Any escapes (given below) will be
205 expanded, except for the a-escape. Note that if \*(lqnmh-storage\*(rq
206 is not an absolute path, it will be relative to the folder that
207 contains the message(s).
209 A command or pathname formatting string may contain the following
210 escapes. If the content isn't part of a multipart (of any subtype
211 listed above) content, the p-escapes are ignored.
216 %a Parameters from Content-type (only valid with command)
217 %m Insert message number
218 %P Insert part number with leading dot
219 %p Insert part number without leading dot
220 %t Insert content type
221 %s Insert content subtype
222 %% Insert character %
226 If no formatting string is found,
228 will check to see if the content is a message. If
231 will use the value \*(lq+\*(rq. As a last resort,
233 will use the value \*(lq%m%P.%s\*(rq.
235 Example profile entries might be:
239 mhstore-store-text: %m%P.txt
240 mhstore-store-text: +inbox
241 mhstore-store-message/partial: +
242 mhstore-store-audio/basic: | raw2audio -e ulaw -s 8000 -c 1 > %m%P.au
243 mhstore-store-image/jpeg: %m%P.jpg
244 mhstore-store-application/PostScript: %m%P.ps
248 .SS "Reassembling Messages of Type message/partial"
250 is also able to reassemble messages that have been
251 split into multiple messages of type \*(lqmessage/partial\*(rq.
253 When asked to store a content containing a partial message,
255 will try to locate all of the portions and combine
256 them accordingly. The default is to store the combined parts as
257 a new message in the current folder, although this can be changed
258 using formatting strings as discussed above. Thus, if someone has
259 sent you a message in several parts (such as the output from
261 you can easily reassemble them all into a single
262 message in the following fashion:
267 msg part type/subtype size description
268 5 message/partial 47K part 1 of 4
269 6 message/partial 47K part 2 of 4
270 7 message/partial 47K part 3 of 4
271 8 message/partial 18K part 4 of 4
273 reassembling partials 5,6,7,8 to folder inbox as message 9
275 msg part type/subtype size description
276 9 application/octet-stream 118K
277 (extract with uncompress | tar xvpf -)
283 This will store exactly one message, containing the sum of the
284 parts. It doesn't matter whether the partials are specified in
287 will sort the partials, so that they
288 are combined in the correct order. But if
291 locate every partial necessary to reassemble the message, it will
294 .SS "External Access"
295 For contents of type message/external-body,
296 \fImhstore\fR supports these access-types:
309 For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types,
311 will look for the \*(lqnmh-access-ftp\*(rq
315 nmh-access-ftp: myftp.sh
318 to determine the pathname of a program to perform the FTP retrieval.
319 This program is invoked with these arguments:
323 domain name of FTP-site
329 \*(lqascii\*(rq or \*(lqbinary\*(rq
333 The program should terminate with an exit status of zero if the
334 retrieval is successful, and a non-zero exit status otherwise.
335 .SS "User Environment"
336 Because the display environment in which
338 operates may vary for
341 will look for the environment variable
343 If present, this specifies the name of an additional
344 user profile which should be read. Hence, when a user logs in on a
345 particular machine, this environment variable should be set to
346 refer to a file containing definitions useful for that machine.
349 will attempt to consult one other additional
353 %etcdir%/mhn.defaults
356 which is created automatically during
363 .ta \w'%etcdir%/ExtraBigFileName 'u
364 ^$HOME/.mmh/profile~^The user profile
365 ^$MHSTORE~^Additional profile entries
366 ^%etcdir%/mhn.defaults~^System default MIME profile entries
369 .SH "PROFILE COMPONENTS"
373 .ta \w'ExtraBigProfileName 'u
374 ^Path:~^To determine the user's mail storage
375 ^Current\-Folder:~^To find the default current folder
376 ^nmh-access-ftp:~^Program to retrieve contents via FTP
377 ^nmh-storage~^Directory to store contents
378 ^mhstore-store-<type>*~^Template for storing contents
382 mhbuild(1), mhlist(1), mhshow(1), sendfiles(1)
386 .RB ` +folder "' defaults to the current folder"
387 .RB ` msgs "' defaults to cur"
391 If a folder is given, it will become the current folder. The last
392 message selected will become the current message.
395 Partial messages contained within a multipart content are not reassembled.