| 1 | package Sisimai::Reason::RequirePTR; | ||||||||||||||||||||
| 2 | 51 | ▶ | use v5.26; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 51 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 51 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 51 | ▶ | use Sisimai::Eb; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 51 | ▶ | use Sisimai::String; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 92 | ▶ | sub text { $Sisimai::Eb::ReQPTR } | ||||||||||||||||||
|
Subroutine
text: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 9 | 4 | ▶ | sub description { 'Email rejected due to missing PTR record or having invalid PTR record' } | ||||||||||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 10 | 1152 | ▶ | sub match { | ||||||||||||||||||
|
Subroutine
match: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||
| 11 | # Try to match that the given text and regular expressions | ||||||||||||||||||||
| 12 | # @param [String] argv1 String to be matched with regular expressions | ||||||||||||||||||||
| 13 | # @return [Integer] 0: Did not match | ||||||||||||||||||||
| 14 | # 1: Matched | ||||||||||||||||||||
| 15 | # @since v5.0.0 | ||||||||||||||||||||
| 16 | 1152 | my $class = shift; | |||||||||||||||||||
| 17 | 1152 | ▶ | 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()
| |||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 1151 | state $index = [ | |||||||||||||||||||
| 20 | "cannot find your hostname", | ||||||||||||||||||||
| 21 | "cannot resolve your address.", | ||||||||||||||||||||
| 22 | "corresponding forward dns entry does not point to the sending ip", # Google | ||||||||||||||||||||
| 23 | "ip name lookup failed", | ||||||||||||||||||||
| 24 | "no matches to nameserver query", | ||||||||||||||||||||
| 25 | "ptr lookup failure", | ||||||||||||||||||||
| 26 | "sender ip reverse lookup rejected", | ||||||||||||||||||||
| 27 | "unresolvable relay host name", | ||||||||||||||||||||
| 28 | ]; | ||||||||||||||||||||
| 29 | 1151 | state $pairs = [ | |||||||||||||||||||
| 30 | ["domain "," mismatches client ip"], | ||||||||||||||||||||
| 31 | ["domain name verification on your ip address ", "failed"], | ||||||||||||||||||||
| 32 | ["dns lookup failure: ", " try again later"], | ||||||||||||||||||||
| 33 | ["ptr", "record"], | ||||||||||||||||||||
| 34 | ["reverse", " dns"], | ||||||||||||||||||||
| 35 | ["server access ", " forbidden by invalid rdns record of your mail server"], | ||||||||||||||||||||
| 36 | ["service permits ", " unverifyable sending ips"], | ||||||||||||||||||||
| 37 | ]; | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 1151 | ▶ | return 1 if grep { rindex($argv1, $_) > -1 } @$index; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 40 | 1140 | ▶ | return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 41 | 1064 | return 0; | |||||||||||||||||||
| 42 | } | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 1158 | ▶ | sub true { | ||||||||||||||||||
|
Subroutine
true: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||
| 45 | # Rejected due to missing PTR record or having invalid PTR record | ||||||||||||||||||||
| 46 | # @param [Sisimai::Fact] argvs Object to be detected the reason | ||||||||||||||||||||
| 47 | # @return [Integer] 1: is missing PTR or invalid PTR | ||||||||||||||||||||
| 48 | # [Integer] 0: is not blocked due to missing PTR record | ||||||||||||||||||||
| 49 | # @see http://www.ietf.org/rfc/rfc2822.txt | ||||||||||||||||||||
| 50 | # @since v5.0.0 | ||||||||||||||||||||
| 51 | 1158 | my $class = shift; | |||||||||||||||||||
| 52 | 1158 | ▶ | 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()
| |||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 1157 | ▶ | return 1 if $argvs->{'reason'} eq $Sisimai::Eb::ReQPTR; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 55 | 1156 | ▶ | return 1 if (Sisimai::SMTP::Status->name($argvs->{'deliverystatus'}) || '') eq $Sisimai::Eb::ReQPTR; | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'}) || ''
MC/DC100%1/1
'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'}) || ''
'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'})
Truth table100%2/2
A
A= 'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'})
| |||||||||||||||||||||
| 56 | 1146 | return __PACKAGE__->match(lc $argvs->{'diagnosticcode'}); | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 51 | 1; | |||||||||||||||||||
| 60 | __END__ | ||||||||||||||||||||