Sisimai/Rhost/MessageLabs.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 4 / 4 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 97.0% 33 / 34 CC 5 SCAR 12.5
CC
5
Cov
100%
find
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.5
« Sisimai/Rhost/Apple.pm ↑ Summary Sisimai/Rhost/Outlook.pm »
1 package Sisimai::Rhost::MessageLabs;
2 5 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 23 ▶sub find {
Subroutine find: called CC=5 SCAR=16.1
Pod undocumented
7 # Detect bounce reason from Email Security (formerly MessageLabs.com)
8 # @param [Sisimai::Fact] argvs Decoded email object
9 # @return [String] The bounce reason for MessageLabs
10 # @since v5.2.0
11 # @see
12 # - https://www.broadcom.com/products/cybersecurity/email
13 # - https://knowledge.broadcom.com/external/article/169652/email-error-and-bounce-codes-for-email-s.html
14 23 my $class = shift;
15 23 ▶ my $argvs = shift // return ""; return '' unless length $argvs->{'diagnosticcode'};
Branch: 1 branch
BranchTrueFalseTotal
unless length $argvs->{"diagnosticcode"} 1 21 22
Condition100%2/2
shift() // (return "")
l!l
221
MC/DC100%1/1
shift() // (return "")
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
16  
17 21 require Sisimai::Eb;
18 21 state $messagesof = {
19 $Sisimai::Eb::ReAUTH => [
20 # - 553 DMARC domain authentication fail
21 # - https://knowledge.broadcom.com/external/article/175407
22 # An email has failed delivery and the reason provided in Track and Trace is due
23 # to SPF Record. 553-SPF (Sender Policy Framework) domain authentication fail.
24 "domain authentication fail",
25 ],
26 $Sisimai::Eb::ReFAMA => [
27 # - https://knowledge.broadcom.com/external/article/164955
28 # "501 Connection rejected by policy [7.7]" 20805, please visit www.messagelabs.com/support
29 # for more details about this error message.
30 # My IP has a negative reputation with Symantec. To check the reputation of a
31 # specific IP address, go to https://ipremoval.sms.symantec.com/.
32 # - https://knowledge.broadcom.com/external/article/384503
33 # Users are receiving a non-delivery receipt (NDR) when sending an email to a
34 # Symantec Email Security.cloud customer:
35 "Connection rejected by policy",
36 ],
37 $Sisimai::Eb::ReBLOC => [
38 # - https://knowledge.broadcom.com/external/article/165165
39 # You are sending an email to a domain protected by the Symantec Email Security.Cloud
40 # service and are receiving a non delivery receipt (NDR) stating the email delivery failed.
41 # 553-mail rejected because your IP is in the PBL. See http://www.spamhaus.org/pbl
42 # - Sorry, your IP address has been blocked
43 # * This error message indicates that your public IP address has been put on a
44 # block list by the Spamhaus PBL block list. To resolve this issue, request to
45 # have your IP removed at http://www.spamhaus.org/pbl/.
46 # * The delisting process is normally quicker than an hour. Once an hour has passed
47 # try to resend your email.
48 # * If the problem persists, contact the recipient by other means (e.g. phone)
49 # and request that your email address is added to their Email Security.cloud
50 # approved sender's list.
51 # - Sorry, your email address (addr) has been blocked
52 # * Check with your administrator or ISP that your mail server is not in open relay.
53 # Search “Open Relay Test” for an independent testing tool. If your mail server
54 # is an open relay, please fix the open relay, wait 24 hours, and then try to
55 # resend your email.
56 # * Check with your administrator or ISP that your IP address is not on any spam
57 # block lists. Search “email blacklist check” to check using an independent tool.
58 # If your IP address is on any block lists, please request for removal, wait 24
59 # hours, and then try to resend your email.
60 # If the problem persists, contact the recipient by other means (e.g. phone) for
61 # further assistance.
62 # - Sorry, your IP address (ip-addr) has been blocked
63 "mail rejected because your IP is in the PBL",
64 "your IP address has been ",
65 "your IP address (ip-addr) has been blocked",
66 "your email address (addr) has been blocked",
67 ],
68 $Sisimai::Eb::ReBODY => [
69 # - 553 Stray linefeeds in message (#5.6.2)
70 # This error message happens because we strictly enforce the Internet Message Format
71 # standard RFC 5322 (and its predecessor RFC 2822) which state, "CR and LF MUST
72 # only occur together as CRLF; they MUST NOT appear independently in the body.
73 "Stray linefeeds in message",
74 ],
75 $Sisimai::Eb::ReTTLS => [
76 # - https://knowledge.broadcom.com/external/article/162152
77 # You are sending to a domain protected by the Symantec Email Security.cloud
78 # service, or you are a customer subscribed to Symantec Email Security.cloud
79 # sending outbound through the service. The Email Security.cloud server responds
80 # to the SMTP RCPT TO: command with "451 TLS/SSLv3 Connection required. (#4.7.1)".
81 # - 451 TLS/SSLv3 Connection required. (#4.7.1)
82 # - Within the ClientNet portal, the Email Track and Trace tool shows "Not Delivered"
83 # in the Delivered column and "Boundary Encryption" in the "Service" column.
84 "TLS/SSLv3 Connection required",
85 ],
86 $Sisimai::Eb::RePASS => [
87 # - https://knowledge.broadcom.com/external/article/162137
88 # You received a Non-Delivery Report (NDR) for email sent through the Symantec
89 # Email Security.cloud infrastructure, with the message "You are trying to use
90 # me [server-X.tower-x.messagelabs.com] as a relay, but I have not been configured
91 # to let you [IP, address] do this."
92 " as a relay, ",
93 ],
94 $Sisimai::Eb::ReNRFC => [
95 # - The format of your message did not comply with RFC 2822.
96 # - Contact your IT administrator or ISP.
97 # - If the problem persists, contact the recipient by other means (e.g. phone).
98 #
99 # - 550 [XX.XX.XX.XX] has detected that this message is not RFC 5322
100 # * Ensure that the message complied to RFC 5322.
101 "550 Requested action aborted [4]",
102 "has detected that this message is not RFC 5322",
103 ],
104 $Sisimai::Eb::ReRATE => [
105 # - https://knowledge.broadcom.com/external/article/385809
106 # Email Security Cloud is attempting to deliver the email and recipient MTA is
107 # responding "452 Too many recipients received this hour".
108 # - https://knowledge.broadcom.com/external/article/164767
109 # This error can occur when sending outbound or inbound emails through Email
110 # Security.Cloud. A non-delivery receipt (NDR) stating delivery contains a message
111 # that the intended recipient has failed with error:
112 # "460 too many messages (#4.3.0)"
113 "Too many recipients received this hour",
114 "too many messages",
115 ],
116 $Sisimai::Eb::ReFROM => [
117 # - 550 sender envelope domain not allowed for sender IP address (#5.1.8)
118 # This error occurs when a sender attempts to send an email and any one of the
119 # following are true:
120 # * The sending domain has not been registered under My Domains or Third-Party Domains.
121 # * The sending domain is inactive.
122 # * The sending IP is not in Outbound Routes.
123 # - 553 Sorry, your domain has been blocked
124 # The error message indicates that your IP address is on the recipient’s private
125 # block list. Contact the recipient and request that your email address is added
126 # to their Email Security.cloud approved sender's list.
127 # - 553 Sorry, your email address has been blocked
128 # The error message indicates that your domain is on the recipient’s private block
129 # list. Contact the recipient by other means (e.g. phone) and request that your
130 # email address is added to their Email Security.cloud approved senders list.
131 # - https://knowledge.broadcom.com/external/article/162232
132 # You have received an email notification from Symantec Email Security.cloud:
133 # * An individual end user account is either sending spam through Symantec Email
134 # Security.cloud or is receiving a bounceback error message indicating they are
135 # on the "badmailfrom" list.
136 # * The error message received is: "553 sorry, your envelope sender is in my
137 # badmailfrom list. Please visit www.symanteccloud.com/troubleshooting for more
138 # details about this error message and instructions to resolve this issue. (#5.7.1)."
139 # - https://knowledge.broadcom.com/external/article/173082
140 # Emails from a sender are blocked by the Anti-Spam service stating that they are
141 # in your company's blacklist.
142 # * 553-Sorry, your email address has been blacklisted
143 # * 553-Sorry, your domain has been blacklisted
144 # * 553-Sorry, your IP address has been blacklisted
145 "sender envelope domain not allowed for sender IP address",
146 "your domain has been blocked",
147 "your email address has been blocked",
148 "your envelope sender is in my badmailfrom list",
149 "your email address has been blacklisted",
150 "your domain has been blacklisted",
151 ],
152 $Sisimai::Eb::ReSAFE => ["Please turn on SMTP Authentication in your mail client"],
153 $Sisimai::Eb::ReSPAM => [
154 # - https://knowledge.broadcom.com/external/article/173867
155 # Legitimate email, either outbound or inbound, is incorrectly flagged as spam
156 # (false positive) by Email Security.cloud. This email may have the following errors:
157 # * 553 - Message Filtered
158 # * filtered by Outbound scanning.
159 "Message Filtered",
160 "filtered by Outbound scanning",
161 ],
162 $Sisimai::Eb::ReUSER => [
163 # - https://knowledge.broadcom.com/external/article/165163
164 # When sending email to a user on the Symantec Email Security.cloud service, the
165 # message is rejected. The sender receives a non-delivery email with a 500 series
166 # error code indicating that the recipient is invalid.
167 # <username@example.com>: 550-Invalid recipient <username@example.com> 550 (#5.1.1)
168 # - 553 Recipient mailbox is not allowed
169 # The error message indicates that you have sent an email to an invalid address
170 # in the recipient’s domain. Double-check the email address for any spelling errors.
171 # - https://knowledge.broadcom.com/external/article/175710
172 # This error indicates that you have sent an email to an invalid address to the
173 # recipient’s domain. "Recipient mailbox is not allowed"
174 "No such user",
175 "Invalid recipient",
176 "mailbox is not allowed",
177 "Recipient mailbox is not allowed",
178 ],
179 };
180 21 my $issuedcode = $argvs->{'diagnosticcode'};
181 21 my $reasontext = '';
182  
183 21 for my $e ( keys %$messagesof ) {
184 # Try to find the error message matches with the given error message string
185 168 ▶ next unless grep { index($issuedcode, $_) > -1 } $messagesof->{ $e }->@*;
Branch: 1 branch
BranchTrueFalseTotal
unless grep {index($issuedcode, $_) != -1;} @{$$messagesof{$e}} 155 13 168
186 13 $reasontext = $e;
187 13 last;
188 }
189 21 return $reasontext;
190 }
191  
192 5 1;
193 __END__
« Sisimai/Rhost/Apple.pm ↑ Summary Sisimai/Rhost/Outlook.pm »