{
    "content": [
        {
            "type": "text",
            "text": "# reformime (man)\n\n## NAME\n\nreformime - MIME E-mail reformatting tool\n\n## SYNOPSIS\n\nreformime [options...]\n\n## DESCRIPTION\n\nreformime is a utility for reformatting MIME messages.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (19 subsections)\n- **SEE ALSO**\n- **AUTHOR** (1 subsections)\n- **NOTES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "reformime",
        "section": "",
        "mode": "man",
        "summary": "reformime - MIME E-mail reformatting tool",
        "synopsis": "reformime [options...]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "Parse a delivery status notification MIME message (RFC 1894[2]). reformime expects to see on standard input a MIME message that consists of a delivery status notification, as defined by RFC 1894. reformime reads the message and prints on standard output a list of addresses and their corresponding delivery status, as specified in the delivery status notification. Each line printed by reformime consists of a delivery status, a space, and the address. reformime then terminates with a 0 exit status. reformime produces no output and terminates with an exit status of 1 if the standard input does not contain a delivery status notification."
            },
            {
                "flag": "-D",
                "long": null,
                "arg": null,
                "description": "Like the -d except that reformime lists the address found in the Original-Recipient: header, if it exists."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "Extract the contents of the indicated MIME section, and display it on standard output. The -s option is required when -e is specified. If the specified section or sections use either the base64 or quoted-printable encoding method, reformime automatically decodes it. In this case you're better off redirecting the standard output into a file."
            },
            {
                "flag": "-i",
                "long": null,
                "arg": null,
                "description": "Display MIME information for each section. reformime displays the contents of the Content-Type: header, any encoding used, and the character set. reformime also displays the byte offset in the message where each section starts and ends (and where the actual contents of the section start, after skipping all the headers)."
            },
            {
                "flag": "-m",
                "long": null,
                "arg": null,
                "description": "Create a multipart/digest MIME message digest."
            },
            {
                "flag": "-r",
                "long": null,
                "arg": null,
                "description": "Rewrite message, adding or standardizing RFC 2045[1] MIME headers."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Like -r but also convert 8bit-encoded MIME sections to quoted-printable."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Like -r but also convert quoted-printable-encoded MIME sections to 8bit. -s section Display MIME information for this section only. section is a MIME specification tag. The -s option is required if -e is also specified, and is optional with -i. Multiple sections may be specified by separating them with commas. reformime processes each section using the other options that were specified."
            },
            {
                "flag": "-x",
                "long": null,
                "arg": null,
                "description": "Extract the contents of the indicated MIME section to a file."
            },
            {
                "flag": "-X",
                "long": null,
                "arg": null,
                "description": "Pipe the contents of the indicated MIME section to a program."
            },
            {
                "flag": "-x",
                "long": null,
                "arg": null,
                "description": "Interactive extraction. 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 prompts 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)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Automatic extraction. reformime automatically extracts one or more MIME sections, and saves them to a file. The filename is formed by taking PREFIX, and appending the default filename to it. Note that there's no space between \"-x\" and \"PREFIX\". For example: reformime -xfiles- This command saves MIME sections as files-attachment1.dat, then files-attachment2.dat, etc. reformime tries to append the filename specified in the MIME headers for each section, where possible. reformime replaces all suspect characters with the underscore character. -X prog arg1 arg2 ... The -X option must be the last option to reformime. reformime runs an external program prog, and pipes the contents of the MIME section to the program. reformime sets the environment variable CONTENTTYPE to the MIME content type. The environment variable FILENAME gets set to the default filename of reformime's liking. If the -s option is not specified, the program runs once for every MIME section in the message. The external program, prog must terminate with a zero exit status in order for reformime to proceed to the next MIME section in the message (or the next section specified by -s). In any case, if prog terminates with a non-zero exit status, reformime terminates with the exit status of 20 plus prog's exit status. Note reformime extracts every MIME section in the message unless the -s option is specified. This includes even the text/plain MIME content that usually precedes a binary attachment."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "characters to quoted-printable encoding."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "in some situations."
            },
            {
                "flag": "-u",
                "long": null,
                "arg": null,
                "description": "This “undocumented” option reads a MIME message on standard input, and converts its contents to an UTF-8-encoded character stream, which is written to standard output. The standard output receives a concatenated amalgam of the headers and “text” MIME object data. It is meant to be used as part of a generic search function. This option decodes various kinds of header MIME encoding, the quoted-printable and base64 transfer encodings of “text” MIME objects."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "reformail",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/reformail/1/json"
            },
            {
                "name": "sendmail",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/sendmail/8/json"
            },
            {
                "name": "mailbot",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/mailbot/1/json"
            },
            {
                "name": "maildrop",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/maildrop/1/json"
            },
            {
                "name": "maildropfilter",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/maildropfilter/5/json"
            },
            {
                "name": "egrep",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/egrep/1/json"
            },
            {
                "name": "grep",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/grep/1/json"
            },
            {
                "name": "sendmail",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/sendmail/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 34,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-d",
                        "lines": 9,
                        "flag": "-d"
                    },
                    {
                        "name": "-D",
                        "lines": 3,
                        "flag": "-D"
                    },
                    {
                        "name": "-e",
                        "lines": 5,
                        "flag": "-e"
                    },
                    {
                        "name": "-i",
                        "lines": 5,
                        "flag": "-i"
                    },
                    {
                        "name": "-m",
                        "lines": 2,
                        "flag": "-m"
                    },
                    {
                        "name": "-r",
                        "lines": 2,
                        "flag": "-r"
                    },
                    {
                        "name": "-r7",
                        "lines": 2
                    },
                    {
                        "name": "-r8",
                        "lines": 9
                    },
                    {
                        "name": "-x",
                        "lines": 2,
                        "flag": "-x"
                    },
                    {
                        "name": "-X",
                        "lines": 2,
                        "flag": "-X"
                    },
                    {
                        "name": "Extracting RFC 2045 MIME section(s) to file(s)",
                        "lines": 6
                    },
                    {
                        "name": "-x",
                        "lines": 7,
                        "flag": "-x"
                    },
                    {
                        "name": "-x_PREFIX_",
                        "lines": 25
                    },
                    {
                        "name": "Adding RFC 2045 MIME headers",
                        "lines": 8
                    },
                    {
                        "name": "-r7",
                        "lines": 2
                    },
                    {
                        "name": "-r8",
                        "lines": 2
                    },
                    {
                        "name": "Creating multipart/digest MIME digests",
                        "lines": 5
                    },
                    {
                        "name": "Translating MIME headers",
                        "lines": 24
                    },
                    {
                        "name": "-u",
                        "lines": 8,
                        "flag": "-u"
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Sam Varshavchik",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 21,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "reformime - MIME E-mail reformatting tool\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "reformime [options...]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "reformime is a utility for reformatting MIME messages.\n\nGenerally, reformime expects to see an RFC 2045[1] compliant message on standard input,\nexcept in few cases such as the -m option.\n\nIf no options are given, reformime prints the MIME structure of the message. The output\nconsists of so-called \"MIME reference tags\", one per line. For example:\n\n1\n1.1\n1.2\n\nThis shows that the message contains two different MIME sections. The first line of the MIME\nstructure output will always contain \"1\", which refers to the entire message. In this case it\nhappens to be a multipart/mixed message. \"1.1\" refers to the first section of the multipart\nmessage, which happens to be a text/plain section. \"1.2\" refers to the second section of the\nmessage, which happens to be an application/octet-stream section.\n\nIf the message is not a MIME message, or it does not contain any attachments, reformime\nprints only \"1\", that refers to the entire message itself:\n\n1\n\nHere's the output from reformime when the first part of the message was itself a\nmultipart/alternative section:\n\n1\n1.1\n1.1.1\n1.1.2\n1.2\n\nArbitrarily complex MIME constructs are possible.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-d",
                        "content": "Parse a delivery status notification MIME message (RFC 1894[2]).  reformime expects to\nsee on standard input a MIME message that consists of a delivery status notification, as\ndefined by RFC 1894.  reformime reads the message and prints on standard output a list of\naddresses and their corresponding delivery status, as specified in the delivery status\nnotification. Each line printed by reformime consists of a delivery status, a space, and\nthe address.  reformime then terminates with a 0 exit status.  reformime produces no\noutput and terminates with an exit status of 1 if the standard input does not contain a\ndelivery status notification.\n",
                        "flag": "-d"
                    },
                    {
                        "name": "-D",
                        "content": "Like the -d except that reformime lists the address found in the Original-Recipient:\nheader, if it exists.\n",
                        "flag": "-D"
                    },
                    {
                        "name": "-e",
                        "content": "Extract the contents of the indicated MIME section, and display it on standard output.\nThe -s option is required when -e is specified. If the specified section or sections use\neither the base64 or quoted-printable encoding method, reformime automatically decodes\nit. In this case you're better off redirecting the standard output into a file.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-i",
                        "content": "Display MIME information for each section.  reformime displays the contents of the\nContent-Type: header, any encoding used, and the character set.  reformime also displays\nthe byte offset in the message where each section starts and ends (and where the actual\ncontents of the section start, after skipping all the headers).\n",
                        "flag": "-i"
                    },
                    {
                        "name": "-m",
                        "content": "Create a multipart/digest MIME message digest.\n",
                        "flag": "-m"
                    },
                    {
                        "name": "-r",
                        "content": "Rewrite message, adding or standardizing RFC 2045[1] MIME headers.\n",
                        "flag": "-r"
                    },
                    {
                        "name": "-r7",
                        "content": "Like -r but also convert 8bit-encoded MIME sections to quoted-printable.\n"
                    },
                    {
                        "name": "-r8",
                        "content": "Like -r but also convert quoted-printable-encoded MIME sections to 8bit.\n\n-s section\nDisplay MIME information for this section only.  section is a MIME specification tag. The\n-s option is required if -e is also specified, and is optional with -i.\n\nMultiple sections may be specified by separating them with commas.  reformime processes\neach section using the other options that were specified.\n"
                    },
                    {
                        "name": "-x",
                        "content": "Extract the contents of the indicated MIME section to a file.\n",
                        "flag": "-x"
                    },
                    {
                        "name": "-X",
                        "content": "Pipe the contents of the indicated MIME section to a program.\n",
                        "flag": "-X"
                    },
                    {
                        "name": "Extracting RFC 2045 MIME section(s) to file(s)",
                        "content": "The -x and -X options extract a specific MIME section to a file or to a pipe to an external\nprogram. Use the -s option to identify the MIME section to extract. If the -s option is not\nspecified, every MIME section in the message is extracted, one at a time. If -s lists\nmultiple sections, each section gets extracted separately.  quoted-printable and base64\nencoding are automatically decoded.\n"
                    },
                    {
                        "name": "-x",
                        "content": "Interactive extraction.  reformime prints the MIME content type of each section. Answer\nwith 'y' or 'Y' to extract the MIME section. Specify the filename at the next prompt.\nreformime prompts with a default filename.  reformime tries to choose the default\nfilename based on the MIME headers, if possible. If not, the default filename will be\nattachment1.dat (if the -s option is not specified, the next filename will be\nattachment2.dat, and so on).\n",
                        "flag": "-x"
                    },
                    {
                        "name": "-x_PREFIX_",
                        "content": "Automatic extraction.  reformime automatically extracts one or more MIME sections, and\nsaves them to a file. The filename is formed by taking PREFIX, and appending the default\nfilename to it. Note that there's no space between \"-x\" and \"PREFIX\". For example:\n\nreformime -xfiles-\nThis command saves MIME sections as files-attachment1.dat, then files-attachment2.dat,\netc.  reformime tries to append the filename specified in the MIME headers for each\nsection, where possible.  reformime replaces all suspect characters with the underscore\ncharacter.\n\n-X prog arg1 arg2 ...\nThe -X option must be the last option to reformime.  reformime runs an external program\nprog, and pipes the contents of the MIME section to the program.  reformime sets the\nenvironment variable CONTENTTYPE to the MIME content type. The environment variable\nFILENAME gets set to the default filename of reformime's liking. If the -s option is not\nspecified, the program runs once for every MIME section in the message. The external\nprogram, prog must terminate with a zero exit status in order for reformime to proceed to\nthe next MIME section in the message (or the next section specified by -s). In any case,\nif prog terminates with a non-zero exit status, reformime terminates with the exit status\nof 20 plus prog's exit status.\n\nNote\nreformime extracts every MIME section in the message unless the -s option is specified.\nThis includes even the text/plain MIME content that usually precedes a binary attachment.\n"
                    },
                    {
                        "name": "Adding RFC 2045 MIME headers",
                        "content": "The -r option performs the following actions:\n\nIf there is no Mime-Version:, Content-Type:, or Content-Transfer-Encoding: header, reformime\nadds one.\n\nIf the Content-Transfer-Encoding: header contains 8bit or raw, but only seven-bit data is\nfound, reformime changes the Content-Transfer-Encoding header to 7bit.\n"
                    },
                    {
                        "name": "-r7",
                        "content": "characters to quoted-printable encoding.\n"
                    },
                    {
                        "name": "-r8",
                        "content": "in some situations.\n"
                    },
                    {
                        "name": "Creating multipart/digest MIME digests",
                        "content": "The -m option creates a MIME digest.  reformime reads a list of filenames on standard input.\nEach line read from standard input contains the name of a file that is presumed to contain an\nRFC 2822-formatted message.  reformime splices all files into a multipart/digest MIME\nsection, and writes it to standard output.\n"
                    },
                    {
                        "name": "Translating MIME headers",
                        "content": "The following options do not read a message from standard input. These options process MIME\nheaders via the command line, and are designed to be conveniently used by mail-handling\nscripts.\n\n-h \"header\"\nDecode a MIME-encoded \"header\" and print the decoded 8-bit content on standard output.\nThe decoding gets carried out as if the contents occurred in the “Subject” header.\nExample:\n\n$ reformime -h '=?iso-8859-1?Q?H=F3la!?='\nHóla!\n\n-H \"header\"\nLike -h except that header is parsed as a list of email addresses, like “From” or “To”.\n\n-o \"text\"\nMIME-encode \"text\", and print the results on standard output.\n\n-O \"text\"\nLike the -o option, except that text is a structured header with RFC 2822 addresses.\n\n-c \"charset\"\nUse charset as the character set setting, by the -h, -H, -o and -O options.\n"
                    },
                    {
                        "name": "-u",
                        "content": "This “undocumented” option reads a MIME message on standard input, and converts its\ncontents to an UTF-8-encoded character stream, which is written to standard output.\n\nThe standard output receives a concatenated amalgam of the headers and “text” MIME object\ndata. It is meant to be used as part of a generic search function. This option decodes\nvarious kinds of header MIME encoding, the quoted-printable and base64 transfer encodings\nof “text” MIME objects.\n",
                        "flag": "-u"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "reformail(1)[3], sendmail(8), mailbot(1)[4], maildrop(1)[5], maildropfilter(5)[6], egrep(1),\ngrep(1), sendmail(8).\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "",
                "subsections": [
                    {
                        "name": "Sam Varshavchik",
                        "content": "Author\n"
                    }
                ]
            },
            "NOTES": {
                "content": "1. RFC 2045\nhttp://www.rfc-editor.org/rfc/rfc2045.txt\n\n2. RFC 1894\nhttp://www.rfc-editor.org/rfc/rfc1894.txt\n\n3. reformail(1)\n[set $man.base.url.for.relative.links]/reformail.html\n\n4. mailbot(1)\n[set $man.base.url.for.relative.links]/mailbot.html\n\n5. maildrop(1)\n[set $man.base.url.for.relative.links]/maildrop.html\n\n6. maildropfilter(5)\n[set $man.base.url.for.relative.links]/maildropfilter.html\n\n\n\nCourier Mail Server                          06/20/2015                                 REFORMIME(1)",
                "subsections": []
            }
        }
    }
}