reformime - experimental MIME utility

SYNOPSIS

reformime [options] ...

DESCRIPTION

reformime is an experimental MIME utility.

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.2
This 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

 
    1
If, 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.

OPTIONS

Extracting RFC 2045 MIME section(s) to file(s)

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.

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.

Adding RFC 2045 MIME headers

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.

BUGS

-x and -X ignore the Content-Disposition: header.

FILES

$HOME/.tmp - directory for temporary files. Automatically created, if necessary.

SEE ALSO

maildrop(1), maildropfilter(1), reformail(1), egrep(1), grep(1), sendmail(8)