REFORMIME(1)
β¨ REFORMIME(1) β¨
okay bestie, gather round, because reformime is genuinely one of those tools that looks quiet and then eats π
β it's the MIME E-mail reformatting tool, and it's about to become your whole personality. Manual page by S. Varshavchik, vibes by me. Let's go π¦
πΈ NAME πΈ
reformime β MIME E-mail reformatting tool. that's it, that's the girl π
π SYNOPSIS π
reformime [options...]
π DESCRIPTION π
so reformime is a utility for reformatting MIME messages. iconic behaviour, no notes.
generally speaking, reformime expects to see an RFC 2045[1] compliant message sitting on standard input β except in a few cases, like with the -m option. she's flexible but she has boundaries π«Ά
If you give her no options at all, reformime prints out the MIME structure of the message. That output is made of what we call "MIME reference tags", one per line. Like this:
1
1.1
1.2
so what is this telling you? this message contains two different MIME sections, bestie. the first line of the MIME structure output will always contain 1, which refers to the entire message. in this case the whole message happens to be a multipart/mixed message. 1.1 refers to the first section of that multipart 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. slay π
now β if the message is not a MIME message, or it doesn't contain any attachments, reformime prints only 1, which refers to the entire message itself:
1
and here's the output from reformime when the first part of the message was itself a multipart/alternative section:
1
1.1
1.1.1
1.1.2
1.2
arbitrarily complex MIME constructs are possible. lowkey terrifying, highkey impressive. π
β¨ OPTIONS β¨
-dβ parse a delivery status notification MIME message (RFC 3464[2]).reformimeexpects to see on standard input a MIME message that consists of a delivery status notification, as defined by RFC 1894.reformimereads 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 byreformimeconsists of a delivery status, a space, and the address.reformimethen terminates with a 0 exit status.reformimeproduces no output and terminates with an exit status of 1 if the standard input does not contain a delivery status notification.
International domain names get converted to the system locale's encoding. If the conversion is not possible: an address given in the delivery status notification directly in UTF-8 has its non-converted characters replaced by their hexadecimal values; a punycode-encoded address gets displayed as is. For best results the system locale's encoding should be UTF-8. π
-Dβ like the-dexcept thatreformimelists the address found in theOriginal-Recipient:header, if it exists.-eβ extract the contents of the indicated MIME section, and display it on standard output. The-soption is required when-eis specified. If the specified section or sections use either thebase64orquoted-printableencoding method,reformimeautomatically decodes it. In this case you're better off redirecting the standard output into a file. π-iβ display MIME information for each section.reformimedisplays the contents of theContent-Type:header, any encoding used, and the character set.reformimealso 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).-Vβ check for correctness of each section's MIME metadata. No output is produced when all MIME sections pass all tests. Any issues are reported, together with their MIME section, for example:
Warnings (1.1):
Bad hexadecimal quoted-printable encoding
Warning messages indicate which MIME section they're reported for β section 1.1 in this example had a problem with its encoding.
Issues that affect the ability to parse the MIME message itself are reported as fatal errors (together with any warnings, if any, for whatever it's worth). Fatal errors result in reformime terminating with a non-0 exit code. π
-mβ create amultipart/digestMIME message digest.-rβ rewrite message, adding or standardizing RFC 2045[1] MIME headers.-r7β like-rbut also convert8bit-encoded MIME sections toquoted-printable.-r8β like-rbut also convertquoted-printable-encoded MIME sections to8bit, except in some situations, see below.-rUβ unconditionally convertquoted-printable-encoded MIME sections to8bit, even when the resulting message may not necessarily comply with Internet message formatting standards. See below for more information.-ssection β display MIME information for this section only. section is a MIME specification tag. The-soption is required if-eis 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. π
-xβ extract the contents of the indicated MIME section to a file.-Xβ pipe the contents of the indicated MIME section to a program.
π§ 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. If -s lists multiple sections, each section gets extracted separately. quoted-printable and base64 encoding are automatically decoded. π
-xβ interactive extraction.reformimeprints the MIME content type of each section. Answer with'y'or'Y'to extract the MIME section. Specify the filename at the next prompt.reformimeprompts with a default filename.reformimetries to choose the default filename based on the MIME headers, if possible. If not, a randomly-generated filename is the default option. π²-xPREFIXβ automatic extraction.reformimeautomatically 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-xand 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.
-Xprog arg1 arg2 ... β the-Xoption must be the last option toreformime.reformimeruns an external program prog, and pipes the contents of the MIME section to the program.reformimesets the environment variableCONTENT_TYPEto the MIME content type. The environment variableFILENAMEgets set to the default filename ofreformime's liking. If the-soption 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 forreformimeto 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,reformimeterminates 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. like, yes, the boring part too. sorry bestie π
π 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 adds one.
If the Content-Transfer-Encoding: header contains 8bit or raw, but only seven-bit data is found, reformime changes the Content-Transfer-Encoding header to 7bit.
-r7 does the same thing, but also converts 8bit-encoded content that contains eight-bit characters to quoted-printable encoding.
-r8 does the same thing, but also converts quoted-printable-encoded content to 8bit, except in some situations. The content remains quoted-printable if converting it results in excessively long lines of text.
-rU always converts quoted-printable-encoded content to 8bit potentially resulting in excessively long lines of text.
β οΈ The resulting message should not be resubmitted for mail delivery, as a delivery failure may occur. like, do not do it. i'm begging. π
π Creating multipart/digest MIME digests π
The -m option creates a MIME digest. reformime reads a list of filenames on standard input. Each line read from standard input contains the name of a file that is presumed to contain an RFC 2822-formatted message. reformime splices all files into a multipart/digest MIME section, and writes it to standard output. β¨
π Translating MIME headers π
The following options do not read a message from standard input. These options process MIME headers via the command line, and are designed to be conveniently used by mail-handling scripts. iykyk π§
-h"header" β decode a MIME-encoded "header" and print the decoded 8-bit content on standard output. The decoding gets carried out as if the contents occurred in the "Subject" header. Example:
$ reformime -h '=?iso-8859-1?Q?H=F3la!?='
HΓ³la!
-H"header" β like-hexcept that header is parsed as a list of email addresses, like "From" or "To".-o"text" β MIME-encode "text", and print the results on standard output.-O"text" β like the-ooption, except that text is a structured header with RFC 2822 addresses.-c"charset" β use charset as the character set setting, by the-h,-H,-oand-Ooptions.-uβ 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. An extra newline character is appended to each MIME entity, ensuring that MIME entities that don't end with a trailing newline will not end up having the next MIME entity's first header line glued to it. no glued headers in this house π
π SEE ALSO π
reformail(1)[3], sendmail(8), mailbot(1)[4], maildrop(1)[5], maildropfilter(5)[6], egrep(1), grep(1), sendmail(8).
π AUTHOR π
Sam Varshavchik : Author
π NOTES π
okay bestie, here's the receipts section β every link the page is standing on, in order, no skips π these are the sources the whole thing cites, so if you wanna go deeper than the vibe, this is where you go:
- RFC 2045 β
http://www.rfc-editor.org/rfc/rfc2045.txt - RFC 3464 β
https://www.rfc-editor.org/rfc/rfc3464.txt reformail(1)βhttp://www.courier-mta.org/maildrop/reformail.htmlmailbot(1)βhttp://www.courier-mta.org/maildrop/mailbot.htmlmaildrop(1)βhttp://www.courier-mta.org/maildrop/maildrop.htmlmaildropfilter(5)βhttp://www.courier-mta.org/maildrop/maildropfilter.html
and that's the whole page, bestie!! πβ¨ this one ships as part of the Courier Mail Server, dated 01/10/2026, and it lives in section 1 as REFORMIME(1) β go forth and reformat those MIME messages, you absolute icon πππ¦
no cap, you read the entire thing. main character behavior fr fr. periodt π
π¦ where this page comes from
- ubuntu stonking: maildrop 4.0.4-1 Β· GPL-3~with-OpenSSL-exception
- Copyright 1998 - 2010 S. Varshavchik. See COPYING for -->
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms