| 1 | package Sisimai::Rhost::Outlook; | ||||||||||||||||||||
| 2 | 8 | ▶ | use v5.26; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 8 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 8 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 93 | ▶ | sub find { | ||||||||||||||||||
|
Subroutine
find: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||
| 7 | # Detect bounce reason from Microsoft Outlook.com: https://www.outlook.com/ | ||||||||||||||||||||
| 8 | # @param [Sisimai::Fact] argvs Decoded email object | ||||||||||||||||||||
| 9 | # @return [String] The bounce reason for Outlook | ||||||||||||||||||||
| 10 | # @since v5.2.0 | ||||||||||||||||||||
| 11 | 93 | my $class = shift; | |||||||||||||||||||
| 12 | 93 | ▶ | my $argvs = shift // return ""; return '' unless length $argvs->{'diagnosticcode'}; | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
shift() // (return "")
MC/DC100%1/1
shift() // (return "")
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 91 | require Sisimai::Eb; | |||||||||||||||||||
| 15 | 91 | state $messagesof = { | |||||||||||||||||||
| 16 | $Sisimai::Eb::ReHOST => ['The mail could not be delivered to the recipient because the domain is not reachable'], | ||||||||||||||||||||
| 17 | $Sisimai::Eb::ReUSER => ['Requested action not taken: mailbox unavailable'], | ||||||||||||||||||||
| 18 | }; | ||||||||||||||||||||
| 19 | 91 | my $issuedcode = $argvs->{'diagnosticcode'}; | |||||||||||||||||||
| 20 | 91 | my $reasontext = ''; | |||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 91 | for my $e ( keys %$messagesof ) { | |||||||||||||||||||
| 23 | # Try to find the error message matches with the given error message string | ||||||||||||||||||||
| 24 | 167 | ▶ | next unless grep { index($issuedcode, $_) > -1 } $messagesof->{ $e }->@*; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 25 | 22 | $reasontext = $e; | |||||||||||||||||||
| 26 | 22 | last; | |||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | 91 | return $reasontext; | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 8 | 1; | |||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||