diff --git a/Developers.mk b/Developers.mk index ff29f86f..97f05ed9 100644 --- a/Developers.mk +++ b/Developers.mk @@ -45,7 +45,7 @@ private-sample: $(PARSERSCRIPT) $(E) @echo @while true; do \ - d=`$(PARSERSCRIPT) -Fjson $(E) | jq -M '.[].smtpagent' | head -1 \ + d=`$(PARSERSCRIPT) -Fjson $(E) | jq -M '.[].decodedby' | head -1 \ | tr '[A-Z]' '[a-z]' | tr -d '-' | sed -e 's/"//g' -e 's/^/lhost-/g'`; \ if [ -d "$(PRIVATEMAILS)/$$d" ]; then \ latestfile=`ls -1 $(PRIVATEMAILS)/$$d/*.$(SAMPLEPREFIX) | tail -1`; \ diff --git a/lib/Sisimai/Fact.pm b/lib/Sisimai/Fact.pm index 0f943e58..508074ef 100644 --- a/lib/Sisimai/Fact.pm +++ b/lib/Sisimai/Fact.pm @@ -35,7 +35,7 @@ use Class::Accessor::Lite ('new' => 0, 'rw' => [ 'replycode', # [String] SMTP Reply Code 'rhost', # [String] Remote host name/Remote MTA 'senderdomain', # [String] The domain part of the "addresser" - 'smtpagent', # [String] Module(Engine) name + 'decodedby', # [String] Module(Engine) name 'smtpcommand', # [String] The last SMTP command 'subject', # [String] UTF-8 Subject text 'timestamp', # [Sisimai::Time] Date: header in the original message @@ -91,7 +91,7 @@ sub rise { 'recipient' => $e->{'recipient'} // '', 'replycode' => $e->{'replycode'} // '', 'rhost' => $e->{'rhost'} // '', - 'smtpagent' => $e->{'agent'} // '', + 'decodedby' => $e->{'agent'} // '', 'smtpcommand' => $e->{'command'} // '', }; @@ -317,7 +317,7 @@ sub rise { my $ar = Sisimai::Address->new({'address' => $piece->{'recipient'}}) || next RISEOF; my @ea = (qw| action deliverystatus diagnosticcode diagnostictype feedbacktype lhost listid - messageid origin reason replycode rhost smtpagent smtpcommand subject + messageid origin reason replycode rhost decodedby smtpcommand subject |); $thing = { @@ -438,7 +438,7 @@ sub damn { my $data = undef; state $stringdata = [qw| action alias catch deliverystatus destination diagnosticcode diagnostictype feedbacktype - lhost listid messageid origin reason replycode rhost senderdomain smtpagent smtpcommand + lhost listid messageid origin reason replycode rhost senderdomain decodedby smtpcommand subject timezoneoffset token |]; @@ -702,11 +702,12 @@ to get the value from C headers. C is the domain part of the sender address. This value is the same as the return value from C method of addresser accessor. -=head2 C (I) +=head2 C (I) -C is a module name to be used for detecting bounce reason. For example, when the value is -C, Sisimai used L to get the recipient address and other delivery -status information from a bounce message. +C is a module name to be used for decoding a bounce message. For example, when the value +is C, Sisimai used L to decode the bounce message, to find the +recipient address, and collect error messages for deciding a bounce reason. +Until v5.2.0, this accessor name was C. =head2 C (I) diff --git a/t/001-sisimai.t b/t/001-sisimai.t index 4ca6669a..7bc526d5 100644 --- a/t/001-sisimai.t +++ b/t/001-sisimai.t @@ -145,7 +145,7 @@ MAKETEST: { DUMP: { my $jsonstring = $Package->dump($Samples->{ $e }); my $perlobject = undef; - my $tobetested = [qw|addresser recipient senderdomain destination reason timestamp token smtpagent origin|]; + my $tobetested = [qw|addresser recipient senderdomain destination reason timestamp token decodedby origin|]; ok length $jsonstring; utf8::encode $jsonstring if utf8::is_utf8 $jsonstring; $perlobject = JSON::decode_json($jsonstring); diff --git a/t/600-lhost-code b/t/600-lhost-code index 2047d43d..4e401b73 100644 --- a/t/600-lhost-code +++ b/t/600-lhost-code @@ -412,10 +412,10 @@ my $moduletest = sub { } } - SMTPAGENT: { - $cv = $rr->smtpagent; + DECODEDBY: { + $cv = $rr->decodedby; $cr = qr/\A[-.0-9A-Za-z]+\z/; - $ct = sprintf("[%s-%02d] ->smtpagent =", $e, $errorindex); + $ct = sprintf("[%s-%02d] ->decodedby =", $e, $errorindex); ok length $cv, sprintf("%s %s", $ct, $cv); if( index($nameprefix, 'rhost') == 0 ) {