Sisimai::Mail::Maildir - Mailbox reader
use Sisimai::Mail::Maildir; my $maildir = Sisimai::Mail::Maildir->new('/home/neko/Maildir/new'); while( my $r = $maildir->read ) { print $r; # print contents of the mail in the Maildir/ }
Sisimai::Mail::Maildir is a reader for getting contents of each email in the Maildir/ directory.
new(path to Maildir/)
new() is a constructor of Sisimai::Mail::Maildir
new()
my $maildir = Sisimai::Mail::Maildir->new('/home/neko/Maildir/new');
dir()
dir() returns the path to Maildir/
print $maildir->dir; # /home/neko/Maildir/new/
path()
path() returns the path to each email in Maildir/
print $maildir->path; # /home/neko/Maildir/new/1.eml
file()
file() returns current file name of the Maildir.
print $maildir->file;
files()
inodes() returns i-node list of each email in Maildir.
inodes()
print for @{ $maildir->inodes };
handle()
handle() returns file handle object (IO::Dir) of the Maildir.
$maildir->handle->close;
read()
read() works as a iterator for reading each email in the Maildir.
my $maildir = Sisimai::Mail->new('/home/neko/Maildir/new'); while( my $r = $mailbox->read ) { print $r; # print each email in /home/neko/Maildir/new }
azumakuniyuki
Copyright (C) 2014-2016,2018 azumakuniyuki, All rights reserved.
This software is distributed under The BSD 2-Clause License.
To install Sisimai, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sisimai
CPAN shell
perl -MCPAN -e shell install Sisimai
For more information on module installation, please visit the detailed CPAN module installation guide.