| 1 | package Sisimai::Reason::NotAccept; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 55 | ▶ | use v5.26; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 55 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 55 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 55 | ▶ | use Sisimai::Eb; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 26 | ▶ | sub text { $Sisimai::Eb::Re00MX } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
text: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 4 | ▶ | sub description { 'Delivery failed due to a destination mail server does not accept any email' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 1074 | ▶ | sub match { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
match: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | # Try to match that the given text and regular expressions | ||||||||||||||||||||||||||||||||||||||||||
| 11 | # @param [String] argv1 String to be matched with regular expressions | ||||||||||||||||||||||||||||||||||||||||||
| 12 | # @return [Integer] 0: Did not match | ||||||||||||||||||||||||||||||||||||||||||
| 13 | # 1: Matched | ||||||||||||||||||||||||||||||||||||||||||
| 14 | # @since v4.0.0 | ||||||||||||||||||||||||||||||||||||||||||
| 15 | 1074 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 1074 | ▶ | my $argv1 = shift // return 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
shift() // (return 0)
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | # Destination mail server does not accept any message | ||||||||||||||||||||||||||||||||||||||||||
| 19 | 1073 | state $index = [ | |||||||||||||||||||||||||||||||||||||||||
| 20 | "destination seem to reject all mails", # OpenSMTPD/smtp/mta.c | ||||||||||||||||||||||||||||||||||||||||||
| 21 | "does not accept mail", # Sendmail, iCloud | ||||||||||||||||||||||||||||||||||||||||||
| 22 | "mail receiving disabled", | ||||||||||||||||||||||||||||||||||||||||||
| 23 | "mx or srv record indicated no smtp ", # Exim/routers/dnslookup.c:328 | ||||||||||||||||||||||||||||||||||||||||||
| 24 | "name server: .: host not found", # Sendmail | ||||||||||||||||||||||||||||||||||||||||||
| 25 | "no host found for existing smtp ", # Exim/transports/smtp.c:3502 | ||||||||||||||||||||||||||||||||||||||||||
| 26 | "no route for current request", | ||||||||||||||||||||||||||||||||||||||||||
| 27 | "null mx", | ||||||||||||||||||||||||||||||||||||||||||
| 28 | ]; | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 1073 | state $pairs = [ | |||||||||||||||||||||||||||||||||||||||||
| 30 | ["no mx ", "found for "], # OpenSMTPD/smtp/mta.c | ||||||||||||||||||||||||||||||||||||||||||
| 31 | ]; | ||||||||||||||||||||||||||||||||||||||||||
| 32 | 1073 | ▶ | return 1 if grep { rindex($argv1, $_) > -1 } @$index; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | 1060 | ▶ | return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 1050 | return 0; | |||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 641 | ▶ | sub true { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
true: called CC=7 SCAR=19.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | # Remote host does not accept any message | ||||||||||||||||||||||||||||||||||||||||||
| 39 | # @param [Sisimai::Fact] argvs Object to be detected the reason | ||||||||||||||||||||||||||||||||||||||||||
| 40 | # @return [Integer] 1: Not accept | ||||||||||||||||||||||||||||||||||||||||||
| 41 | # 0: Accept | ||||||||||||||||||||||||||||||||||||||||||
| 42 | # @since v4.0.0 | ||||||||||||||||||||||||||||||||||||||||||
| 43 | # @see http://www.ietf.org/rfc/rfc2822.txt | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 641 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 45 | 641 | ▶ | my $argvs = shift // return 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
shift() // (return 0)
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | 640 | ▶ | my $reply = $argvs->{'replycode'} || 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$argvs->{'replycode'} || 0
MC/DC100%1/1
$argvs->{'replycode'} || 0
$argvs->{'replycode'}
Truth table100%2/2
A
A= $argvs->{'replycode'}
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | # SMTP Reply Code is 521, 554 or 556 | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 640 | require Sisimai::SMTP::Command; | |||||||||||||||||||||||||||||||||||||||||
| 50 | 640 | ▶ | return 1 if $argvs->{'reason'} eq $Sisimai::Eb::Re00MX || $reply == 521 || $reply == 556; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$argvs->{"reason"} eq $Sisimai::Eb::Re00MX or $reply == 521 or $reply == 556
$argvs->{"reason"} eq $Sisimai::Eb::Re00MX or $reply == 521
MC/DC66%2/3
$argvs->{"reason"} eq $Sisimai::Eb::Re00MX or $reply == 521 or $reply == 556
$argvs->{"reason"} eq $Sisimai::Eb::Re00MX
$reply == 521
$reply == 556
Truth table75%3/4
A or B or C
A= $argvs->{"reason"} eq $Sisimai::Eb::Re00MXB= $reply == 521C= $reply == 556
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | 634 | ▶ | return 0 if grep { $argvs->{'command'} eq $_ } Sisimai::SMTP::Command->BeforeRCPT->@*; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | 558 | return __PACKAGE__->match(lc $argvs->{'diagnosticcode'}); | |||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | 55 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 56 | __END__ | ||||||||||||||||||||||||||||||||||||||||||