email-print-mime-structure(1)
π 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βKEYFILEshould 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βKEYFILEshould 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, andemail-print-mime-structureruns 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 beggingemail-print-mime-structuredisplays 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 thingemail-print-mime-structureexpects 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
- debian trixie: mailscripts 30-2
- ubuntu questing: mailscripts 30-2
- ubuntu resolute: mailscripts 30-2build1
- ubuntu stonking: mailscripts 31-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms