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() 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 (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