GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Sisimai::Mail::Memory(3) User Contributed Perl Documentation Sisimai::Mail::Memory(3)

Sisimai::Mail::Memory - Mailbox reader

    use Sisimai::Mail::Memory;
    my $mailtxt = 'From Mailer-Daemon ...';
    my $mailobj = Sisimai::Mail::Memory->new(\$mailtxt);
    while( my $r = $mailobj->read ) {
        print $r;   # print contents of each mail in the mailbox or Maildir/
    }

"Sisimai::Mail::Memory" is a class for reading a mailbox, files in Maildir/ from the value of the specified variable.

new() method is a constructor of "Sisimai::Mail::Memory"

    my $mailtxt = 'From Mailer-Daemon ...';
    my $mailobj = Sisimai::Mail::Memory->new(\$mailtxt);

path() method returns a fixed string ""<MEMORY"">

    print $mailbox->path;   # "<MEMORY>"

size() method returns a memory size of the mailbox

    print $mailobj->size;   # 94515

payload() method returns an array reference to each email message

    print scalar $mailobj->payload->@*; # 17

offset() method returns the offset position for seeking "payload" list. The value of "offset" is an index number which have already read.

    print $mailobj->offset;   # 0

read() method works as an iterator for reading each email in the mailbox.

    my $mailtxt = 'From Mailer-Daemon ...';
    my $mailobj = Sisimai::Mail->new(\$mailtxt);
    while( my $r = $mailobj->read ) {
        print $r;   # print each email in the first argument of new().
    }

azumakuniyuki

Copyright (C) 2018-2022,2024 azumakuniyuki, All rights reserved.

This software is distributed under The BSD 2-Clause License.

2025-03-28 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.