| 1 | package Sisimai::Rhost::Cloudflare; | ||||||||||||||||||||
| 2 | 3 | ▶ | use v5.26; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 10 | ▶ | sub find { | ||||||||||||||||||
|
Subroutine
find: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||
| 7 | # Detect bounce reason for Cloudflare Email Routing | ||||||||||||||||||||
| 8 | # @param [Sisimai::Fact] argvs Decoded email object | ||||||||||||||||||||
| 9 | # @return [String] Detected bounce reason | ||||||||||||||||||||
| 10 | # @since v5.2.1 | ||||||||||||||||||||
| 11 | # @see https://developers.cloudflare.com/email-routing/postmaster/ | ||||||||||||||||||||
| 12 | 10 | my $class = shift; | |||||||||||||||||||
| 13 | 10 | ▶ | my $argvs = shift // return ""; return "" unless $argvs->{'diagnosticcode'}; | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
shift() // (return "")
MC/DC100%1/1
shift() // (return "")
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 8 | require Sisimai::Eb; | |||||||||||||||||||
| 16 | 8 | state $messagesof = { | |||||||||||||||||||
| 17 | # - 554 <YOUR_IP_ADDRESS> found on one or more RBLs (abusixip). Refer to | ||||||||||||||||||||
| 18 | # https://developers.cloudflare.com/email-routing/postmaster/#spam-and-abusive-traffic/ | ||||||||||||||||||||
| 19 | $Sisimai::Eb::ReBLOC => ["found on one or more DNSBLs"], | ||||||||||||||||||||
| 20 | $Sisimai::Eb::RePROC => ["Upstream error"], | ||||||||||||||||||||
| 21 | }; | ||||||||||||||||||||
| 22 | 8 | for my $e ( keys %$messagesof ) { | |||||||||||||||||||
| 23 | # Try to find the error message matches with the given error message string | ||||||||||||||||||||
| 24 | 14 | ▶ | return $e if grep { index($argvs->{"diagnosticcode"}, $_) > -1 } $messagesof->{ $e }->@*; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | 2 | return ""; | |||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 3 | 1; | |||||||||||||||||||
| 30 | __END__ | ||||||||||||||||||||