Indiana University
University Information Technology Services
  
What are archived documents?

ARCHIVED: In Unix, what is mpack and how do I use it?

In Unix, mpack is a program that encodes files into MIME format. To use mpack, at the Unix shell prompt, enter:

mpack [options] file [addresses]

Replace [options] with one or more of the options detailed below. Replace file with the name of the file you wish to pack. Replace [addresses] with the email addresses of those to whom you want to send the MIME-encapsulated file. If you are sending the file to a newsgroup or saving it to another file, you do not need to include email addresses.

The mpack program has the following options:

-s "subject" Replace subject with what you want to appear in the "Subject:" header of the MIME-encapsulated file. If you do not specify a subject, mpack will prompt you for one. Make sure to use the quotes as represented in this example.
-d descriptionfile Replace descriptionfile with the name of an ASCII text file. The file will be included at the beginning of the encoded file (or the first file in the case of segmented documents) as an introductory message.
-s maxsize Replace maxsize with the maximum number of characters allowed in any encoded file. If the encoded file is larger than this limit, it will be split into segments.
-c content-type Replace content-type with the MIME subtype that describes the file. The mpack program will only accept the following subtypes: application, audio, image, and video. If you do not specify a subtype, mpack will attempt to determine one based on the content of the file.
-o outputfile Replace outputfile with a filename. The mpack program will write its output to that file. If it must split the encoded file, it will add a suffix (.01, .02, .03, etc.) to the end of each segment's output file. If you don't specify this option and you also don't include any recipient addresses or newsgroups, mpack will write to standard output (i.e., the terminal).
-n newsgroups Replace newsgroups by a comma-delimited list of newsgroups to which you wish to send the encoded file.

A utility called munpack decodes MIME-encapsulated files. (However, metamail is a superior program that provides the same functionality.)

For more information, consult the man pages for mpack and metamail.

Also see:

This is document afea in domain all.
Last modified on November 01, 2008.
Please tell us, did you find the answer to your question?