Data Structure of Sisimai::Data

make() method of Sisimai method returns an array reference including parsed data as a Sisimai::Data object. The object has the following accessors.

Read More
A

Action (String)

"action" is the value of Action: field in a bounce email message such as "failed" or "delayed".

Action: failed
                

Addresser (Sisimai::Address)

"addressser" is a Sisimai::Address object generated from the sender address. When Sisimai::Data object is dumped as JSON, this value converted to an email address. Sisimai::Address object has the following accessors:

  • user() - The local part of the address
  • host() - The domain part of the address
  • address() - Email address
  • verp() - Variable envelope return path
  • alias() - Alias of the address
  • name() - Display name (v4.22.1 or later)
  • comment() - Comment (v4.22.1 or later)
From: "Kijitora Cat" <kijitora@example.org>
                

alias (String)

"alias" is an alias address of the recipient. When the Original-Recipient: field or "expanded from …" string  did not exist in a bounce message, this value is empty.

Original-Recipient: rfc822;kijitora@example.org
                
"|IFS=' ' && exec /usr/local/bin/procmail -f- || exit 75 #kijitora"
(expanded from: <kijitora@neko.example.edu>)
                
C

catch (*) | Beginning with v4.17.0

"catch" keeps the value returned from a hook method given as the 2nd argument of make() method of Sisimai. The value is undef in Perl, is nil in Ruby when a hook method was not specified.

Callback, hook method, and catch() method are implemented at Sisimai 4.19.0.

#! /usr/bin/env perl
my $f = './set-of-emails/maildir/bsd/email-sendmail-24.eml';
my $x = sub {
    my $argv = shift;
    my $data = { 'x-mailer' => '' };

    if( $argv->{'message'} =~ m/^X-Mailer:\s*(.+)$/m ) {
        $data->{'x-mailer'} = $1;
    }
    return $data;   # $data is the value of "catch"
};
my $v = Sisimai->make($f, 'hook' => $x);
for my $e ( @$v ) {
    print ref $e->catch;            # HASH
    print $e->catch->{'x-mailer'};  # Apple Mail
}
                
D

deliverystatus (String)

"deliverystatus" is the value of Status: field in a bounce message. When the message has no Status: field, Sisimai set pseudo value like 5.0.9XX to this value. The range of values only "2.x.x", "4.x.x" or "5.x.x".

Status: 5.0.0 (permanent failure)
                

destination (String)

"destination" is the domain part of the recipient address. This value is the same as the return value from host() method of "recipient" accessor.


diagnosticcode (String)

"diagnosticcode" is an error message picked from Diagnostic-Code: field or message body in a bounce message. This value and the value of "diagnostictype", "action", "deliverystatus", "replycode", and "smtpcommand" will be referred in Sisimai::Reason class to decide a bounce reason.

Diagnostic-Code: SMTP; 554 5.4.6 Too many hops
                

diagnostictype (String)

"diagnostictype" is a type like "SMTP" or "X-Unix" picked from Diagnostic-Code: field in a bounce message. When there is no Diagnostic-Code: field in the bounce message, this value will be empty.

Diagnostic-Code: X-Unix; 255
                
F

feedbacktype (String)

"feedbacktype" is the value of Feedback-Type: field like "abuse", "fraud", "opt-out" in a bounce message. When the message is not ARF format or the value of "reason" is not "feedback", this value will be empty.

Content-Type: message/feedback-report

Feedback-Type: abuse
User-Agent: SMP-FBL
                
L

lhost (String)

"lhost" is a local MTA name to be used as a gateway for sending email messages or the value of the Reporting-MTA field in a bounce message. When there is no Reporting-MTA field in the bounce message, Sisimai try to get the value from Received header.

Reporting-MTA: dns; mx4.smtp.example.co.jp
                

listid (String)

"listid" is the value of the List-Id header of the original message. When there is no List-Id field in the original message or the bounce message did not include the original message, this value will be empty.

List-Id: Mailman mailing list management users 
                
M

messageid (String)

"messageid" is the value of the Message-Id header of the original message. When the original message did not include Message-Id: header or the bounce message did not include the original message, this value will be empty.

Message-Id: <201310160515.r9G5FZh9018575@smtpgw.example.jp>
                
R

reason (String)

"reason" is the value of bounce reason Sisimai detected. When this value is "undefined" or "onhold", it means that Sisimai could not decide the reason. All the reasons Sisismai can detect are available at the Bounce Reason List page.

   ----- The following addresses had permanent fatal errors -----

    (reason: 550 5.1.1 Requested action not taken: mailbox unavailable)

   ----- Transcript of session follows -----
... while talking to inbound-smtp.us-west-2.amazonaws.com.:
>>> RCPT To:
<<< 550 5.1.1 Requested action not taken: mailbox unavailable
550 5.1.1 ... User unknown
>>> DATA
<<< 503 Error: need RCPT command
                

recipient (Sisimai::Address)

"recipient" is Sisimai::Address object generated from the recipient address. When Sisimai::Data object is dumped as JSON, this value converted to an email address. Sisimai::Address object have the following accessors:

  • user() - the local part of the address
  • host() - the domain part of the address
  • address() - email address
  • verp() - variable envelope return path
  • alias() - alias of the address
  • name() - Display name (v4.22.1 or later)
  • comment() - Comment (v4.22.1 or later)
Final-Recipient: RFC822; shironeko@example.ne.jp
                
X-Failed-Recipients: kijitora@example.ed.jp
                

replycode (String)

"replyacode" is the value of SMTP reply code picked from the error message or the value of Diagnostic-Code: field in a bounce message. The range of values is only 4xx or 5xx.

----- The following addresses had permanent fatal errors -----

(reason: 550 5.1.1 ... User Unknown)
                

rhost (String)

"rhost" is a remote MTA name which has rejected the message you sent or the value of Remote-MTA: field in a bounce message. When there is no Remote-MTA field in the bounce message, Sisimai try to get the value from Received header.

Remote-MTA: DNS; g5.example.net
                
S

senderdomain (String)

"senderdomain" is the domain part of the sender address. This value is the same as the return value from host() method of addresser accessor.


smtpagent (String)

"smtpagent" is a module name to be used for detecting bounce reason. For example, when the value is "Email::Sendmail", Sisimai used Sisimai::Bite::Email::Sendmail to get the recipient address and other delivery status information from a bounce message.


smtpcommand (String)

"smtpcommand" is an SMTP command name picked from the error message or the value of Diagnostic-Code: field in a bounce message. When there is no SMTP command in the bounce message, this value will be empty. The list of values below.

  • HELO
  • EHLO
  • MAIL
  • RCPT
  • DATA
: host mx1.example.go.jp[192.0.2.127] said: 550 5.1.6 recipient
no longer on server: kijitora@example.go.jp (in reply to RCPT TO command)                        
                

softbounce (Integer)

The value of "softbounce" indicates whether the reason of the bounce is soft bounce or hard bounce. This accessor has added in Sisimai 4.1.28. The range of the values is the followings:

  • 1 = Soft bounce
  • 0 = Hard bounce
  • -1 = Sisimai could not decide

subject (String)

"subject" is the value of the Subject header of the original message. When the original message which is included in a bounce email contains no Subject header (removed by remote MTA), this value will be empty. If the value of the Subject header of the original message contains any multibyte character (non ASCII character), such as MIME encoded Japanese or German and so on, the value of the subject in parsed data is encoded with UTF-8 again.

T

timestamp (Sisimai::Time)

"timestamp" is the date which email has bounced as a Sisima::Time (Child class of Perl/Time::Piece or Ruby/DateTime) object. When Sisimai::Data object is dumped as JSON, this value will be converted to a UNIX machine time (32 bit integer).

Arrival-Date: Thu, 29 Apr 2009 23:45:33 +0900
                

timezoneoffset (String)

"timezoneoffset" is a time zone offset of a bounce email which its email has bounced. The format of this value is a String like "+0900", "-0200". If Sisimai has failed to get a value of the timezone offset, this value will be set as "+0000".

Remote-MTA: DNS; g5.example.net
                

token (String)

"token" is an identifier of each email-bounce. The token string is created from the sender email address(addresser) and the recipient's email address(recipient) and the machine time of the date in a bounce message as an MD5 hash value. The token value is generated at token() method of Sisimai::String class. If you want to get the same token string at the command line, try to run the following command:

% printf "\x02%s\x1e%s\x1e%d\x03" sender@example.jp recipient@example.org `date '+%s'` | md5
714d72dfd972242ad04f8053267e7365