source: trunk/third/nmh/man/mhstore.man @ 12455

Revision 12455, 13.3 KB checked in by danw, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12454, which included commits to RCS files with non-trunk default branches.
Line 
1.\"
2.\" %nmhwarning%
3.\" $Id: mhstore.man,v 1.1.1.1 1999-02-07 18:14:21 danw Exp $
4.\"
5.\" include the -mh macro file
6.so %etcdir%/tmac.h
7.\"
8.TH MHSTORE %manext1% MH.6.8 [%nmhversion%]
9.SH NAME
10mhstore \- store contents of MIME messages into files
11.SH SYNOPSIS
12.in +.5i
13.ti -.5i
14mhstore \%[+folder] \%[msgs] \%[\-file file]
15.br
16\%[\-part number]... \%[\-type content]...
17.br
18\%[\-auto] \%[\-noauto]
19\%[\-check] \%[\-nocheck]
20.br
21\%[\-rcache policy] \%[\-wcache policy]
22.br
23\%[\-verbose] \%[\-noverbose]
24\%[\-version]
25\%[\-help]
26.in -.5i
27
28.SH DESCRIPTION
29The \fImhstore\fR command allows you to store the contents of a
30collection of MIME (multi-media) messages into files or other
31messages.
32
33\fImhstore\fR manipulates multi-media messages as specified in
34RFC\-2045 thru RFC\-2049.
35
36By default, \fImhstore\fR will store all the parts of each message.
37Each part will be store in a separate file.  The header fields of
38the message are not stored.  By using the `\-part' and `\-type'
39switches, you may limit the scope of \fImhstore\fR to particular
40subparts (of a multipart content) and/or particular content types.
41
42The option `\-file\ file' directs \fImhstore\fR to use the specified
43file as the source message, rather than a message from a folder.
44If you specify this file as \*(lq-\*(rq, then \fImhstore\fR will
45accept the source message on the standard input.  Note that the
46file, or input from standard input should be a validly formatted
47message, just like any other \fInmh\fR message.  It should \fBNOT\fR
48be in mail drop format (to convert a file in mail drop format to
49a folder of \fInmh\fR messages, see \fIinc\fR\0(1)).
50
51A part specification consists of a series of numbers separated by
52dots.  For example, in a multipart content containing three parts,
53these would be named as 1, 2, and 3, respectively.  If part 2 was
54also a multipart content containing two parts, these would be named
55as 2.1 and 2.2, respectively.  Note that the `\-part' switch is
56effective for only messages containing a multipart content.  If a
57message has some other kind of content, or if the part is itself
58another multipart content, the `\-part' switch will not prevent
59the content from being acted upon.
60
61A content specification consists of a content type and a subtype.
62The initial list of \*(lqstandard\*(rq content types and subtypes
63can be found in RFC\-2046.
64.ne 18
65A list of commonly used contents is briefly reproduced here:
66.sp
67.nf
68.in +.5i
69.ta \w'application  'u
70Type    Subtypes
71----    --------
72text    plain, enriched
73multipart       mixed, alternative, digest, parallel
74message rfc822, partial, external-body
75application     octet-stream, postscript
76image   jpeg, gif, png
77audio   basic
78video   mpeg
79.re
80.in -.5i
81.fi
82.sp
83A legal MIME message must contain a subtype specification.
84.PP
85To specify a content, regardless of its subtype, just use the name
86of the content, e.g., \*(lqaudio\*(rq.  To specify a specific
87subtype, separate the two with a slash, e.g., \*(lqaudio/basic\*(rq.
88Note that regardless of the values given to the `\-type' switch,
89a multipart content (of any subtype listed above) is always acted
90upon.  Further note that if the `\-type' switch is used, and it is
91desirable to act on a message/external-body content, then the
92`\-type' switch must be used twice: once for message/external-body
93and once for the content externally referenced.
94
95.Uh "Checking the Contents"
96The `\-check' switch tells \fImhstore\fR to check each content for
97an integrity checksum.  If a content has such a checksum (specified
98as a Content-MD5 header field), then \fImhstore\fR will attempt to
99verify the integrity of the content.
100
101.Uh "Storing the Contents"
102The \fImhstore\fR will store the contents of the named messages in
103\*(lqnative\*(rq (decoded) format.  Two things must be determined:
104the directory to store the content, and the filenames.  Files are
105written in the directory given by the \fBnmh-storage\fR profile
106entry,
107.ne 6
108e.g.,
109.sp
110.in +.5i
111nmh-storage: /tmp
112.in -.5i
113.sp
114If this entry isn't present,
115the current working directory is used.
116
117If the `\-auto' switch is given, then \fImhstore\fR will check if
118the message contains information indicating the filename that should
119be used to store the content.  This information should be specified
120as the attribute \*(lqname=filename\*(rq in the Content-Type header
121for the content you are storing.  For security reasons, this filename
122will be ignored if it begins with the character '/', '.', '|', or
123'!', or if it contains the character '%'.  For the sake of security,
124this switch is not the default, and it is recommended that you do
125NOT put the `\-auto' switch in your \&.mh\(ruprofile file.
126
127If the `\-auto' switch is not given (or is being ignored for security
128reasons) then \fImhstore\fR will look in the user's profile for a
129\*(lqformatting string\*(rq to determine how the different contents
130should be stored.  First, \fImhstore\fR will look for an entry of
131the form:
132.sp
133.in +.5i
134mhstore-store-<type>/<subtype>
135.in -.5i
136.sp
137to determine the formatting string.  If this isn't found, \fImhstore\fR
138will look for an entry of the form:
139.sp
140.in +.5i
141mhstore-store-<type>
142.in -.5i
143.sp
144to determine the formatting string.
145
146If the formatting string starts with a \*(lq+\*(rq character, then
147content is stored in the named folder.  A formatting string consisting
148solely of a \*(lq+\*(rq character is interpreted to be the current
149folder.
150
151If the formatting string consists solely of a \*(lq-\*(rq character,
152then the content is sent to the standard output.
153
154If the formatting string starts with a '|', then the display string
155will represent a command for \fImhstore\fR to execute which should
156ultimately store the content.  The content will be passed to the
157standard input of the command.  Before the command is executed,
158\fImhstore\fR will change to the appropriate directory, and any
159escapes (given below) in the display string will be expanded.
160
161Otherwise the formatting string will represent a pathname in which
162to store the content.  If the formatting string starts with a '/',
163then the content will be stored in the full path given, else the
164file name will be relative to the value of \fBnmh-storage\fR or
165the current working directory.  Any escapes (given below) will be
166expanded, except for the a-escape.
167
168A command or pathname formatting string may contain the following
169escapes.  If the content isn't part of a multipart (of any subtype
170listed above) content, the p-escapes are ignored.
171.sp
172.nf
173.in +.5i
174.ta \w'%P  'u
175%a      Parameters from Content-type  (only valid with command)
176%m      Insert message number
177%P      Insert part number with leading dot
178%p      Insert part number without leading dot
179%t      Insert content type
180%s      Insert content subtype
181%%      Insert character %
182.re
183.in -.5i
184.fi
185.sp
186If no formatting string is found, \fImhstore\fR will check to see
187if the content is application/octet-stream with parameter
188\*(lqtype=tar\*(rq.  If so, \fImhstore\fR will choose an appropriate
189filename.  If the content is not application/octet-stream, then
190\fImhstore\fR will check to see if the content is a message.  If
191so, \fImhstore\fR will use the value \*(lq+\*(rq.  As a last resort,
192\fImhstore\fR will use the value \*(lq%m%P.%s\*(rq.
193
194.ne 10
195Example profile entries might be:
196.sp
197.nf
198.in +.5i
199mhstore-store-text: %m%P.txt
200mhstore-store-text: +inbox
201mhstore-store-message/partial: +
202mhstore-store-audio/basic: | raw2audio -e ulaw -s 8000 -c 1 > %m%P.au
203mhstore-store-image/jpeg: %m%P.jpg
204mhstore-store-application/PostScript: %m%P.ps
205.in -.5i
206.fi
207.sp
208.Uh "Reassembling Messages of Type message/partial"
209\fImhstore\fR is also able to reassemble messages that have been
210split into multiple messages of type \*(lqmessage/partial\*(rq.
211
212When asked to store a content containing a partial message,
213\fImhstore\fR will try to locate all of the portions and combine
214them accordingly.  The default is to store the combined parts as
215a new message in the current folder, although this can be changed
216using formatting strings as discussed above.  Thus, if someone has
217sent you a message in several parts (such as the output from
218\fIsendfiles\fR), you can easily reassemble them all into a single
219message in the following fashion:
220.sp
221.nf
222.in +.5i
223% mhlist 5-8
224 msg part  type/subtype             size description
225   5       message/partial           47K part 1 of 4
226   6       message/partial           47K part 2 of 4
227   7       message/partial           47K part 3 of 4
228   8       message/partial           18K part 4 of 4
229% mhstore 5-8
230reassembling partials 5,6,7,8 to folder inbox as message 9
231% mhlist -verbose 9
232 msg part  type/subtype             size description
233   9       application/octet-stream 118K
234             (extract with uncompress | tar xvpf -)
235             type=tar
236             conversions=compress
237.in -.5i
238.fi
239.sp
240This will store exactly one message, containing the sum of the
241parts.  It doesn't matter whether the partials are specified in
242order, since \fImhstore\fR will sort the partials, so that they
243are combined in the correct order.  But if \fImhstore\fR can not
244locate every partial necessary to reassemble the message, it will
245not store anything.
246
247.Uh "External Access"
248For contents of type message/external-body,
249.ne 12
250\fImhstore\fR supports these access-types:
251.sp
252.nf
253.in +.5i
254afs
255anon-ftp
256ftp
257local-file
258mail-server
259.in -.5i
260.fi
261.sp
262For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types,
263\fImhstore\fR will look for the \fBnmh-access-ftp\fR
264profile entry,
265.ne 6
266e.g.,
267.sp
268.in +.5i
269nmh-access-ftp: myftp.sh
270.in -.5i
271.sp
272to determine the pathname of a program to perform the FTP retrieval.
273.ne 14
274This program is invoked with these arguments:
275.sp
276.nf
277.in +.5i
278domain name of FTP-site
279username
280password
281remote directory
282remote filename
283local filename
284\*(lqascii\*(rq or \*(lqbinary\*(rq
285.in -.5i
286.fi
287.sp
288The program should terminate with an exit status of zero if the
289retrieval is successful, and a non-zero exit status otherwise.
290
291If this entry is not provided, then \fImhstore\fR will use a simple
292built-in FTP client to perform the retrieval.
293
294.Uh "The Content Cache"
295When \fImhstore\fR encounters an external content containing a
296\*(lqContent-ID:\*(rq field, and if the content allows caching, then
297depending on the caching behavior of \fImhstore\fR, the content might be
298read from or written to a cache.
299
300The caching behavior of \fImhstore\fR is controlled with the `\-rcache'
301and `\-wcache' switches, which define the policy for reading from,
302and writing to, the cache, respectively.  One of four policies may be
303specified: \*(lqpublic\*(rq, indicating that \fImhstore\fR should make use
304of a publically-accessible content cache; \*(lqprivate\*(rq, indicating
305that \fImhstore\fR should make use of the user's private content cache;
306\*(lqnever\*(rq, indicating that \fImhstore\fR should never make use of
307caching; and, \*(lqask\*(rq, indicating that \fImhstore\fR should ask
308the user.
309
310There are two directories where contents may be cached: the profile entry
311\fBnmh-cache\fR names a directory containing world-readable contents, and,
312the profile entry \fBnmh-private-cache\fR names a directory containing
313private contents.  The former should be an absolute (rooted) directory
314name.
315.ne 6
316For example,
317.sp
318.in +.5i
319nmh-cache: /tmp
320.in -.5i
321.sp
322might be used if you didn't care that the cache got wiped after each
323reboot of the system.  The latter is interpreted relative to the user's
324nmh directory, if not rooted,
325.ne 6
326e.g.,
327.sp
328.in +.5i
329nmh-private-cache: .cache
330.in -.5i
331.sp
332(which is the default value).
333
334.Uh "User Environment"
335Because the environment in which \fImhstore\fR operates may vary
336for different machines, \fImhstore\fR will look for the environment
337variable \fB$MHSTORE\fR.  If present, this specifies the name of
338an additional user profile which should be read.  Hence, when a
339user logs in on a machine, this environment variable should be set
340to refer to a file containing definitions useful for that machine.
341Finally, \fImhstore\fR will attempt to consult one other additional
342user profile,
343.ne 6
344e.g.,
345.sp
346.in +.5i
347%etcdir%/mhn.defaults
348.in -.5i
349.sp
350which is created automatically during nmh installation.
351.Fi
352^$HOME/\&.mh\(ruprofile~^The user profile
353^$MHSTORE~^Additional profile entries
354^%etcdir%/mhn.defaults~^System default MIME profile entries
355.Pr
356^Path:~^To determine the user's nmh directory
357.Ps
358^Current\-Folder:~^To find the default current folder
359.Ps
360^nmh-access-ftp:~^Program to retrieve contents via FTP
361.Ps
362^nmh-cache~^Public directory to store cached external contents
363.Ps
364^nmh-private-cache~^Personal directory to store cached external contents
365.Ps
366^nmh-storage~^Directory to store contents
367.Ps
368^mhstore-store-<type>*~^Template for storing contents
369.Sa
370mhbuild(1), mhlist(1), mhshow(1), sendfiles(1)
371.br
372RFC\-2045:
373.br
374   \fIMultipurpose Internet Mail Extensions (MIME) Part One:
375.br
376   Format of Internet Message Bodies\fR,
377.br
378RFC\-2046:
379.br
380   \fIMultipurpose Internet Mail Extensions (MIME) Part Two:
381.br
382   Media Types\fR,
383.br
384RFC\-2047:
385.br
386   \fIMultipurpose Internet Mail Extensions (MIME) Part Three:
387.br
388   Message Header Extensions for Non-ASCII Text\fR,
389.br
390RFC\-2048:
391.br
392   \fIMultipurpose Internet Mail Extensions (MIME) Part Four:
393.br
394   Registration Procedures\fR,
395.br
396RFC\-2049:
397.br
398   \fIMultipurpose Internet Mail Extensions (MIME) Part Five:
399.br
400   Conformance Criteria and Examples\fR.
401.De
402`+folder' defaults to the current folder
403.Ds
404`msgs' defaults to cur
405.Ds
406`\-noauto'
407.Ds
408`\-nocheck'
409.Ds
410`\-rcache ask'
411.Ds
412`\-wcache ask'
413.Ds
414`\-noverbose'
415.Co
416If a folder is given, it will become the current folder.  The last
417message selected will become the current message.
418.Bu
419Partial messages contained within a multipart content are not reassembled.
420.En
Note: See TracBrowser for help on using the repository browser.