email-print-mime-structure(1)

πŸ“¦
version 31 Β· 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

email-print-mime-structure β€” bestie, this thing shows you a whole tree-shaped view of the MIME structure inside an e-mail 🌳✨


πŸŽ€ SYNOPSIS πŸŽ€

email-print-mime-structure <message.eml

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe: email-print-mime-structure reads a MIME message in from stdin and prints out a treelike representation over on stdout. that's it, that's the whole job, and it does it flawlessly πŸ’…

and if you're the kind of person who needs the parts numbered? literally just pipe the output through something like cat -n and you're golden, no cap 🧚


✨ OPTIONS ✨

  • --pgpkey=KEYFILE β€” KEYFILE should name an OpenPGP transferable secret key that is not password-protected. if a PGP/MIME-encrypted message shows up on standard input, this key gets tried for decryption πŸ”“. you can use it multiple times if you wanna try decrypting with more than one secret key, go off queen πŸ‘‘

OpenPGP secret keys listed in --pgpkey= are used ephemerally, and they do not interact with any local GnuPG keyring. like, they don't even say hi to it 🫢

  • --cmskey=KEYFILE β€” KEYFILE should name a PEM- or DER-encoded X.509 private key that is not password-protected. if an S/MIME-encrypted message that uses CMS shows up on standard input, this key gets tried for decryption πŸ”. and yes, you can use it multiple times if you wanna try decrypting with more than one such key πŸ’β™€οΈ

X.509 private keys listed in --cmskey= are used ephemerally, and they do not interact with any local GnuPG keyring either. same energy, no keyring drama 🌸

  • --use-gpg-agent β€” if this flag is present, and email-print-mime-structure runs into a PGP/MIME- or S/MIME-encrypted part, it will try to decrypt that part using the secret keys it finds in your local installation of GnuPG πŸ”

and if --use-gpg-agent gets supplied along with either --pgpkey=KEYFILE or --cmskey=KEYFILE arguments, the KEYFILE arguments get tried first, before falling back to GnuPG. first come first served, bestie πŸ₯‡

also: if email-print-mime-structure has been asked to decrypt parts with either --pgpkey=KEYFILE or with --use-gpg-agent, and it's unable to decrypt an encrypted part, it will emit a warning to stderr. it's not mad, it's just letting you know 😭

  • --no-use-gpg-agent β€” don't try to decrypt PGP/MIME- or S/MIME-encrypted parts using secret keys found in the local installation of GnuPG. this is the default. so if you do nothing, this is already what you're getting, periodt πŸ’…
  • --help, -h β€” show usage instructions. the classic, the icon, the moment 🫢

🌈 EXAMPLE 🌈

$ email-print-mime-structure <test.eml
└┬╴multipart/signed 6546 bytes
 β”œβ”€β•΄text/plain inline 895 bytes
 └─╴application/pgp-signature inline [signature.asc] 836 bytes

look at that little tree. it's giving structural clarity 🌳✨


πŸ’€ LIMITATIONS πŸ’€

okay bestie, real talk time, because we keep it honest here:

  • email-print-mime-structure's output is not stable, and it is not intended to be interpreted by machines, so please do not depend on it in scripts! πŸ™ˆ like, do not build your whole pipeline on this, i am begging
  • email-print-mime-structure displays some data from within the e-mail, but it does not sanitize it before display. some particularly cleverly-malformed MIME parameters might be able to induce apparent formatting changes or emit arbitrary characters to stdout 😳 so yeah, keep that in mind, it's a whole thing
  • email-print-mime-structure expects to be run in a UTF-8-friendly environment. don't come at it with anything else, it will simply not vibe 🌸

πŸ‘‘ SEE ALSO πŸ‘‘

https://tools.ietf.org/html/rfc2045, https://tools.ietf.org/html/rfc2049, https://tools.ietf.org/html/rfc3156

the sacred texts, iykyk πŸ“œβœ¨


πŸŽ€ AUTHOR πŸŽ€

email-print-mime-structure and this manpage were written by Daniel Kahn Gillmor and Jameson Graef Rollins, with suggestions and feedback from many others in the community that develops the notmuch mail user agent 🫢 and it originated in the notmuch source tree 🌱


okay that's the whole page, bestie, you're officially an expert now πŸ’–

slay ✨ this beauty ships as perl v5.40.1 from the Debian Project β€” that's the version and the source right there, and yeah the manpage's own footer date is the one thing it's not telling us, so consider this the cute sign-off instead πŸ’…πŸŽ€

πŸ“¦ where this page comes from