Skip to content

Commit

Permalink
Tiny code improvement in Sisimai::Lhost::IMailServer
Browse files Browse the repository at this point in the history
  • Loading branch information
azumakuniyuki committed May 16, 2023
1 parent 2c9fa80 commit 001fd1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Sisimai/Lhost/IMailServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ sub inquire {
# Original message follows.
$v = $dscontents->[-1];

if( index($e, ': ') > 8 && Sisimai::String->aligned(\$e, [': ', '@']) ) {
my $p0 = index($e, ': ');
if( $p0 > 8 && Sisimai::String->aligned(\$e, [': ', '@']) ) {
# Unknown user: kijitora@example.com
if( $v->{'recipient'} ) {
# There are multiple recipient addresses in the message body.
push @$dscontents, __PACKAGE__->DELIVERYSTATUS;
$v = $dscontents->[-1];
}
$v->{'diagnosis'} = $e;
$v->{'recipient'} = Sisimai::Address->s3s4(substr($e, rindex($e, ': ') + 2));
$v->{'recipient'} = Sisimai::Address->s3s4(substr($e, $p0 + 2));
$recipients++;

} elsif( index($e, 'undeliverable ') == 0 ) {
Expand Down

0 comments on commit 001fd1d

Please sign in to comment.