Skip to content

Commit

Permalink
Tiny variable improvement in Sisimai::Lhost::Postfix
Browse files Browse the repository at this point in the history
  • Loading branch information
azumakuniyuki committed Aug 15, 2024
1 parent ba8aaab commit 32a8e25
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/Sisimai/Lhost/Postfix.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ sub inquire {
my $mhead = shift // return undef;
my $mbody = shift // return undef;
my $match = 0;
my $sessx = 0;

if( index($mhead->{'subject'}, 'SMTP server: errors from ') > 0 ) {
# src/smtpd/smtpd_chat.c:|337: post_mail_fprintf(notice, "Subject: %s SMTP server: errors from %s",
# src/smtpd/smtpd_chat.c:|338: var_mail_name, state->namaddr);
$match++;
$sessx++;
$match = 2;

} else {
# Subject: Undelivered Mail Returned to Sender
$match++ if $mhead->{'subject'} eq 'Undelivered Mail Returned to Sender';
$match = 1 if $mhead->{'subject'} eq 'Undelivered Mail Returned to Sender';
}
return undef if $match == 0;
return undef if $mhead->{'x-aol-ip'};
Expand Down Expand Up @@ -54,7 +53,7 @@ sub inquire {
my $v = undef;
my $p = '';

if( $sessx ) {
if( $match == 2 ) {
# The message body starts with 'Transcript of session follows.'
require Sisimai::SMTP::Transcript;
my $transcript = Sisimai::SMTP::Transcript->rise($emailparts->[0], 'In:', 'Out:');
Expand Down

0 comments on commit 32a8e25

Please sign in to comment.