Sisimai::RFC2045(3pm)
π 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 aContent-Transfer-Encoding:header whose value is quoted-printable, base64, or 7bit
π AUTHOR π
azumakuniyuki
π COPYRIGHT π
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
- ubuntu stonking: libsisimai-perl 5.7.0-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms