MH-MIME(7)
β¨ MH-MIME(7) β mh-mime β¨
okay bestie, buckle up π this is your girl's guide to mh-mime, aka the overview of nmh MIME message composition and display. yes it's in the Miscellaneous Information Manual and yes we're gonna make it make sense π«Ά
πΈ NAME πΈ
mh-mime β overview of nmh MIME message composition and display
π¦ DESCRIPTION π¦
So, MIME stands for Multipurpose Internet Mail Extensions, and it's literally the format of Internet messages used to send multi-media content. iconic. π
The nmh command suite does have support for the display and composition of MIME messages, but ngl β MIME support is not completely integrated into all tools currently. so this document is basically the vibe check: which tools support MIME message display, storage, and composition.
π Local Character Set Conversion
All of the nmh commands convert non-native character sets to the local character set, as specified by the operating system locale settings. see locale(1) for more details on the environment variables used to set the local character set, iykyk.
β οΈ Character set conversion will only take place if nmh was built withiconv(3)support! Checkmhparam(1)to figure out whether your nmh installation includesiconv(3)support.
Depending on the source and target character set, it may not be possible to convert all characters to the local character set. In this case, a substitution character will be used for the characters that cannot be converted. (not ideal, but it's giving "we tried" π)
π Message Display
The default format used by scan(1) will automatically decode MIME-encoded headers. slay. but if you have a custom scan format, look at the examples provided with the nmh distribution β they live in the /etc/nmh directory π β and check mh-format(5) for details on how to make sure your MIME headers are properly decoded.
By default, if show detects that it is reading a MIME message, it will invoke mhshow(1). The default behavior of mhshow is to only display text parts that are not marked as attachments. see mhshow(1) for details on how to control what mhshow will display π
π Message Interrogation and Storage
The mhlist(1) command will display a listing of the MIME parts contained within a message. That information can be used in conjunction with the mhstore command to save individual parts or content types of a message. see mhlist(1) and mhstore(1) for more details on how these commands work π
π Message Composition and Reply
All messages sent by send(1) will automatically be processed by mhbuild(1) before being passed to post(1) for message submission. mhbuild will use the locale settings to mark text content with the appropriate character set and apply any necessary encoding. If you wish to include text in your message using a character set that does not match your locale, you will need to specify the character set using an mhbuild directive; see mhbuild(1) for more information.
For attaching files or composing other non-text content, there are two options: the attach system and mhbuild directives.
- the attach system β best suited for content where one or more files are being attached to a message. You can use the attach system by either using the
attachcommand at the "What now?" prompt, or by inserting anAttach:header in the message draft containing the name of the file you wish to attach to the message. (heads up: all the attach command does is place anAttach:header in the message draft.)mhbuildwill then automatically include the specified file(s) in the outgoing message. Seesend(1)for details on howmhbuilddetermines the proper content type of attached files. - mhbuild directives β this allows exact control over the contents and format of the MIME message, but has a more complicated syntax.
mhbuild(1)contains details on the directive syntax and examples of directives for different media types.
π¨ IMPORTANT NOTE, bestie: when using mhbuild directives the user must runmhbuildoutside ofsendto have it process directives. When being run bysend,mhbuildis configured to not process directives, so normal user text is not mistaken for a directive. When using directives, a user typically uses themimecommand at the "What now?" prompt to process them.
When replying to messages using repl(1), the traditional MH method of including the original text in the reply does not interoperate with MIME messages. The -convertargs switch to repl(1) provides one solution. Another solution: the contrib directory (/usr/share/doc/nmh/contrib) contains a Perl program called replyfilter which will decode text parts and present them in an appropriate manner to be included in a message reply. See the comments at the top of replyfilter for instructions on how to configure nmh to work with it π§
β Message Rewrite
The mhfixmsg(1) command can apply various transformations to MIME messages, including decoding of text parts, converting the character set of text parts, and insertion of text/plain parts to correspond to text parts of other subtypes. mhfixmsg can also repair defects in MIME messages, such as mismatched top-level boundary indicators and invalid Content-Transfer-Encoding values. it's giving damage control and honestly? we love her π
π SEE ALSO π
comp(1)iconv(3)mh-format(5)mhbuild(1)mhfixmsg(1)mhparam(1)nmh(7)repl(1)whatnow(1)/usr/share/doc/nmh/contrib/replyfilter/usr/share/doc/nmh/contrib/replaliases
π BUGS π
MIME support should be more integrated into all of the nmh tools than it currently is. like. it should be. but it's not. π
mwah π this page came from nmh-1.8, dated 2014-12-15 β she's an icon, she's a legend, and she is the moment β¨ππ
π¦ where this page comes from
- alpine 3.24: nmh-doc 1.8-r3 Β· BSD-3-Clause
- epel 10: nmh 1.8-3.el10_1 Β· BSD
- epel 9: nmh 1.8-1.el9 Β· BSD
- fedora 43: nmh 1.8-9.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: nmh 1.8-10.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms