MIME-TOOL(1)

πŸ’– mime β€” the MIME message tool, a.k.a. mime-tool πŸ’–

okay bestie, pull up a chair, because this is the manual page for mime-tool (the command itself is just called mime, lowercase, iconic), and it is genuinely one of the most useful little gremlins in your toolbox. it lives in the General Commands Manual section, and it is not complicated, it's just ✨vibey✨.


πŸŽ€ NAME πŸŽ€

mime-tool β€” a simple program that constructs MIME messages with attached files. that's it. that's the whole job. slay.


🌸 SYNOPSIS 🌸

mime [ -dDvV ] [ -S subject ] [ -F from-address ] [ -T to-address ] [ -C
carbon-copy address ] [ -P prolog-text ] [ -E epiplogue-text ] [ -B
boundary ] [ -O overall content-type ] { [ -78abiquxopm ] [ -t content-
type ] filename }

πŸ¦‹ DESCRIPTION πŸ¦‹

so the mime program builds MIME messages with files attached to them. no cap. you get to control:

  • the content type β€” application/octet-stream, text/plain, or literally any type you feel like specifying yourself
  • the content type encoding β€” 7bit, 8bit, binary, base64, or auto-detect
  • the content disposition β€” attached or inline
  • the content boundary string

and because it's a whole mail-adjacent situation, you can also set the mail stuff: subject, from-address, to-address, carbon-copy address, prolog-text, and epilog-text. the whole aesthetic, honestly. πŸ’…

here's the best part: the output of the MIME-tool program can be piped directly into mail, mailx, or sendmail β€” or honestly any other command that accepts RFC-822 formatted messages. it just vibes with them. 🫢

⚠️ NOTE, and this one is important bestie: if you specify 7-bit encoding for an attachment that contains 8-bit data, any data bytes whose high-bit is set get converted into question marks. not a vibe. not slay. just know that going in. 😭

✨ OPTIONS ✨

one bullet per flag, no skipping, no gatekeeping:

  • -7 β€” 7-bit ASCII encoding
  • -8 β€” 8-bit ASCII encoding
  • -a β€” application/octet-stream content type
  • -b β€” binary encoding
  • -d β€” low detail debugging
  • -D β€” high detail debugging
  • -s β€” write a subpart
  • -i β€” disposition: inline (instead of attachment)
  • -q β€” quoted-printable encoding
  • -c content-type β€” explicit content type
  • -t β€” text/plain content type
  • -o β€” omit disposition line
  • -u β€” unknown encoding, auto-detect
  • -v β€” verbose messages
  • -V β€” very verbose messages
  • -x β€” base64 encoding
  • -p β€” copy existing MIME part
  • -o β€” omit content-disposition
  • -m β€” omit content-transfer-encoding
  • -n filename β€” override the filename in the disposition header
  • -N β€” don't add a filename parameter in the disposition header
  • -0 β€” no-op
πŸ™ˆ yes, -o shows up twice in the original list with two different descriptions β€” "omit disposition line" and "omit content-disposition". not me editing the source material, i am simply telling you what the page says. both are here, both are preserved, periodt.

πŸ”₯ EXAMPLES πŸ”₯

using MIME-tool to write a mail message to a file:

mime -S "test message" -F me@foo.net -T someone@somewhere.net
file1 > test.msg

using MIME-tool with the mail command:

mime -S "test message" -F me@foo.net file1 | mail
someone@somewhere.net

using MIME-tool with the mailx command:

mime -S "test message" -F me@foo.net file1 | mailx
someone@somewhere.net

using MIME-tool with the sendmail command:

mime -S "test message" -F me@foo.net file1 | sendmail
someone@somewhere.net

⭐ VERSION ⭐

this is version 1.5.topal3, from June 2009. vintage. iconic. πŸ’œ


πŸ’€ KNOWN BUGS πŸ’€

okay so, the tea:

  • most of the header values are not properly quoted or folded, so long or complex values for these headers may cause problems. specifically, the from-address, to-address, carbon-copy-address and content-type headers may not be properly quoted or folded. so like... keep them simple? 😬
  • for some reason, certain e-mail clients (especially from a large software company located in Redmond, Washington β€” i said what i said) don't seem to recognize file attachments as attachments, and instead display them as inline attachments. maybe this isn't MIME-tool's fault, but the author says they've gotten a few e-mails about it, so it's getting mentioned here. respectfully. πŸ“

πŸ‘‘ AUTHOR πŸ‘‘

mime is written by Jeffrey Dutky <dutky@bellatlantic.net>

and shoutout to the whole crew who spotted stuff:

  • Oscar Esteban spotted an off-by-one error in the base64 encoding function.
  • Sergey Lapin spotted a bug in the filename header construction.
  • Chris Hemphill noticed that the documentation (this manual page and the README file) didn't include any examples of how to call the program with common mail commands.
  • some additional fixes and additions by Phil Brooke to support Topal.

the way that the whole community pulled up for this little tool... we love to see it. 🫢


🌈 AVAILABILITY 🌈

the original MIME-tool package can be downloaded from the author's web page at:

http://members.bellatlantic.net/~dutky

this modified version is distributed with Topal:

http://homepage.ntlworld.com/phil.brooke/topal/

and that's the whole page, bestie! πŸ’– go forth and attach files with confidence. no cap, you're gonna eat. πŸ‘‘

🌸 sign-off, cutie: this one is the mime page from the MIME tool source, version 1.5.topal3 from June 2009 β€” and yes, the footer would've told you "MIME tool / mime / MIME message tool(1)", but you already knew that, iykyk. βœ¨πŸ¦‹