Sisimai::RFC2045(3pm)

πŸ“¦
version 5.7.0 Β· 4 versions
, in ubuntu stonking

πŸ’– Sisimai::RFC2045 β€” MIME Utilities πŸ’–

okay bestie, welcome to Sisimai::RFC2045, the MIME utility module from the Sisimai family ✨ she used to go by the name Sisimai::MIME back in the day, but she rebranded and honestly? the glow-up ate πŸ’…


✨ SYNOPSIS ✨

use Sisimai::RFC2045;

my $e = '=?utf-8?B?55m954yr44Gr44KD44KT44GT?=';
my $v = Sisimai::RFC2045->is_encoded(\$e);
print $v;   # 1

my $x = Sisimai::RFC2045->decodeH([$e]);
print $x;

like… she's just out here decoding MIME-encoded chaos into readable text. no big deal. πŸ¦‹


🌸 DESCRIPTION 🌸

Sisimai::RFC2045 is the MIME Utilities module for Sisimai. and no cap, she is formerly known as Sisimai::MIME β€” same girl, new name, same energy. πŸ’–


πŸ‘‘ CLASS METHODS πŸ‘‘

⭐ is_encoded(Scalar Reference)

the is_encoded() method tells you whether the thing you handed her is a MIME-Encoded string or not. that's it, that's the whole vibe check πŸ”₯

my $e = '=?utf-8?B?55m954yr44Gr44KD44KT44GT?=';
my $v = Sisimai::RFC2045->is_encoded(\$e);  # 1

⭐ decodeH(Array-Ref)

decodeH() is the decoding method that gets you the original string back out of the MIME-Encoded string sitting in the email headers. give her an array-ref, she gives you truth 🫢

my $r = '=?utf-8?B?55m954yr44Gr44KD44KT44GT?=';
my $v = Sisimai::RFC2045->decodeH([$r]);

⭐ decodeB(\String)

decodeB is the decoding method that recovers the original string from a string that was encoded with MIME Base64. yes queen, we're un-base64-ing πŸ’…

my $r = '44Gr44KD44O844KT';
my $v = Sisimai::RFC2045->decodeB(\$r);

⭐ decodeQ(\String)

decodeQ is the decoding method that recovers the original string from a string encoded with MIME quoted-printable. the =4e=65=6b=6f girlies know 😌

my $r = '=4e=65=6b=6f';
my $v = Sisimai::RFC2045->decodeQ(\$r);

⭐ parameter(String, String)

parameter() returns you the value of a parameter found in the Content-Type: header. pass in the header and the parameter name, get the goodies ✨

my $r = 'Content-Type: multipart/mixed; boundary=Apple-Mail-1-526612466'; charset=utf8;
print Sisimai::RFC2045->parameter($r, 'charset');  # utf8
print Sisimai::RFC2045->parameter($r, 'boundary'); # Apple-Mail-1-526612466
print Sisimai::RFC2045->parameter($r);             # multipart/mixed

⭐ boundary(String, Integer)

boundary() pulls the boundary string out of the value of a Content-Type: header. so useful. so iconic. πŸŽ€

my $r = 'Content-Type: multipart/mixed; boundary=Apple-Mail-1-526612466';
my $v = Sisimai::RFC2045->boundary($r);
print $v;   # Apple-Mail-1-526612466

print Sisimai::RFC2045->boundary($r, 0); # --Apple-Mail-1-526612466
print Sisimai::RFC2045->boundary($r, 1); # --Apple-Mail-1-526612466--

⭐ haircut(\String, Boolean)

haircut() trims off the unused headers from inside the multipart/* block. she's giving her a little trim, a little refresh, a little self-care moment πŸ’‡β€β™€οΈβœ‚οΈ

⭐ levelout(String, \String)

levelout breaks the multipart/* message block down into each individual part and hands you back an array reference. structure? we have it πŸ™ˆ

⭐ makeflat(String, \String)

makeflat makes a flat multipart/* message. here's what she actually does, no skimping:

  • breaks the multipart/* block into each part
  • removes the parts you don't need to decode the bounce message β€” think image/* MIME types, bye πŸ‘‹
  • decodes the encoded text part (text/*, message/*) in the body of each part that has a Content-Transfer-Encoding: header whose value is quoted-printable, base64, or 7bit

πŸ’œ AUTHOR πŸ’œ

azumakuniyuki

Copyright (C) 2014-2016,2018-2026 azumakuniyuki, All rights reserved.

🌈 LICENSE 🌈

This software is distributed under The BSD 2-Clause License.


okay that's the whole page, bestie 🧚✨ this is Sisimai::RFC2045, documented for perl v5.40.1 and dated 2026-07-05 β€” mwah, go decode something gorgeous πŸ’‹πŸ’–

πŸ“¦ where this page comes from