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::Message(3) User Contributed Perl Documentation Sisimai::Message(3)

Sisimai::Message - Converts the bounce email text to the data structure.

    use Sisimai::Mail;
    use Sisimai::Message;
    my $mailbox = Sisimai::Mail->new('/var/mail/root');
    while( my $r = $mailbox->read ) {
        my $p = Sisimai::Message->rise('data' => $r);
    }
    my $notmail = '/home/neko/Maildir/cur/22222';       # is not a bounce email
    my $mailobj = Sisimai::Mail->new($notmail);
    while( my $r = $mailobj->read ) {
        my $p = Sisimai::Message->rise('data' => $r);   # $p is "undef"
    }

"Sisimai::Message" converts the bounce email text to the data structure. It resolves the email text into the UNIX From line, the header part of the mail, the delivery status, and RFC822 header part lines. When the email given as a argument of new() method is not a bounce email, the method returns "undef".

"rise(Hash reference)"

rise() method is a constructor of "Sisimai::Message"

    my $mailtxt = 'Entire email text';
    my $message = Sisimai::Message->rise('data' => $mailtxt);

If you have implemented a custom MTA module and use it, set the value of "load" in the argument of this method as an array reference like following code:

    my $message = Sisimai::Message->rise(
                        'data' => $mailtxt,
                        'load' => ['Your::Custom::MTA::Module']
                  );

from() method returns the UNIX From line of the email.

    print $message->from;

header() method returns the header part of the email.

    print $message->header->{'subject'};    # Returned mail: see transcript for details

ds() method returns an array reference which include contents of the delivery status.

    for my $e ( $message->ds->@* ) {
        print $e->{'status'};   # 5.1.1
        print $e->{'recipient'};# neko@example.jp
    }

rfc822() method returns a hash reference which include the header part of the original message.

    print $message->rfc822->{'from'};   # cat@example.com
    print $message->rfc822->{'to'};     # neko@example.jp

catch() method returns any data generated by user-defined method passed at the "c___" argument of new() constructor.

azumakuniyuki

Copyright (C) 2014-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.