reformime [options] ...
reformime expects to see an RFC 2045 compliant message on standard input.
If no options are given, reformime prints the MIME structure of the message. The output consists of so-called "MIME reference tags", one per line. For example, you might see the following output:
1 1.1 1.2This tells you that the message contains two different MIME sections. The first line of the MIME structure output will always contain "1", which refers to the entire message, which happens to be a
multipart/mixed
message. "1.1" refers to the first section of the multiparty message, which
happens to be a text/plain section. "1.2" refers to the second
section of the message, which happens to be an
application/octet-stream section. This is a typical situation.
If the message is not a MIME message, or it does not contain any attachments, you will see a rather boring
1If, instead the first part of the message was itself a
multipart/alternative section, you might see the following
instead:
1 1.1 1.1.1 1.1.2 1.2
Arbitrarily complex MIME constructs are possible.
base64 or
quoted-printable encoding method, reformime automatically
decodes it. In this case you're better off redirecting the standard output
into a file.reformime
will display the contents of the Content-Type: header, any encoding used,
and the character set. reformime will also display at which
byte offset in the message each section starts and ends (and where the
actual contents of the section start, skipping all the headers).The -x and -X options extract a specific MIME section to a file or to a pipe to an external program. Use the -s option to identify the MIME section to extract. If the -s option is not specified, every MIME section in the message is extracted, one at a time. quoted-printable and base64 encoding are automatically decoded.
reformime prints the MIME
content type of each section. Answer with 'y' or 'Y' to extract the MIME
section. Specify the filename at the next prompt. reformime
will prompt with a default filename. reformime tries to choose the default
filename based on the MIME headers, if possible. If not, the default
filename will be attachment1.dat (if the -s option is not
specified, the next filename will be attachment2.dat, and so
on).files-attachment1.dat, then
files-attachment2.dat, etc. reformime will try
to append the filename specified in the MIME headers for each section.
reformime will replace all suspect characters with the underbar,
when using the filename specified in the MIME headers.reformime. reformime will run an external
program specified by "prog", and pipe the contents of the MIME section to
the program. reformime will set the environment variable
CONTENT_TYPE to the MIME content type. The environmetn
variable FILENAME will be set to the default filename of
reformime's liking. If the -s option is not specified, the program will be
executed one time for every MIME section in the message.NOTE: reformime will extract every MIME section in the message
unless the -s option is specified. Yes, even the text/plain MIME
part that usually precedes a binary attachment.
The -r option performs the following actions:
If there is no Mime-Version:, Content-Type:, or
Content-Transfer-Encoding: header, reformime will
add one.
If the Content-Transfer-Encoding: header contains
8bit or raw, but only seven-bit data is found,
the Content-Transfer-Encoding header is changed to
7bit.
-r7 does the same thing, but also converts 8bit transfer encoding containing eight-bit characters to quoted-printable encoding.
-r8 does the same thing, but also converts quoted-printable encoded sections to 8bit, except in some situations.
-x and -X ignore the Content-Disposition: header.
$HOME/.tmp - directory for temporary files. Automatically
created, if necessary.