Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Sisimai::Mail::Memory(User Contributed Perl DocumentatSisimai::Mail::Memory(3)

NAME
       Sisimai::Mail::Memory - Mailbox reader

SYNOPSIS
	   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/
	   }

DESCRIPTION
       Sisimai::Mail::Memory is	a class	for reading a mailbox, files in
       Maildir/, or JSON string	from variable.

CLASS METHODS
   "new(\$scalar)"
       "new()" is a constructor	of Sisimai::Mail::Memory

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

INSTANCE METHODS
   "path()"
       "path()"	returns	"<MEMORY>"

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

   "size()"
       "size()"	returns	a memory size of the mailbox or	JSON string.

	   print $mailobj->size;   # 94515

   "payload()"
       "payload()" returns an array reference to each email message or JSON
       string

	   print scalar	@{ $mailobj->payload };	  # 17

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

	   print $mailobj->offset;   # 0

   "read()"
       "read()"	works as a 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().
	   }

AUTHOR
       azumakuniyuki

COPYRIGHT
       Copyright (C) 2018-2020 azumakuniyuki, All rights reserved.

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

perl v5.32.0			  2020-07-17	      Sisimai::Mail::Memory(3)

NAME | SYNOPSIS | DESCRIPTION | CLASS METHODS | INSTANCE METHODS | AUTHOR | COPYRIGHT | LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Sisimai::Mail::Memory&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help