Sisimai::Mail(3pm)
π Sisimai::Mail(3pm) π
User Contributed Perl Documentation β¨ welcome to the Sisimai::Mail situation bestie, this is the perl manual page and we're gonna read it together, no skimming, I promise π
πΈ NAME πΈ
Sisimai::Mail</purgle> β handler of Mbox/Maildir for reading each mail. That's it, that's the whole job, she reads your mail files one email at a time and she does it flawlessly π
β¨ SYNOPSIS β¨
okay so here's how you actually use her, three whole vibes:
use Sisimai::Mail;
my $mailbox = Sisimai::Mail->new('/var/mail/root');
while( my $r = $mailbox->read ) {
print $r;
}
my $maildir = Sisimai::Mail->new('/home/neko/Maildir/cur');
while( my $r = $maildir->read ) {
print $r;
}
my $mailtxt = 'From Mailer-Daemon ...';
my $mailobj = Sisimai::Mail->new(\$mailtxt);
while( my $r = $mailobj->read ) {
print $r;
}
like. look at her go. mbox, Maildir, and even a raw string reference β she does not care, she serves π
π¦ DESCRIPTION π¦
okay so Sisimai::Mail is a handler for reading a UNIX mbox, a Maildir, or any email message input from the STDIN variable. It's a wrapper class of the following child classes, which is very "I have a whole friend group and they all do their own thing" of her:
Sisimai::Mail::MboxSisimai::Mail::MaildirSisimai::Mail::STDINSisimai::Mail::Memory
she's basically the group chat admin of these four, no cap π«Ά
π CLASS METHODS π
π« new(path to mbox|Maildir/)
so new() method is a constructor of Sisimai::Mail β it's giving "let me introduce you to my main character" energy β¨
my $mailbox = Sisimai::Mail->new('/var/mail/root');
my $maildir = Sisimai::Mail->new('/home/nyaa/Maildir/cur');
my $mailtxt = 'From Mailer-Daemon ...';
my $mailobj = Sisimai::Mail->new(\$mailtxt);
yup, three ways to summon her: a path to an mbox, a path to a Maildir, or a reference to a string of raw mail text π
π INSTANCE METHODS π
π path()
path() method returns the path to the mbox or the Maildir. she knows where she came from, iconic behavior honestly π
print $mailbox->path; # /var/mail/root
π kind()
kind() method returns the name of the data type. a little vibe check for your mailbox π¦
print $mailbox->kind; # mailbox or maildir, stdin, or memory.
β mail()
mail() method returns the Sisimai::Mail::Mbox object or the Sisimai::Mail::Maildir object. it's literally handing you the actual worker bee behind the wrapper π
my $o = $mailbox->mail;
print ref $o; # Sisimai::Mail::Mbox
π₯ read()
read() method works as an iterator for reading each email in the mbox or the Maildir. It calls Sisimai::Mail::Mbox-"read()> or Sisimai::Mail::Maildir-"read> methods.
bestie pay attention: this is the one you'll call in a while loop forever, it's the whole reason she exists π
my $mailbox = Sisimai::Mail->new('/var/mail/neko');
while( my $r = $mailbox->read ) {
print $r; # print each email in /var/mail/neko
}
slay. one email at a time. periodt π
π AUTHOR π
azumakuniyuki β the legend themselves π
π§ COPYRIGHT π§
Copyright (C) 2014-2016,2018-2021,2024,2025 azumakuniyuki, All rights reserved.
π LICENSE π
This software is distributed under The BSD 2-Clause License.
and that's the whole page bestie!! π this was brought to you by perl v5.40.1, dated 2026-07-05, from the Sisimai::Mail(3pm) corner of the manual β mwah, ily, go read your mail πβ¨π¦
π¦ 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