Sisima...l::Mbox(3pm)

🌸 NAME 🌸

okay so first things first, bestie β€” this is the manual page for Sisima...l::Mbox(3pm), straight out of the User Contributed Perl Documentation collection, and it's about Sisimai::Mail::Mbox β€” a literal mailbox reader πŸ’Œ

No cap, that's the whole vibe: it reads mailboxes. Let's get into it 🫢


✨ SYNOPSIS ✨

here's the tea, the whole thing in like four lines:

use Sisimai::Mail::Mbox;
my $mailbox = Sisimai::Mail::Mbox->new('/var/spool/mail/root');
while( my $r = $mailbox->read ) {
    print $r;   # print contents of each mail in mbox
}

see how it just… loops and prints every mail in the mbox? iconic behavior honestly πŸ‘‘


🌈 DESCRIPTION 🌈

Sisimai::Mail::Mbox is a mailbox file (UNIX mbox) reader. that's it, that's the description β€” it opens up a UNIX mbox file and reads the mail out of it, one message at a time, no drama πŸ’…


πŸŽ€ CLASS METHODS πŸŽ€

new(path to mbox)

new() is the constructor of Sisimai::Mail::Mbox β€” you hand it a path to an mbox and it hands you back your very own mailbox object, like a little gift 🎁

my $mailbox = Sisimai::Mail::Mbox->new('/var/mail/root');

πŸ¦‹ INSTANCE METHODS πŸ¦‹

dir()

dir() gives you the directory name of the UNIX mbox. just the folder, not the file, kay?

print $mailbox->dir;   # /var/mail

path()

path() returns the path to the mbox. the whole entire address of it, folder + filename πŸ’–

print $mailbox->path;   # /var/mail/root

file()

file() returns the file name of the mbox. just the name part, no folder, no nothing ✨

print $mailbox->file;   # root

size()

size() returns the file size of the mbox. how many bytes we're working with, bestie πŸ“

print $mailbox->size;   # 94515

offset()

offset() returns the offset position for seeking the mbox. the value of offset is a bytes which have already read β€” like a little bookmark showing how far into the file you've already gotten 🎯

print $mailbox->offset;   # 0

handle()

handle() returns the file handle object IO::File of the mbox. so if you wanna do file-handle things yourself, it's right there for you 🫢

$mailbox->handle->close;

read()

read() works as an iterator for reading each email in the mbox. it just keeps handing you the next one until there's none left, main character energy fr fr ✨

my $mailbox = Sisimai::Mail->new('/var/mail/neko');
while( my $r = $mailbox->read ) {
    print $r;   # print each email in /var/mail/neko
}
side note bestie: the example above literally says Sisimai::Mail->new('/var/mail/neko') β€” that's what's written, so that's what you get. copy it character for character, no editing the homework πŸ’€

πŸ’œ AUTHOR πŸ’œ

azumakuniyuki


Copyright (C) 2014-2016,2018,2019,2021,2024,2025 azumakuniyuki, All rights reserved.


πŸ‘‘ LICENSE πŸ‘‘

This software is distributed under The BSD 2-Clause License. slay, permissive licensing, we love to see it πŸŽ€


and that's the whole page, bestie!! this was Sisima...l::Mbox(3pm) from perl v5.40.1, dated 2026-07-05 β€” go read some mbox files, you've got this πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from