Sisimai/Rhost/Zoho.pm

filter: Statementstmt 100% 19 / 19 Branchbran 100% 4 / 4 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 96.7% 30 / 31 CC 5 SCAR 12.5
CC
5
Cov
100%
find
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.5
« Sisimai/Rhost/Cloudflare.pm ↑ Summary Sisimai/Rhost/KDDI.pm »
1 package Sisimai::Rhost::Zoho;
2 7 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 59 ▶sub find {
Subroutine find: called CC=5 SCAR=16.1
Pod undocumented
7 # Detect bounce reason from Zoho Mail
8 # @param [Sisimai::Fact] argvs Decoded email object
9 # @return [String] The bounce reason for Zoho
10 # @see
11 # @since v5.5.0
12 # - Zoho Mail: https://www.zoho.com/mail/
13 # - Reasons an email is marked as Spam: https://www.zoho.com/mail/help/spam-reason.html
14 # - https://github.com/zoho/zohodesk-oas/blob/main/v1.0/EmailFailureAlert.json
15 # - Zoho SMTP Error Codes | SMTP Field Manual: https://smtpfieldmanual.com/provider/zoho
16 59 my $class = shift;
17 59 ▶ my $argvs = shift // return ""; return '' unless length $argvs->{'diagnosticcode'};
Branch: 1 branch
BranchTrueFalseTotal
unless length $argvs->{"diagnosticcode"} 1 57 58
Condition100%2/2
shift() // (return "")
l!l
581
MC/DC100%1/1
shift() // (return "")
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
18  
19 57 require Sisimai::Eb;
20 57 state $messagesof = {
21 $Sisimai::Eb::ReAUTH => [
22 # - <*******@zoho.com>: host smtpin.zoho.com[204.141.33.23] said: 550 5.7.1 Email
23 # rejected per DMARC policy for zoho.com
24 "Email rejected per DMARC policy",
25 ],
26 $Sisimai::Eb::ReBLOC => [
27 # - mx.zoho.com[204.141.33.44]:25, delay=1202, delays=1200/0/0.91/0.30, dsn=4.7.1,
28 # status=deferred (host mx.zoho.com[204.141.33.44] said:
29 # 451 4.7.1 Greylisted, try again after some time (in reply to RCPT TO command))
30 "Greylisted, try again after some time",
31 ],
32 $Sisimai::Eb::ReFROM => [
33 # - <*******@zoho.com>: host smtpin.zoho.com[204.141.33.23] said: 554 5.7.1 Email
34 # cannot be delivered. Reason: Email flagged as Spam. (in reply to RCPT TO command)
35 # - <***@zoho.com>: host mx.zoho.com[136.143.183.44] said: 541 5.4.1 Mail rejected
36 # by destination domain (in reply to RCPT TO command)
37 "Email cannot be delivered. Reason: Email flagged as Spam",
38 "Mail rejected by destination domain",
39 ],
40 $Sisimai::Eb::ReWONT => [
41 # - <*******@zoho.com>: host smtpin.zoho.com[204.141.33.23] said: 554 5.7.7 Email
42 # policy violation detected (in reply to end of DATA command)
43 "Email policy violation detected",
44 "Mailbox delivery restricted by policy error",
45 ],
46 $Sisimai::Eb::RePROC => [
47 # - https://github.com/zoho/zohodesk-oas/blob/main/v1.0/EmailFailureAlert.json#L168
48 # 452 4.3.1 Temporary System Error
49 "Temporary System Error",
50 ],
51 $Sisimai::Eb::ReUSER => [
52 # - <*******@zoho.com>: host smtpin.zoho.com[204.141.33.23] said:
53 # 550 5.1.1 User does not exist - <***@zoho.com> (in reply to RCPT TO command)
54 # - 552 5.1.1 <****@zoho.com> Mailbox delivery failure policy error
55 "User does not exist",
56 ],
57 $Sisimai::Eb::ReEXEC => [
58 # - 552 5.7.1 virus **** detected by Zoho Mail
59 " detected by Zoho Mail",
60 ],
61 };
62  
63 57 for my $e ( keys %$messagesof ) {
64 # Try to find the error message matches with the given error message string
65 296 ▶ next unless grep { index($argvs->{'diagnosticcode'}, $_) > -1 } $messagesof->{ $e }->@*;
Branch: 1 branch
BranchTrueFalseTotal
unless grep {index($argvs->{"diagnosticcode"}, $_) != -1;} @{$$messagesof{$e}} 267 29 296
66 29 return $e;
67 }
68 28 return "";
69 }
70  
71 7 1;
72 __END__
« Sisimai/Rhost/Cloudflare.pm ↑ Summary Sisimai/Rhost/KDDI.pm »