Sisimai::Message(3pm)
π Sisimai::Message β the perl manpage but make it cute
okay bestie, gather round, because we're about to talk about Sisimai::Message(3pm) from the User Contributed Perl Documentation collection π this little icon does one thing and does it flawlessly: it turns a bounce email's raw text into an actual data structure you can work with. no cap. that's the whole job. slay.
πΈ NAME πΈ
Sisimai::Message β converts the bounce email text to the data structure. that's it. that's the girl. π
β¨ SYNOPSIS β¨
okay so here's how you actually use her, and yes we're keeping every single line exactly as it is because accuracy is the moment:
use Sisimai::Mail;
use Sisimai::Message;
my $mailbox = Sisimai::Mail->new('/var/mail/root');
while( my $r = $mailbox->read ) {
my $p = Sisimai::Message->rise('data' => $r);
}
my $notmail = '/home/neko/Maildir/cur/22222'; # is not a bounce email
my $mailobj = Sisimai::Mail->new($notmail);
while( my $r = $mailobj->read ) {
my $p = Sisimai::Message->rise('data' => $r); # $p is "undef"
}
see that second example? not a bounce email, so $p comes back as undef. she's not gonna fake it for you, she's gonna tell you the truth. iconic behavior π
π¦ DESCRIPTION π¦
Sisimai::Message converts the bounce email text to the data structure, periodt. she takes that messy email text and resolves it into:
- the UNIX From line
- the header part of the mail
- the delivery status
- the RFC822 header part lines
and here's the vibe check that matters: if the email you handed to the new() method is not a bounce email, the method returns undef. no drama, no half-answers, just undef. π
π CLASS METHODS π
rise(Hash reference)
rise() is the constructor of Sisimai::Message. she's the one who shows up first and gets everything going, main character energy fr fr.
my $mailtxt = 'Entire email text';
my $message = Sisimai::Message->rise('data' => $mailtxt);
π INSTANCE METHODS π
(from)
from() hands you the UNIX From line of the email. that's the tea. π«
print $message->from;
header()
header() gives you the header part of the email, all wrapped up for you.
print $message->header->{'subject'}; # Returned mail: see transcript for details
ds()
ds() returns an array reference stuffed with the contents of the delivery status. loop it, love it, live it.
for my $e ( $message->ds->@* ) {
print $e->{'status'}; # 5.1.1
print $e->{'recipient'};# neko@example.jp
}
rfc822()
rfc822() returns a hash reference which includes the header part of the original message. yes, the og message. she keeps receipts. π¬
print $message->rfc822->{'from'}; # cat@example.com
print $message->rfc822->{'to'}; # neko@example.jp
catch()
catch() returns any data generated by a user-defined method that you passed in at the c___ argument of the new() constructor. that's the chaos you brought yourself, and she respects it. π
lowkey important: catch() is all about your custom method. whatever it made, you get back. no extra filtering, no surprises.
π AUTHOR π
azumakuniyuki β the legend herself, the blueprint, the moment. π
π COPYRIGHT π
Copyright (C) 2014-2026 azumakuniyuki, All rights reserved.
that's a long run bestie, we love longevity π
π LICENSE π
This software is distributed under The BSD 2-Clause License.
and that's the whole manpage, no crumbs left behind π§ ok bye ily, go parse some bounce emails and slay β¨
β from the perl v5.40.1 build, dated 2026-07-05, filed under Sisimai::Message(3pm) π mwah π
π¦ 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