The munpack program is used by RexxMail to convert MIME-encoded (base64)
file attachments back into their original binary form. Below is the
original doc text included with munpack.exe.
____________________________________________________________________________

Munpack is used to decode one or more messages in MIME or
split-uuencoded format and extract the embedded files. The program is
invoked with:

munpack [options] filename...

which reads the messages in the files "filename...". Munpack may also
be invoked with just:

munpack [options]

which reads a message from the standard input.

If the message suggests a file name to use for the imbedded part, that
name is cleaned of potential problem characters and used for the output
file. If the suggested filename includes subdirectories, they will be
created as necessary. If the message does not suggest a file name, the
names "part1", "part2", etc are used in sequence.

If the imbedded part was preceded with textual information, that
information is also written to a file. The file is named the same as
the imbedded part, with any filename extension replaced with ".dsc"

The possible options are:

-f

Forces the overwriting of existing files. If a message suggests a file
name of an existing file, the file will be overwritten. Without this
flag, munpack replaces any filename extension with ".1", ".2", etc to
find a nonexistent file.

-t

Also unpack the text parts of multipart messages to files. By default,
text parts that do not have a filename parameter do not get unpacked.

-q

Be quiet--suppress messages about saving partial messages.

-C directory

Change the current directory to "directory" before reading any files.
This is useful when invoking munpack from a mail or news reader.

-e

Writes the MIME content type into the extended attribute "MIME-TYPE".
This extended attribute can be used by any software that post processes
the decoded files. The following is an example program how to read this
extended attribute in Rexx:

---------------------------cut here---------------------------------
/* This Rexx program demonstrates how to read the MIME-type        *
 * parameter out of the EA of the decoded file. Note, that the     *
 * options '-e' must be used to write this EA.                     */

call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs

parse ARG name

if SysGetEA(name, "MIME-TYPE", "TYPEINFO") = 0 then
   parse var typeinfo 4 type
else 
   type = "undefined"

say "MIME content-type is" type
---------------------------cut here---------------------------------

The environment variables which control munpack's behavior are:

TMP

Root of directory to store partial messages awaiting reassembly.
Default is "\tmp". Partial messages are stored in subdirectories of
$TMP\parts\


Acknowledgements:

Written by John G. Myers, jgm+@cmu.edu

The os2 port was done by Jochen Friedrich, jochen@audio.pfalz.de

Send all bug reports to mpack-bugs@andrew.cmu.edu 

Thanks to Nathaniel Borenstein for testing early versions of mpack and
for making many helpful suggestions.

Legalese:

(C) Copyright 1993,1994 by Carnegie Mellon University All Rights
Reserved.

Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Carnegie Mellon
University not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission. Carnegie Mellon University makes no representations about
the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.

CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Portions of this software are derived from code written by Bell
Communications Research, Inc. (Bellcore) and by RSA Data Security, Inc.
and bear similar copyrights and disclaimers of warranty. 