SMIME_TEXT(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’– SMIME_TEXT(3) β€” Library Functions Manual, but make it main character πŸ’–

okay so bestie, this is the manual page for SMIME_TEXT(3) from the Library Functions Manual, and it's giving "tiny utility, very specific job." No cap: if you need to strip text/plain MIME headers, this is your girl. πŸŽ€


✨ NAME ✨

SMIME_text β€” remove text/plain MIME headers. That's it, that's the whole vibe: the MIME headers get discarded and the actual text gets to shine. πŸ’…

🌸 SYNOPSIS 🌸

library β€œlibcrypto” #include <openssl/asn1.h>

int
SMIME_text(BIO *in_bio, BIO *out_bio);

πŸ¦‹ DESCRIPTION πŸ¦‹

So SMIME_text() rolls up to in_bio, reads the MIME headers, and checks that the content type is text/plain. If that checks out, it discards those MIME headers like last season's drama and copies the text that follows the headers from in_bio to out_bio. Literally remove headers, keep the text, slay. ✨

πŸ’œ RETURN VALUES πŸ’œ

SMIME_text() returns 1 on success. Iconic. It returns 0 if any of these happen:

  • memory allocation fails 😭
  • reading the input fails 😭
  • parsing the MIME headers fails 😭
  • there is no content-type header 😭
  • the content type is not text/plain 😭

No in-between, no ambiguous vibe check β€” just 1 or 0, periodt. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

Go read those if you want the whole friend group lore. 🫢

🌈 HISTORY 🌈

SMIME_text() first appeared in OpenSSL 1.0.0 and has been available since OpenBSD 4.9. Respect the veteran status, honestly. πŸ‘‘

πŸŽ€ CAVEATS πŸŽ€

Warning: SMIME_text() does not support non-blocking BIOs. Like, do not try to make it do the non-blocking thing β€” that is not its era, bestie. πŸ™ˆ

xoxo, your Debian bestie πŸ’– β€” June 11, 2025

πŸ“¦ where this page comes from