Sisimai/SMTP/Status.pm

filter: Statementstmt 99.3% 142 / 143 Branchbran 87.7% 93 / 106 Conditioncond 85.7% 78 / 91 MC/DCmcdc 75.0% 39 / 52 Subroutinesub 100% 14 / 14 Podpod 100% 7 / 7 totaltotal 90.3% 373 / 413 CC 97 SCAR 33.6
CC
97
Cov
92%
find
45.1
prefer
32.8
test
12.0
CRAP 28.8
« Sisimai/RFC3834.pm ↑ Summary Sisimai/Lhost/Gmail.pm »
1 package Sisimai::SMTP::Status;
2 93 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 93 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 93 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 93 ▶use Sisimai::Eb;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 93 ▶use Sisimai::RFC791;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # http://www.iana.org/assignments/smtp-enhanced-status-codes/smtp-enhanced-status-codes.xhtml
9 # -------------------------------------------------------------------------------------------------
10 # [Class Sub-Codes]
11 # 2.X.Y Success
12 # 4.X.Y Persistent Transient Failure
13 # 5.X.Y Permanent Failure
14 #
15 # -------------------------------------------------------------------------------------------------
16 # [Subject Sub-Codes]
17 # X.0.X --- Other or Undefined Status
18 # There is no additional subject information available.
19 #
20 # X.1.X --- Addressing Status
21 # The address status reports on the originator or destination address. It may include
22 # address syntax or validity. These errors can generally be corrected by the sender and
23 # retried.
24 #
25 # X.2.X --- Mailbox Status
26 # Mailbox status indicates that something having to do with the mailbox has caused this
27 # DSN. Mailbox issues are assumed to be under the general control of the recipient.
28 #
29 # X.3.X --- Mail System Status
30 # Mail system status indicates that something having to do with the destination system
31 # has caused this DSN. System issues are assumed to be under the general control of the
32 # destination system administrator.
33 #
34 # X.4.X --- Network and Routing Status
35 # The networking or routing codes report status about the delivery system itself. These
36 # system components include any necessary infrastructure such as directory and routing
37 # services. Network issues are assumed to be under the control of the destination or
38 # intermediate system administrator.
39 #
40 # X.5.X --- Mail Delivery Protocol Status
41 # The mail delivery protocol status codes report failures involving the message delivery
42 # protocol. These failures include the full range of problems resulting from
43 # implementation errors or an unreliable connection.
44 #
45 # X.6.X --- Message Content or Media Status
46 # The message content or media status codes report failures involving the content of the
47 # message. These codes report failures due to translation, transcoding, or otherwise
48 # unsupported message media. Message content or media issues are under the control of both
49 # the sender and the receiver, both of which must support a common set of supported
50 # content-types.
51 #
52 # X.7.X --- Security or Policy Status
53 # The security or policy status codes report failures involving policies such as
54 # per-recipient or per-host filtering and cryptographic operations. Security and policy
55 # status issues are assumed to be under the control of either or both the sender and
56 # recipient. Both the sender and recipient must permit the exchange of messages and
57 # arrange the exchange of necessary keys and certificates for cryptographic operations.
58 #
59 # -------------------------------------------------------------------------------------------------
60 # [Enumerated Status Codes]
61 # X.0.0 Any Other undefined Status:(RFC 3463)
62 # Other undefined status is the only undefined error code. It should be used for all
63 # errors for which only the class of the error is known.
64 #
65 # X.1.0 --- Other address status:(RFC 3463)
66 # Something about the address specified in the message caused this DSN.
67 #
68 # X.1.1 451 Bad destination mailbox address:(RFC3463)
69 # 550 The mailbox specified in the address does not exist. For Internet mail names, this
70 # means the address portion to the the left of the "@" sign is invalid. This code is
71 # only useful for permanent failures.
72 #
73 # X.1.2 --- Bad destination system addres:
74 # The destination system specified in the address does not exist or is incapable of
75 # accepting mail. For Internet mail names, this means the address portion to the
76 # right of the "@" is invalid for mail. This code is only useful for permanent
77 # failures.
78 #
79 # X.1.3 501 Bad destination mailbox address syntax:
80 # The destination address was syntactically invalid. This can apply to any field in
81 # the address. This code is only useful for permanent failures.
82 #
83 # X.1.4 --- Destination mailbox address ambiguous:(RFC 3463)
84 # The mailbox address as specified matches one or more recipients on the destination
85 # system. This may result if a heuristic address mapping algorithm is used to map
86 # the specified address to a local mailbox name.
87 #
88 # X.1.5 250 Destination address valid:(RFC 3463)
89 # This mailbox address as specified was valid. This status code should be used for
90 # positive delivery reports.
91 #
92 # X.1.6 --- Destination mailbox has moved, No forwarding address:(RFC 3463)
93 # The mailbox address provided was at one time valid, but mail is no longer being
94 # accepted for that address. This code is only useful for permanent failures.
95 #
96 # X.1.7 --- Bad sender's mailbox address syntax:(RFC 3463)
97 # The sender's address was syntactically invalid. This can apply to any field in
98 # the address.
99 #
100 # X.1.8 451 Bad sender's system address:(RFC 3463)
101 # 501 The sender's system specified in the address does not exist or is incapable of
102 # accepting return mail. For domain names, this means the address portion to the
103 # right of the "@" is invalid for mail.
104 #
105 # X.1.9 --- Message relayed to non-compliant mailer:(RFC 5248, 3886)
106 # The mailbox address specified was valid, but the message has been relayed to a
107 # system that does not speak this protocol; no further information can be provided.
108 #
109 # X.1.10 --- Recipient address has null MX:(RFC 7505)
110 # This status code is returned when the associated address is marked as invalid
111 # using a null MX.
112 # -------------------------------------------------------------------------------------------------
113 # X.2.0 --- Other or undefined mailbox status:(RFC 3463)
114 # The mailbox exists, but something about the destination mailbox has caused the
115 # sending of this DSN.
116 #
117 # X.2.1 --- Mailbox disabled, not accepting messages:(RFC 3463)
118 # The mailbox exists, but is not accepting messages. This may be a permanent error
119 # if the mailbox will never be re-enabled or a transient error if the mailbox is
120 # only temporarily disabled.
121 #
122 # X.2.2 552 Mailbox full:(RFC 3463)
123 # The mailbox is full because the user has exceeded a per-mailbox administrative
124 # quota or physical capacity. The general semantics implies that the recipient can
125 # delete messages to make more space available. This code should be used as a
126 # persistent transient failure.
127 #
128 # X.2.3 552 Message length exceeds administrative limit:(RFC 3463)
129 # A per-mailbox administrative message length limit has been exceeded. This status
130 # code should be used when the per-mailbox message length limit is less than the
131 # general system limit. This code should be used as a permanent failure.
132 #
133 # X.2.4 450 Mailing list expansion problem:(RFC 3463)
134 # 452 The mailbox is a mailing list address and the mailing list was unable to be
135 # expanded. This code may represent a permanent failure or a persistent transient
136 # failure.
137 # -------------------------------------------------------------------------------------------------
138 # X.3.0 221 Other or undefined mail system status:(RFC 3463)
139 # 250 The destination system exists and normally accepts mail, but something about the
140 # 421,451 system has caused the generation of this DSN.
141 # 550,554
142 #
143 # X.3.1 452 Mail system full:(RFC 3463)
144 # Mail system storage has been exceeded. The general semantics imply that the
145 # individual recipient may not be able to delete material to make room for
146 # additional messages. This is useful only as a persistent transient error.
147 #
148 # X.3.2 453 System not accepting network messages:(RFC 3463)
149 # 521 The host on which the mailbox is resident is not accepting messages. Examples of
150 # such conditions include an imminent shutdown, excessive load, or system
151 # maintenance. This is useful for both permanent and persistent transient errors.
152 #
153 # X.3.3 --- System not capable of selected features:(RFC 3463)
154 # Selected features specified for the message are not supported by the destination
155 # system. This can occur in gateways when features from one domain cannot be mapped
156 # onto the supported feature in another.
157 #
158 # X.3.4 552 Message too big for system:(RFC 3463)
159 # 554 The message is larger than per-message size limit. This limit may either be for
160 # physical or administrative reasons. This is useful only as a permanent error.
161 #
162 # X.3.5 --- System incorrectly configured:(RFC 3463)
163 # The system is not configured in a manner that will permit it to accept this
164 # message.
165 #
166 # X.3.6 250 Requested priority was changed:(RFC 6710)
167 # 251 The message was accepted for relay/delivery, but the requested priority (possibly
168 # the implied default) was not honored. The human readable text after the status
169 # code contains the new priority, followed by SP (space) and explanatory human
170 # readable text.
171 # -------------------------------------------------------------------------------------------------
172 # X.4.0 --- Other or undefined network or routing status:(RFC 3463)
173 # Something went wrong with the networking, but it is not clear what the problem is,
174 # or the problem cannot be well expressed with any of the other provided detail
175 # codes.
176 #
177 # X.4.1 451 No answer from host:(RFC 3463)
178 # The outbound connection attempt was not answered, because either the remote system
179 # was busy, or was unable to take a call. This is useful only as a persistent
180 # transient error.
181 #
182 # X.4.2 421 Bad connection:(RFC 3463)
183 # The outbound connection was established, but was unable to complete the message
184 # transaction, either because of time-out, or inadequate connection quality. This
185 # is useful only as a persistent transient error.
186 #
187 # X.4.3 451 Directory server failure:(RFC 3463)
188 # 550 The network system was unable to forward the message, because a directory server
189 # was unavailable. This is useful only as a persistent transient error. The
190 # inability to connect to an Internet DNS server is one example of the directory
191 # server failure error.
192 #
193 # X.4.4 --- Unable to route:(RFC 3463)
194 # The mail system was unable to determine the next hop for the message because the
195 # necessary routing information was unavailable from the directory server. This is
196 # useful for both permanent and persistent transient errors. A DNS lookup returning
197 # only an SOA (Start of Administration) record for a domain name is one example of
198 # the unable to route error.
199 #
200 # X.4.5 451 Mail system congestion:(RFC 3463)
201 # The mail system was unable to deliver the message because the mail system was
202 # congested. This is useful only as a persistent transient error.
203 #
204 # X.4.6 --- Routing loop detected:(RFC 3463)
205 # A routing loop caused the message to be forwarded too many times, either because
206 # of incorrect routing tables or a user-forwarding loop. This is useful only as a
207 # persistent transient error.
208 #
209 # X.4.7 --- Delivery time expired:(RFC 3463)
210 # The message was considered too old by the rejecting system, either because it
211 # remained on that host too long or because the time-to-live value specified by the
212 # sender of the message was exceeded. If possible, the code for the actual problem
213 # found when delivery was attempted should be returned rather than this code.
214 #
215 # X.4.8 421 Retry on IPv4
216 # 451 the mail system will not accept this message over IPv6 because it lacks some re-
217 # 456 quirments described in the full text of the rejection, however the sending mail
218 # system can retry immediately to submit the message over IPv4 only.
219 # https://datatracker.ietf.org/doc/html/draft-martin-smtp-ipv6-to-ipv4-fallback-00
220 #
221 # -------------------------------------------------------------------------------------------------
222 # X.5.0 220 Other or undefined protocol status:(RFC 3463)
223 # 250-253 Something was wrong with the protocol necessary to deliver the message to the next
224 # 451,452 hop and the problem cannot be well expressed with any of the other provided detail
225 # 454,458 codes.
226 # 459,554
227 # 501-503
228 #
229 # X.5.1 430 Invalid command:(RFC 3463)
230 # 500,501 A mail transaction protocol command was issued which was either out of sequence
231 # 503,530 or unsupported. This is useful only as a permanent error.
232 # 550,554
233 # 555
234 #
235 # X.5.2 500 Syntax error:(RFC 3463)
236 # 500,501 A mail transaction protocol command was issued which could not be interpreted,
237 # 502,550 either because the syntax was wrong or the command is unrecognized. This is useful
238 # 555 only as a permanent error.
239 #
240 # X.5.3 451 Too many recipients:(RFC 3463)
241 # More recipients were specified for the message than could have been delivered by
242 # the protocol. This error should normally result in the segmentation of the message
243 # into two, the remainder of the recipients to be delivered on a subsequent delivery
244 # attempt. It is included in this list in the event that such segmentation is not
245 # possible.
246 #
247 # X.5.4 451 Invalid command arguments:(RFC 3463)
248 # 501-504 A valid mail transaction protocol command was issued with invalid arguments,
249 # 550 either because the arguments were out of range or represented unrecognized
250 # 555 features. This is useful only as a permanent error.
251 #
252 # X.5.5 --- Wrong protocol version:(RFC 3463)
253 # A protocol version mis-match existed which could not be automatically resolved by
254 # the communicating parties.
255 #
256 # X.5.6 550 Authentication Exchange line is too long (RFC 4954)
257 # This enhanced status code SHOULD be returned when the server fails the AUTH
258 # command due to the client sending a [BASE64] response which is longer than the
259 # maximum buffer size available for the currently selected SASL mechanism. This is
260 # useful for both permanent and persistent transient errors.
261 # -------------------------------------------------------------------------------------------------
262 # X.6.0 --- Other or undefined media error:(RFC 3463)
263 # Something about the content of a message caused it to be considered undeliverable
264 # and the problem cannot be well expressed with any of the other provided detail
265 # codes.
266 #
267 # X.6.1 --- Media not supported:(RFC 3463)
268 # The media of the message is not supported by either the delivery protocol or the
269 # next system in the forwarding path. This is useful only as a permanent error.
270 #
271 # X.6.2 --- Conversion required and prohibited:(RFC 3463)
272 # The content of the message must be converted before it can be delivered and such
273 # conversion is not permitted. Such prohibitions may be the expression of the sender
274 # in the message itself or the policy of the sending host.
275 #
276 # X.6.3 554 Conversion required but not supported:(RFC 3463)
277 # The message content must be converted in order to be forwarded but such conversion
278 # is not possible or is not practical by a host in the forwarding path. This
279 # condition may result when an ESMTP gateway supports 8bit transport but is not able
280 # to downgrade the message to 7 bit as required for the next hop.
281 #
282 # X.6.4 250 Conversion with loss performed:(RFC 3463)
283 # This is a warning sent to the sender when message delivery was successfully but
284 # when the delivery required a conversion in which some data was lost. This may also
285 # be a permanent error if the sender has indicated that conversion with loss is
286 # prohibited for the message.
287 #
288 # X.6.5 --- Conversion Failed:(RFC 3463)
289 # A conversion was required but was unsuccessful. This may be useful as a permanent
290 # or persistent temporary notification.
291 #
292 # X.6.6 554 Message content not available (RFC 4468)
293 # The message content could not be fetched from a remote system. This may be useful
294 # as a permanent or persistent temporary notification.
295 #
296 # X.6.7 553 The ALT-ADDRESS is required but not specified:(RFC 6531)
297 # 550 This indicates the reception of a MAIL or RCPT command that non-ASCII addresses
298 # are not permitted
299 #
300 # X.6.8 252 UTF-8 string reply is required, but not permitted by the client:(RFC 6531)
301 # 553 This indicates that a reply containing a UTF-8 string is required to show the
302 # 550 mailbox name, but that form of response is not permitted by the SMTP client.
303 #
304 # X.6.9 550 UTF8SMTP downgrade failed:(RFC 6531)
305 # This indicates that transaction failed after the final "." of the DATA command.
306 #
307 # X.6.10 This is a duplicate of X.6.8 and is thus deprecated.
308 # -------------------------------------------------------------------------------------------------
309 # X.7.0 220 Other or undefined security status:(RFC 3463)
310 # 235 Something related to security caused the message to be returned, and the problem
311 # 450,454 cannot be well expressed with any of the other provided detail codes. This status
312 # 500,501 code may also be used when the condition cannot be further described because of
313 # 503,504 security policies in force.
314 # 530,535
315 # 550
316 #
317 # X.7.1 451 Delivery not authorized, message refused:(RFC 3463)
318 # 454,502 The sender is not authorized to send to the destination. This can be the result
319 # 503,533 of per-host or per-recipient filtering. This memo does not discuss the merits of
320 # 550,551 any such filtering, but provides a mechanism to report such. This is useful only
321 # as a permanent error.
322 #
323 # X.7.2 550 Mailing list expansion prohibited:(RFC 3463)
324 # The sender is not authorized to send a message to the intended mailing list. This
325 # is useful only as a permanent error.
326 #
327 # X.7.3 --- Security conversion required but not possible:(RFC 3463)
328 # A conversion from one secure messaging protocol to another was required for
329 # delivery and such conversion was not possible. This is useful only as a permanent
330 # error.
331 #
332 # X.7.4 504 Security features not supported:(RFC 3463)
333 # A message contained security features such as secure authentication that could not
334 # be supported on the delivery protocol. This is useful only as a permanent error.
335 #
336 # X.7.5 --- Cryptographic failure:(RFC 3463)
337 # A transport system otherwise authorized to validate or decrypt a message in
338 # transport was unable to do so because necessary information such as key was not
339 # available or such information was invalid.
340 #
341 # X.7.6 --- Cryptographic algorithm not supported:(RFC 3463)
342 # A transport system otherwise authorized to validate or decrypt a message was
343 # unable to do so because the necessary algorithm was not supported.
344  
345 # X.7.7 --- Message integrity failure:(RFC 3463)
346 # A transport system otherwise authorized to validate a message was unable to do so
347 # because the message was corrupted or altered. This may be useful as a permanent,
348 # transient persistent, or successful delivery code.
349 #
350 # X.7.8 535 Trust relationship required:(RFC 4954)
351 # 554 This response to the AUTH command indicates that the authentication failed due to
352 # invalid or insufficient authentication credentials. In this case, the client
353 # SHOULD ask the user to supply new credentials (such as by presenting a password
354 # dialog box).
355 #
356 # X.7.9 534 Authentication mechanism is too weak:(RFC 4954)
357 # This response to the AUTH command indicates that the selected authentication
358 # mechanism is weaker than server policy permits for that user. The client SHOULD
359 # retry with a new authentication mechanism.
360 #
361 # X.7.10 523 Encryption Needed:(RFC 5248)
362 # This indicates that external strong privacy layer is needed in order to use the
363 # requested authentication mechanism. This is primarily intended for use with clear
364 # text authentication mechanisms. A client which receives this may activate a
365 # security layer such as TLS prior to authenticating, or attempt to use a stronger
366 # mechanism.
367 #
368 # X.7.11 524 Encryption required for requested authentication mechanism:(RFC 4954)
369 # 538 This response to the AUTH command indicates that the selected authentication
370 # mechanism may only be used when the underlying SMTP connection is encrypted. Note
371 # that this response code is documented here for historical purposes only. Modern
372 # implementations SHOULD NOT advertise mechanisms that are not permitted due to lack
373 # of encryption, unless an encryption layer of sufficient strength is currently
374 # being employed.
375 #
376 # X.7.12 422 A password transition is needed:(RFC 4954)
377 # 432 This response to the AUTH command indicates that the user needs to transition to
378 # the selected authentication mechanism. This is typically done by authenticating
379 # once using the [PLAIN] authentication mechanism. The selected mechanism SHOULD
380 # then work for authentications in subsequent sessions.
381 #
382 # X.7.13 525 User Account Disabled:(RFC 5248)
383 # Sometimes a system administrator will have to disable a user's account (e.g., due
384 # to lack of payment, abuse, evidence of a break-in attempt, etc). This error code
385 # occurs after a successful authentication to a disabled account. This informs the
386 # client that the failure is permanent until the user contacts their system
387 # administrator to get the account re-enabled. It differs from a generic
388 # authentication failure where the client's best option is to present the passphrase
389 # entry dialog in case the user simply mistyped their passphrase.
390 #
391 # X.7.14 535 Trust relationship required:(RFC 5248)
392 # 554 The submission server requires a configured trust relationship with a third-party
393 # server in order to access the message content. This value replaces the prior use
394 # of X.7.8 for this error condition. thereby updating [RFC4468].
395 #
396 # X.7.15 450 Priority Level is too low:(RFC6710)
397 # 550 The specified priority level is below the lowest priority acceptable for the
398 # 4xx receiving SMTP server. This condition might be temporary, for example the server
399 # 5xx is operating in a mode where only higher priority messages are accepted for
400 # transfer and delivery, while lower priority messages are rejected.
401 #
402 # X.7.16 552 Message is too big for the specified priority:(RFC 6710)
403 # 4xx The message is too big for the specified priority. This condition might be
404 # 5xx temporary, for example the server is operating in a mode where only higher
405 # priority messages below certain size are accepted for transfer and delivery.
406 #
407 # X.7.17 5xx Mailbox owner has changed:(RFC 7293)
408 # This status code is returned when a message is received with a
409 # Require-Recipient-Valid-Since field or RRVS extension and the receiving system is
410 # able to determine that the intended recipient mailbox has not been under
411 # continuous ownership since the specified date-time.
412 #
413 # X.7.18 5xx Domain owner has changed:(RFC 7293)
414 # This status code is returned when a message is received with a
415 # Require-Recipient-Valid-Since field or RRVS extension and the receiving system
416 # wishes to disclose that the owner of the domain name of the recipient has changed
417 # since the specified date-time.
418 #
419 # X.7.19 5xx RRVS test cannot be completed:(RFC 7293)
420 # This status code is returned when a message is received with a
421 # Require-Recipient-Valid-Since field or RRVS extension and the receiving system
422 # cannot complete the requested evaluation because the required timestamp was not
423 # recorded. The message originator needs to decide whether to reissue the message
424 # without RRVS protection.
425 #
426 # X.7.20 550 No passing DKIM signature found:(RFC 7372)
427 # This status code is returned when a message did not contain any passing DKIM
428 # signatures. (This violates the advice of Section 6.1 of [RFC6376].)
429 #
430 # X.7.21 550 No acceptable DKIM signature found:(RFC 7372, 6476)
431 # This status code is returned when a message contains one or more passing DKIM
432 # signatures, but none are acceptable. (This violates the advice of Section 6.1 of
433 # [RFC6376].)
434 #
435 # X.7.22 550 No valid author-matched DKIM signature found:(RFC 7372)
436 # This status code is returned when a message contains one or more passing DKIM
437 # signatures, but none are acceptable because none have an identifier(s) that
438 # matches the author address(es) found in the From header field. This is a special
439 # case of X.7.21. (This violates the advice of Section 6.1 of [RFC6376].)
440 #
441 # X.7.23 550 SPF validation failed:(RFC 7273, 7208)
442 # This status code is returned when a message completed an SPF check that produced
443 # a "fail" result, contrary to local policy requirements. Used in place of 5.7.1 as
444 # described in Section 8.4 of [RFC7208].
445 #
446 # X.7.24 451 SPF validation error:(RFC 7372, 7208)
447 # 550 This status code is returned when evaluation of SPF relative to an arriving
448 # message resulted in an error. Used in place of 4.4.3 or 5.5.2 as described in
449 # Sections 8.6 and 8.7 of [RFC7208].
450 #
451 # X.7.25 550 Reverse DNS validation failed:(RFC 7372, 7601)
452 # This status code is returned when an SMTP client's IP address failed a reverse
453 # DNS validation check, contrary to local policy requirements.
454 #
455 # X.7.26 550 Multiple authentication checks failed:(RFC 7372)
456 # This status code is returned when a message failed more than one message
457 # authentication check, contrary to local policy requirements. The particular
458 # mechanisms that failed are not specified.
459 #
460 # X.7.27 550 Sender address has null MX:(RFC 7505)
461 # This status code is returned when the associated sender address has a null MX,
462 # and the SMTP receiver is configured to reject mail from such sender
463 # (e.g., because it could not return a DSN).
464 # -------------------------------------------------------------------------------------------------
465 # SAMPLES
466 # 554 5.5.0 No recipients have been specified
467 # 503 5.5.0 Valid RCPT TO required before BURL
468 # 554 5.6.3 Conversion required but not supported
469 # 554 5.3.4 Message too big for system
470 # 554 5.7.8 URL resolution requires trust relationship
471 # 552 5.2.2 Mailbox full
472 # 554 5.6.6 IMAP URL resolution failed
473 # 250 2.5.0 Waiting for additional BURL or BDAT commands
474 # 451 4.4.1 IMAP server unavailable
475 # 250 2.5.0 Ok.
476 # 250 2.6.4 MIME header conversion with loss performed
477 # 235 2.7.0 Authentication Succeeded
478 # 432 4.7.12 A password transition is needed
479 # 454 4.7.0 Temporary authentication failure
480 # 534 5.7.9 Authentication mechanism is too weak
481 # 535 5.7.8 Authentication credentials invalid
482 # 500 5.5.6 Authentication Exchange line is too long
483 # 530 5.7.0 Authentication required
484 # 538 5.7.11 Encryption required for requested authentication
485 # 5.7.8 Authentication credentials invalid
486 # 5.7.9 Authentication mechanism is too weak
487 # 5.7.11 Encryption required for requested authentication mechanism
488 # -------------------------------------------------------------------------------------------------
489 93 ▶use constant StandardCode => {
Subroutine BEGIN: called CC=1 SCAR=0.0
490 '2.1.5' => $Sisimai::Eb::ReSENT, # Successfully delivered
491 # ---------------------------------------------------------------------------------------------
492 '4.1.6' => $Sisimai::Eb::ReMOVE, # Destination mailbox has moved, No forwarding address
493 '4.1.7' => $Sisimai::Eb::ReFROM, # Bad sender's mailbox address syntax
494 '4.1.8' => $Sisimai::Eb::ReFROM, # Bad sender's system address
495 '4.1.9' => $Sisimai::Eb::RePROC, # Message relayed to non-compliant mailer
496 '4.2.1' => $Sisimai::Eb::ReQUIT, # Mailbox disabled, not accepting messages
497 '4.2.2' => $Sisimai::Eb::ReFULL, # Mailbox full
498 '4.2.3' => $Sisimai::Eb::ReSIZE, # Message length exceeds administrative limit
499 '4.2.4' => $Sisimai::Eb::RePROC, # Mailing list expansion problem
500 #'4.3.0' => $Sisimai::Eb::RePROC, # Other or undefined mail system status
501 '4.3.1' => $Sisimai::Eb::ReDISK, # Mail system full
502 '4.3.2' => $Sisimai::Eb::Re00MX, # System not accepting network messages
503 '4.3.3' => $Sisimai::Eb::RePROC, # System not capable of selected features
504 '4.3.5' => $Sisimai::Eb::RePROC, # System incorrectly configured
505 #'4.4.0' => $Sisimai::Eb::ReINET, # Other or undefined network or routing status
506 '4.4.1' => $Sisimai::Eb::ReTIME, # No answer from host
507 '4.4.2' => $Sisimai::Eb::ReINET, # Bad connection
508 '4.4.3' => $Sisimai::Eb::RePROC, # Directory server failure
509 '4.4.4' => $Sisimai::Eb::ReINET, # Unable to route
510 '4.4.5' => $Sisimai::Eb::ReDISK, # Mail system congestion
511 '4.4.6' => $Sisimai::Eb::ReINET, # Routing loop detected
512 '4.4.7' => $Sisimai::Eb::ReTIME, # Delivery time expired
513 '4.4.8' => $Sisimai::Eb::ReINET, # Retry on IPv4
514 #'4.5.0' => $Sisimai::Eb::ReINET, # Other or undefined protocol status
515 '4.5.3' => $Sisimai::Eb::ReRATE, # Too many recipients
516 '4.5.5' => $Sisimai::Eb::RePROC, # Wrong protocol version
517 '4.6.0' => $Sisimai::Eb::ReBODY, # Other or undefined media error
518 '4.6.2' => $Sisimai::Eb::ReBODY, # Conversion required and prohibited
519 '4.6.5' => $Sisimai::Eb::ReBODY, # Conversion Failed
520 #'4.7.0' => $Sisimai::Eb::ReSAFE, # Other or undefined security status
521 '4.7.1' => $Sisimai::Eb::ReBLOC, # Delivery not authorized, message refused
522 '4.7.2' => $Sisimai::Eb::ReFROM, # Mailing list expansion prohibited
523 '4.7.5' => $Sisimai::Eb::ReSAFE, # Cryptographic failure
524 '4.7.6' => $Sisimai::Eb::ReSAFE, # Cryptographic algorithm not supported
525 '4.7.7' => $Sisimai::Eb::ReSAFE, # Message integrity failure
526 '4.7.12' => $Sisimai::Eb::ReSAFE, # A password transition is needed
527 '4.7.15' => $Sisimai::Eb::ReSAFE, # Priority Level is too low
528 '4.7.16' => $Sisimai::Eb::ReSIZE, # Message is too big for the specified priority
529 '4.7.24' => $Sisimai::Eb::ReAUTH, # SPF validation error
530 '4.7.25' => $Sisimai::Eb::ReQPTR, # Reverse DNS validation failed
531 '4.7.26' => $Sisimai::Eb::ReAUTH, # Must pass either SPF or DKIM validation
532 # ---------------------------------------------------------------------------------------------
533 '5.1.0' => $Sisimai::Eb::ReUSER, # Other address status
534 '5.1.1' => $Sisimai::Eb::ReUSER, # Bad destination mailbox address
535 '5.1.2' => $Sisimai::Eb::ReHOST, # Bad destination system address
536 '5.1.3' => $Sisimai::Eb::ReUSER, # Bad destination mailbox address syntax
537 '5.1.4' => $Sisimai::Eb::ReFILT, # Destination mailbox address ambiguous
538 '5.1.6' => $Sisimai::Eb::ReMOVE, # Destination mailbox has moved, No forwarding address
539 '5.1.7' => $Sisimai::Eb::ReFROM, # Bad sender's mailbox address syntax
540 '5.1.8' => $Sisimai::Eb::ReFROM, # Bad sender's system address
541 '5.1.9' => $Sisimai::Eb::RePROC, # Message relayed to non-compliant mailer
542 '5.1.10' => $Sisimai::Eb::Re00MX, # Recipient address has null MX
543 '5.2.0' => $Sisimai::Eb::ReFILT, # Other or undefined mailbox status
544 '5.2.1' => $Sisimai::Eb::ReFILT, # Mailbox disabled, not accepting messages
545 '5.2.2' => $Sisimai::Eb::ReFULL, # Mailbox full
546 '5.2.3' => $Sisimai::Eb::ReSIZE, # Message length exceeds administrative limit
547 '5.2.4' => $Sisimai::Eb::RePROC, # Mailing list expansion problem
548 '5.3.0' => $Sisimai::Eb::RePROC, # Other or undefined mail system status
549 '5.3.1' => $Sisimai::Eb::ReDISK, # Mail system full
550 '5.3.2' => $Sisimai::Eb::Re00MX, # System not accepting network messages
551 '5.3.3' => $Sisimai::Eb::RePROC, # System not capable of selected features
552 '5.3.4' => $Sisimai::Eb::ReSIZE, # Message too big for system
553 '5.3.5' => $Sisimai::Eb::RePROC, # System incorrectly configured
554 '5.4.0' => $Sisimai::Eb::ReINET, # Other or undefined network or routing status
555 '5.4.3' => $Sisimai::Eb::RePROC, # Directory server failure
556 '5.4.4' => $Sisimai::Eb::ReHOST, # Unable to route
557 '5.5.2' => $Sisimai::Eb::RePROC, # If the server cannot BASE64 decode any client response (AUTH)
558 '5.5.3' => $Sisimai::Eb::ReRATE, # Too many recipients
559 '5.5.4' => $Sisimai::Eb::RePROC, # Invalid command arguments
560 '5.5.5' => $Sisimai::Eb::RePROC, # Wrong protocol version
561 '5.5.6' => $Sisimai::Eb::ReCOMM, # Authentication Exchange line is too long
562 '5.6.0' => $Sisimai::Eb::ReBODY, # Other or undefined media error
563 '5.6.1' => $Sisimai::Eb::ReBODY, # Media not supported
564 '5.6.2' => $Sisimai::Eb::ReBODY, # Conversion required and prohibited
565 '5.6.3' => $Sisimai::Eb::ReBODY, # Conversion required but not supported
566 '5.6.5' => $Sisimai::Eb::ReBODY, # Conversion Failed
567 '5.6.6' => $Sisimai::Eb::ReBODY, # Message content not available
568 '5.6.7' => $Sisimai::Eb::RePROC, # Non-ASCII addresses not permitted for that sender/recipient
569 '5.6.8' => $Sisimai::Eb::ReBODY, # UTF-8 string reply is required, but not permitted by the SMTP client
570 '5.6.9' => $Sisimai::Eb::ReBODY, # UTF-8 header message cannot be transferred to one or more recipients
571 '5.7.0' => $Sisimai::Eb::ReSAFE, # Other or undefined security status
572 '5.7.1' => $Sisimai::Eb::ReSAFE, # Delivery not authorized, message refused
573 '5.7.2' => $Sisimai::Eb::ReSAFE, # Mailing list expansion prohibited
574 '5.7.3' => $Sisimai::Eb::ReSAFE, # Security conversion required but not possible
575 '5.7.4' => $Sisimai::Eb::ReSAFE, # Security features not supported
576 '5.7.5' => $Sisimai::Eb::ReSAFE, # Cryptographic failure
577 '5.7.6' => $Sisimai::Eb::ReSAFE, # Cryptographic algorithm not supported
578 '5.7.7' => $Sisimai::Eb::ReSAFE, # Message integrity failure
579 '5.7.8' => $Sisimai::Eb::ReSAFE, # Authentication credentials invalid
580 '5.7.9' => $Sisimai::Eb::ReSAFE, # Authentication mechanism is too weak
581 '5.7.10' => $Sisimai::Eb::ReSAFE, # Encryption Needed
582 '5.7.11' => $Sisimai::Eb::ReSAFE, # Encryption required for requested authentication mechanism
583 '5.7.13' => $Sisimai::Eb::ReQUIT, # User Account Disabled
584 '5.7.14' => $Sisimai::Eb::ReSAFE, # Trust relationship required
585 '5.7.15' => $Sisimai::Eb::ReSAFE, # Priority Level is too low
586 '5.7.16' => $Sisimai::Eb::ReSIZE, # Message is too big for the specified priority
587 '5.7.17' => $Sisimai::Eb::ReMOVE, # Mailbox owner has changed
588 '5.7.18' => $Sisimai::Eb::ReMOVE, # Domain owner has changed
589 '5.7.19' => $Sisimai::Eb::RePROC, # RRVS test cannot be completed
590 '5.7.20' => $Sisimai::Eb::ReAUTH, # No passing DKIM signature found
591 '5.7.21' => $Sisimai::Eb::ReAUTH, # No acceptable DKIM signature found
592 '5.7.22' => $Sisimai::Eb::ReAUTH, # No valid author-matched DKIM signature found
593 '5.7.23' => $Sisimai::Eb::ReAUTH, # SPF validation failed
594 '5.7.24' => $Sisimai::Eb::ReAUTH, # SPF validation error
595 '5.7.25' => $Sisimai::Eb::ReQPTR, # Reverse DNS validation failed
596 '5.7.26' => $Sisimai::Eb::ReAUTH, # Multiple authentication checks failed
597 '5.7.27' => $Sisimai::Eb::Re00MX, # MX resource record of a destination host is Null MX: RFC7505
598 '5.7.28' => $Sisimai::Eb::ReSPAM, # The message appears to be part of a mail flood of similar abusive messages.
599 '5.7.29' => $Sisimai::Eb::ReAUTH, # This status code may be returned when a message fails ARC validation.
600 '5.7.30' => $Sisimai::Eb::ReTTLS, # REQUIRETLS support required
601 93 };
602  
603 93 ▶use constant InternalCode => {
Subroutine BEGIN: called CC=1 SCAR=0.0
604 $Sisimai::Eb::ReAUTH => ['5.9.130', '4.9.130'], # AuthFailure
605 $Sisimai::Eb::ReFAMA => ['5.9.132', '4.9.132'], # BadReputation
606 $Sisimai::Eb::ReBLOC => ['5.9.134', '4.9.134'], # Blocked
607 $Sisimai::Eb::ReBODY => ['5.9.160', '4.9.160'], # ContentError
608 $Sisimai::Eb::ReSIZE => ['5.9.161', '4.9.161'], # EmailTooLarge
609 $Sisimai::Eb::ReTIME => ['5.9.340', '4.9.340'], # Expired
610 $Sisimai::Eb::ReTTLS => ['5.9.350', '4.9.350'], # FailedSTARTTLS
611 $Sisimai::Eb::ReFILT => ['5.9.210', '4.9.210'], # Filtered
612 $Sisimai::Eb::ReMOVE => ['5.9.211', ''], # HasMoved
613 $Sisimai::Eb::ReHOST => ['5.9.212', ''], # HostUnknown
614 $Sisimai::Eb::ReFULL => ['5.9.220', '4.9.220'], # MailboxFull
615 $Sisimai::Eb::ReUNIX => ['5.9.230', '4.9.230'], # MailerError
616 $Sisimai::Eb::ReINET => ['5.9.341', '4.9.341'], # NetworkError
617 $Sisimai::Eb::RePASS => ['5.9.214', '4.9.214'], # NoRelaying
618 $Sisimai::Eb::Re00MX => ['5.9.215', '4.9.215'], # NotAccept
619 $Sisimai::Eb::ReNRFC => ['5.9.162', '4.9.162'], # NotCompliantRFC
620 $Sisimai::Eb::Re___1 => ['5.9.301', '4.9.301'], # OnHold
621 $Sisimai::Eb::ReWONT => ['5.9.371', '4.9.371'], # PolicyViolation
622 $Sisimai::Eb::ReRATE => ['5.9.131', '4.9.131'], # RateLimited
623 $Sisimai::Eb::ReFROM => ['5.9.110', '4.9.110'], # Rejected
624 $Sisimai::Eb::ReQPTR => ['5.9.133', '4.9.133'], # RequirePTR
625 $Sisimai::Eb::ReSAFE => ['5.9.370', '4.9.370'], # SecurityError
626 $Sisimai::Eb::ReSPAM => ['5.9.164', '4.9.164'], # SpamDetected
627 $Sisimai::Eb::ReSTOP => ['5.9.310', '4.9.310'], # Suppressed
628 $Sisimai::Eb::ReQUIT => ['5.9.221', '4.9.221'], # Suspend
629 $Sisimai::Eb::ReCOMM => ['5.9.351', '4.9.351'], # SyntaxError
630 $Sisimai::Eb::RePROC => ['5.9.231', '4.9.231'], # SystemError
631 $Sisimai::Eb::ReDISK => ['5.9.232', '4.9.232'], # SystemFull
632 $Sisimai::Eb::Re___0 => ['5.9.300', '4.9.300'], # Undefined
633 $Sisimai::Eb::ReUSER => ['5.9.213', ''], # UserUnknown
634 $Sisimai::Eb::ReEXEC => ['5.9.165', '4.9.165'], # VirusDetected
635 93 };
636  
637 903 ▶sub code {
Subroutine code: called CC=5 SCAR=16.1
Pod documented
638 # Convert from the reason string to the internal status code
639 # @param [String] argv1 Reason name
640 # @param [Integer] argv2 0: Permanent error
641 # 1: Temporary error
642 # @return [String] D.S.N. or empty if the 1st argument is missing
643 # @see name
644 # @since v4.14.0
645 903 my $class = shift;
646 903 ▶ my $argv1 = shift || return "";
Condition100%2/2
shift() || (return '')
l!l
9021
MC/DC100%1/1
shift() || (return '')
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
647 902 ▶ my $argv2 = shift // 0;
Condition100%2/2
shift() // 0
l!l
83270
MC/DC100%1/1
shift() // 0
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
648 902 ▶ my $pairs = InternalCode->{ $argv1 } || return "";
Condition100%2/2
{AuthFailure => ['5.9.130', '4.9.130'], BadReputation => ['5.9.132', '4.9.132'], Blocked => ['5.9.134', '4.9.134'], ContentError => ['5.9.160', '4.9.160'], EmailTooLarge => ['5.9.161', '4.9.161'], Expired => ['5.9.340', '4.9.340'], FailedSTARTTLS => ['5.9.350', '4.9.350'], Filtered => ['5.9.210', '4.9.210'], HasMoved => ['5.9.211', ''], HostUnknown => ['5.9.212', ''], MailboxFull => ['5.9.220', '4.9.220'], MailerError => ['5.9.230', '4.9.230'], NetworkError => ['5.9.341', '4.9.341'], NoRelaying => ['5.9.214', '4.9.214'], NotAccept => ['5.9.215', '4.9.215'], NotCompliantRFC => ['5.9.162', '4.9.162'], OnHold => ['5.9.301', '4.9.301'], PolicyViolation => ['5.9.371', '4.9.371'], RateLimited => ['5.9.131', '4.9.131'], Rejected => ['5.9.110', '4.9.110'], RequirePTR => ['5.9.133', '4.9.133'], SecurityError => ['5.9.370', '4.9.370'], SpamDetected => ['5.9.164', '4.9.164'], Suppressed => ['5.9.310', '4.9.310'], Suspend => ['5.9.221', '4.9.221'], SyntaxError => ['5.9.351', '4.9.351'], SystemError => ['5.9.231', '4.9.231'], SystemFull => ['5.9.232', '4.9.232'], Undefined => ['5.9.300', '4.9.300'], UserUnknown => ['5.9.213', ''], VirusDetected => ['5.9.165', '4.9.165']}->{$argv1} || (return '')
l!l
786116
MC/DC100%1/1
{AuthFailure => ['5.9.130', '4.9.130'], BadReputation => ['5.9.132', '4.9.132'], Blocked => ['5.9.134', '4.9.134'], ContentError => ['5.9.160', '4.9.160'], EmailTooLarge => ['5.9.161', '4.9.161'], Expired => ['5.9.340', '4.9.340'], FailedSTARTTLS => ['5.9.350', '4.9.350'], Filtered => ['5.9.210', '4.9.210'], HasMoved => ['5.9.211', ''], HostUnknown => ['5.9.212', ''], MailboxFull => ['5.9.220', '4.9.220'], MailerError => ['5.9.230', '4.9.230'], NetworkError => ['5.9.341', '4.9.341'], NoRelaying => ['5.9.214', '4.9.214'], NotAccept => ['5.9.215', '4.9.215'], NotCompliantRFC => ['5.9.162', '4.9.162'], OnHold => ['5.9.301', '4.9.301'], PolicyViolation => ['5.9.371', '4.9.371'], RateLimited => ['5.9.131', '4.9.131'], Rejected => ['5.9.110', '4.9.110'], RequirePTR => ['5.9.133', '4.9.133'], SecurityError => ['5.9.370', '4.9.370'], SpamDetected => ['5.9.164', '4.9.164'], Suppressed => ['5.9.310', '4.9.310'], Suspend => ['5.9.221', '4.9.221'], SyntaxError => ['5.9.351', '4.9.351'], SystemError => ['5.9.231', '4.9.231'], SystemFull => ['5.9.232', '4.9.232'], Undefined => ['5.9.300', '4.9.300'], UserUnknown => ['5.9.213', ''], VirusDetected => ['5.9.165', '4.9.165']}->{$argv1} || (return '')
{AuthFailure => ['5.9.130', '4.9.130'], BadReputation => ['5.9.132', '4.9.132'], Blocked => ['5.9.134', '4.9.134'], ContentError => ['5.9.160', '4.9.160'], EmailTooLarge => ['5.9.161', '4.9.161'], Expired => ['5.9.340', '4.9.340'], FailedSTARTTLS => ['5.9.350', '4.9.350'], Filtered => ['5.9.210', '4.9.210'], HasMoved => ['5.9.211', ''], HostUnknown => ['5.9.212', ''], MailboxFull => ['5.9.220', '4.9.220'], MailerError => ['5.9.230', '4.9.230'], NetworkError => ['5.9.341', '4.9.341'], NoRelaying => ['5.9.214', '4.9.214'], NotAccept => ['5.9.215', '4.9.215'], NotCompliantRFC => ['5.9.162', '4.9.162'], OnHold => ['5.9.301', '4.9.301'], PolicyViolation => ['5.9.371', '4.9.371'], RateLimited => ['5.9.131', '4.9.131'], Rejected => ['5.9.110', '4.9.110'], RequirePTR => ['5.9.133', '4.9.133'], SecurityError => ['5.9.370', '4.9.370'], SpamDetected => ['5.9.164', '4.9.164'], Suppressed => ['5.9.310', '4.9.310'], Suspend => ['5.9.221', '4.9.221'], SyntaxError => ['5.9.351', '4.9.351'], SystemError => ['5.9.231', '4.9.231'], SystemFull => ['5.9.232', '4.9.232'], Undefined => ['5.9.300', '4.9.300'], UserUnknown => ['5.9.213', ''], VirusDetected => ['5.9.165', '4.9.165']}->{$argv1}
Truth table100%2/2
A
A= {AuthFailure => ['5.9.130', '4.9.130'], BadReputation => ['5.9.132', '4.9.132'], Blocked => ['5.9.134', '4.9.134'], ContentError => ['5.9.160', '4.9.160'], EmailTooLarge => ['5.9.161', '4.9.161'], Expired => ['5.9.340', '4.9.340'], FailedSTARTTLS => ['5.9.350', '4.9.350'], Filtered => ['5.9.210', '4.9.210'], HasMoved => ['5.9.211', ''], HostUnknown => ['5.9.212', ''], MailboxFull => ['5.9.220', '4.9.220'], MailerError => ['5.9.230', '4.9.230'], NetworkError => ['5.9.341', '4.9.341'], NoRelaying => ['5.9.214', '4.9.214'], NotAccept => ['5.9.215', '4.9.215'], NotCompliantRFC => ['5.9.162', '4.9.162'], OnHold => ['5.9.301', '4.9.301'], PolicyViolation => ['5.9.371', '4.9.371'], RateLimited => ['5.9.131', '4.9.131'], Rejected => ['5.9.110', '4.9.110'], RequirePTR => ['5.9.133', '4.9.133'], SecurityError => ['5.9.370', '4.9.370'], SpamDetected => ['5.9.164', '4.9.164'], Suppressed => ['5.9.310', '4.9.310'], Suspend => ['5.9.221', '4.9.221'], SyntaxError => ['5.9.351', '4.9.351'], SystemError => ['5.9.231', '4.9.231'], SystemFull => ['5.9.232', '4.9.232'], Undefined => ['5.9.300', '4.9.300'], UserUnknown => ['5.9.213', ''], VirusDetected => ['5.9.165', '4.9.165']}->{$argv1}
Aresult
11
00
649 786 ▶ return $argv2 ? $pairs->[1] : $pairs->[0];
Branch: 1 branch
BranchTrueFalseTotal
$argv2 ? : 55 731 786
650 }
651  
652 16599 ▶sub name {
Subroutine name: called CC=4 SCAR=13.9
Pod documented
653 # Convert from the status code to the reason string
654 # @param [String] argv1 Status code(DSN)
655 # @return [String] Reason name or empty if the first argument did
656 # not match with values in Sisimai's reason list
657 # @see code
658 # @since v4.14.0
659 16599 my $class = shift;
660 16599 ▶ my $argv1 = shift || return ""; return '' unless __PACKAGE__->test($argv1);
Branch: 1 branch
BranchTrueFalseTotal
unless __PACKAGE__->test($argv1) 144 12212 12356
Condition100%2/2
shift() || (return '')
l!l
123564243
MC/DC100%1/1
shift() || (return '')
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
661 12212 ▶ return StandardCode->{ $argv1 } // '';
Condition100%2/2
{"2.1.5" => "Delivered","4.1.6" => "HasMoved","4.1.7" => "Rejected","4.1.8" => "Rejected","4.1.9" => "SystemError","4.2.1" => "Suspend","4.2.2" => "MailboxFull","4.2.3" => "EmailTooLarge","4.2.4" => "SystemError","4.3.1" => "SystemFull","4.3.2" => "NotAccept","4.3.3" => "SystemError","4.3.5" => "SystemError","4.4.1" => "Expired","4.4.2" => "NetworkError","4.4.3" => "SystemError","4.4.4" => "NetworkError","4.4.5" => "SystemFull","4.4.6" => "NetworkError","4.4.7" => "Expired","4.4.8" => "NetworkError","4.5.3" => "RateLimited","4.5.5" => "SystemError","4.6.0" => "ContentError","4.6.2" => "ContentError","4.6.5" => "ContentError","4.7.1" => "Blocked","4.7.12" => "SecurityError","4.7.15" => "SecurityError","4.7.16" => "EmailTooLarge","4.7.2" => "Rejected","4.7.24" => "AuthFailure","4.7.25" => "RequirePTR","4.7.26" => "AuthFailure","4.7.5" => "SecurityError","4.7.6" => "SecurityError","4.7.7" => "SecurityError","5.1.0" => "UserUnknown","5.1.1" => "UserUnknown","5.1.10" => "NotAccept","5.1.2" => "HostUnknown","5.1.3" => "UserUnknown","5.1.4" => "Filtered","5.1.6" => "HasMoved","5.1.7" => "Rejected","5.1.8" => "Rejected","5.1.9" => "SystemError","5.2.0" => "Filtered","5.2.1" => "Filtered","5.2.2" => "MailboxFull","5.2.3" => "EmailTooLarge","5.2.4" => "SystemError","5.3.0" => "SystemError","5.3.1" => "SystemFull","5.3.2" => "NotAccept","5.3.3" => "SystemError","5.3.4" => "EmailTooLarge","5.3.5" => "SystemError","5.4.0" => "NetworkError","5.4.3" => "SystemError","5.4.4" => "HostUnknown","5.5.2" => "SystemError","5.5.3" => "RateLimited","5.5.4" => "SystemError","5.5.5" => "SystemError","5.5.6" => "SyntaxError","5.6.0" => "ContentError","5.6.1" => "ContentError","5.6.2" => "ContentError","5.6.3" => "ContentError","5.6.5" => "ContentError","5.6.6" => "ContentError","5.6.7" => "SystemError","5.6.8" => "ContentError","5.6.9" => "ContentError","5.7.0" => "SecurityError","5.7.1" => "SecurityError","5.7.10" => "SecurityError","5.7.11" => "SecurityError","5.7.13" => "Suspend","5.7.14" => "SecurityError","5.7.15" => "SecurityError","5.7.16" => "EmailTooLarge","5.7.17" => "HasMoved","5.7.18" => "HasMoved","5.7.19" => "SystemError","5.7.2" => "SecurityError","5.7.20" => "AuthFailure","5.7.21" => "AuthFailure","5.7.22" => "AuthFailure","5.7.23" => "AuthFailure","5.7.24" => "AuthFailure","5.7.25" => "RequirePTR","5.7.26" => "AuthFailure","5.7.27" => "NotAccept","5.7.28" => "SpamDetected","5.7.29" => "AuthFailure","5.7.3" => "SecurityError","5.7.30" => "FailedSTARTTLS","5.7.4" => "SecurityError","5.7.5" => "SecurityError","5.7.6" => "SecurityError","5.7.7" => "SecurityError","5.7.8" => "SecurityError","5.7.9" => "SecurityError"}->{$argv1} // ""
l!l
93002912
MC/DC100%1/1
{"2.1.5" => "Delivered","4.1.6" => "HasMoved","4.1.7" => "Rejected","4.1.8" => "Rejected","4.1.9" => "SystemError","4.2.1" => "Suspend","4.2.2" => "MailboxFull","4.2.3" => "EmailTooLarge","4.2.4" => "SystemError","4.3.1" => "SystemFull","4.3.2" => "NotAccept","4.3.3" => "SystemError","4.3.5" => "SystemError","4.4.1" => "Expired","4.4.2" => "NetworkError","4.4.3" => "SystemError","4.4.4" => "NetworkError","4.4.5" => "SystemFull","4.4.6" => "NetworkError","4.4.7" => "Expired","4.4.8" => "NetworkError","4.5.3" => "RateLimited","4.5.5" => "SystemError","4.6.0" => "ContentError","4.6.2" => "ContentError","4.6.5" => "ContentError","4.7.1" => "Blocked","4.7.12" => "SecurityError","4.7.15" => "SecurityError","4.7.16" => "EmailTooLarge","4.7.2" => "Rejected","4.7.24" => "AuthFailure","4.7.25" => "RequirePTR","4.7.26" => "AuthFailure","4.7.5" => "SecurityError","4.7.6" => "SecurityError","4.7.7" => "SecurityError","5.1.0" => "UserUnknown","5.1.1" => "UserUnknown","5.1.10" => "NotAccept","5.1.2" => "HostUnknown","5.1.3" => "UserUnknown","5.1.4" => "Filtered","5.1.6" => "HasMoved","5.1.7" => "Rejected","5.1.8" => "Rejected","5.1.9" => "SystemError","5.2.0" => "Filtered","5.2.1" => "Filtered","5.2.2" => "MailboxFull","5.2.3" => "EmailTooLarge","5.2.4" => "SystemError","5.3.0" => "SystemError","5.3.1" => "SystemFull","5.3.2" => "NotAccept","5.3.3" => "SystemError","5.3.4" => "EmailTooLarge","5.3.5" => "SystemError","5.4.0" => "NetworkError","5.4.3" => "SystemError","5.4.4" => "HostUnknown","5.5.2" => "SystemError","5.5.3" => "RateLimited","5.5.4" => "SystemError","5.5.5" => "SystemError","5.5.6" => "SyntaxError","5.6.0" => "ContentError","5.6.1" => "ContentError","5.6.2" => "ContentError","5.6.3" => "ContentError","5.6.5" => "ContentError","5.6.6" => "ContentError","5.6.7" => "SystemError","5.6.8" => "ContentError","5.6.9" => "ContentError","5.7.0" => "SecurityError","5.7.1" => "SecurityError","5.7.10" => "SecurityError","5.7.11" => "SecurityError","5.7.13" => "Suspend","5.7.14" => "SecurityError","5.7.15" => "SecurityError","5.7.16" => "EmailTooLarge","5.7.17" => "HasMoved","5.7.18" => "HasMoved","5.7.19" => "SystemError","5.7.2" => "SecurityError","5.7.20" => "AuthFailure","5.7.21" => "AuthFailure","5.7.22" => "AuthFailure","5.7.23" => "AuthFailure","5.7.24" => "AuthFailure","5.7.25" => "RequirePTR","5.7.26" => "AuthFailure","5.7.27" => "NotAccept","5.7.28" => "SpamDetected","5.7.29" => "AuthFailure","5.7.3" => "SecurityError","5.7.30" => "FailedSTARTTLS","5.7.4" => "SecurityError","5.7.5" => "SecurityError","5.7.6" => "SecurityError","5.7.7" => "SecurityError","5.7.8" => "SecurityError","5.7.9" => "SecurityError"}->{$argv1} // ""
{"2.1.5" => "Delivered","4.1.6" => "HasMoved","4.1.7" => "Rejected","4.1.8" => "Rejected","4.1.9" => "SystemError","4.2.1" => "Suspend","4.2.2" => "MailboxFull","4.2.3" => "EmailTooLarge","4.2.4" => "SystemError","4.3.1" => "SystemFull","4.3.2" => "NotAccept","4.3.3" => "SystemError","4.3.5" => "SystemError","4.4.1" => "Expired","4.4.2" => "NetworkError","4.4.3" => "SystemError","4.4.4" => "NetworkError","4.4.5" => "SystemFull","4.4.6" => "NetworkError","4.4.7" => "Expired","4.4.8" => "NetworkError","4.5.3" => "RateLimited","4.5.5" => "SystemError","4.6.0" => "ContentError","4.6.2" => "ContentError","4.6.5" => "ContentError","4.7.1" => "Blocked","4.7.12" => "SecurityError","4.7.15" => "SecurityError","4.7.16" => "EmailTooLarge","4.7.2" => "Rejected","4.7.24" => "AuthFailure","4.7.25" => "RequirePTR","4.7.26" => "AuthFailure","4.7.5" => "SecurityError","4.7.6" => "SecurityError","4.7.7" => "SecurityError","5.1.0" => "UserUnknown","5.1.1" => "UserUnknown","5.1.10" => "NotAccept","5.1.2" => "HostUnknown","5.1.3" => "UserUnknown","5.1.4" => "Filtered","5.1.6" => "HasMoved","5.1.7" => "Rejected","5.1.8" => "Rejected","5.1.9" => "SystemError","5.2.0" => "Filtered","5.2.1" => "Filtered","5.2.2" => "MailboxFull","5.2.3" => "EmailTooLarge","5.2.4" => "SystemError","5.3.0" => "SystemError","5.3.1" => "SystemFull","5.3.2" => "NotAccept","5.3.3" => "SystemError","5.3.4" => "EmailTooLarge","5.3.5" => "SystemError","5.4.0" => "NetworkError","5.4.3" => "SystemError","5.4.4" => "HostUnknown","5.5.2" => "SystemError","5.5.3" => "RateLimited","5.5.4" => "SystemError","5.5.5" => "SystemError","5.5.6" => "SyntaxError","5.6.0" => "ContentError","5.6.1" => "ContentError","5.6.2" => "ContentError","5.6.3" => "ContentError","5.6.5" => "ContentError","5.6.6" => "ContentError","5.6.7" => "SystemError","5.6.8" => "ContentError","5.6.9" => "ContentError","5.7.0" => "SecurityError","5.7.1" => "SecurityError","5.7.10" => "SecurityError","5.7.11" => "SecurityError","5.7.13" => "Suspend","5.7.14" => "SecurityError","5.7.15" => "SecurityError","5.7.16" => "EmailTooLarge","5.7.17" => "HasMoved","5.7.18" => "HasMoved","5.7.19" => "SystemError","5.7.2" => "SecurityError","5.7.20" => "AuthFailure","5.7.21" => "AuthFailure","5.7.22" => "AuthFailure","5.7.23" => "AuthFailure","5.7.24" => "AuthFailure","5.7.25" => "RequirePTR","5.7.26" => "AuthFailure","5.7.27" => "NotAccept","5.7.28" => "SpamDetected","5.7.29" => "AuthFailure","5.7.3" => "SecurityError","5.7.30" => "FailedSTARTTLS","5.7.4" => "SecurityError","5.7.5" => "SecurityError","5.7.6" => "SecurityError","5.7.7" => "SecurityError","5.7.8" => "SecurityError","5.7.9" => "SecurityError"}->{$argv1}
Truth table100%2/2
A
A= {"2.1.5" => "Delivered","4.1.6" => "HasMoved","4.1.7" => "Rejected","4.1.8" => "Rejected","4.1.9" => "SystemError","4.2.1" => "Suspend","4.2.2" => "MailboxFull","4.2.3" => "EmailTooLarge","4.2.4" => "SystemError","4.3.1" => "SystemFull","4.3.2" => "NotAccept","4.3.3" => "SystemError","4.3.5" => "SystemError","4.4.1" => "Expired","4.4.2" => "NetworkError","4.4.3" => "SystemError","4.4.4" => "NetworkError","4.4.5" => "SystemFull","4.4.6" => "NetworkError","4.4.7" => "Expired","4.4.8" => "NetworkError","4.5.3" => "RateLimited","4.5.5" => "SystemError","4.6.0" => "ContentError","4.6.2" => "ContentError","4.6.5" => "ContentError","4.7.1" => "Blocked","4.7.12" => "SecurityError","4.7.15" => "SecurityError","4.7.16" => "EmailTooLarge","4.7.2" => "Rejected","4.7.24" => "AuthFailure","4.7.25" => "RequirePTR","4.7.26" => "AuthFailure","4.7.5" => "SecurityError","4.7.6" => "SecurityError","4.7.7" => "SecurityError","5.1.0" => "UserUnknown","5.1.1" => "UserUnknown","5.1.10" => "NotAccept","5.1.2" => "HostUnknown","5.1.3" => "UserUnknown","5.1.4" => "Filtered","5.1.6" => "HasMoved","5.1.7" => "Rejected","5.1.8" => "Rejected","5.1.9" => "SystemError","5.2.0" => "Filtered","5.2.1" => "Filtered","5.2.2" => "MailboxFull","5.2.3" => "EmailTooLarge","5.2.4" => "SystemError","5.3.0" => "SystemError","5.3.1" => "SystemFull","5.3.2" => "NotAccept","5.3.3" => "SystemError","5.3.4" => "EmailTooLarge","5.3.5" => "SystemError","5.4.0" => "NetworkError","5.4.3" => "SystemError","5.4.4" => "HostUnknown","5.5.2" => "SystemError","5.5.3" => "RateLimited","5.5.4" => "SystemError","5.5.5" => "SystemError","5.5.6" => "SyntaxError","5.6.0" => "ContentError","5.6.1" => "ContentError","5.6.2" => "ContentError","5.6.3" => "ContentError","5.6.5" => "ContentError","5.6.6" => "ContentError","5.6.7" => "SystemError","5.6.8" => "ContentError","5.6.9" => "ContentError","5.7.0" => "SecurityError","5.7.1" => "SecurityError","5.7.10" => "SecurityError","5.7.11" => "SecurityError","5.7.13" => "Suspend","5.7.14" => "SecurityError","5.7.15" => "SecurityError","5.7.16" => "EmailTooLarge","5.7.17" => "HasMoved","5.7.18" => "HasMoved","5.7.19" => "SystemError","5.7.2" => "SecurityError","5.7.20" => "AuthFailure","5.7.21" => "AuthFailure","5.7.22" => "AuthFailure","5.7.23" => "AuthFailure","5.7.24" => "AuthFailure","5.7.25" => "RequirePTR","5.7.26" => "AuthFailure","5.7.27" => "NotAccept","5.7.28" => "SpamDetected","5.7.29" => "AuthFailure","5.7.3" => "SecurityError","5.7.30" => "FailedSTARTTLS","5.7.4" => "SecurityError","5.7.5" => "SecurityError","5.7.6" => "SecurityError","5.7.7" => "SecurityError","5.7.8" => "SecurityError","5.7.9" => "SecurityError"}->{$argv1}
Aresult
11
00
662 }
663  
664 12687 ▶sub test {
Subroutine test: called CC=12 SCAR=24.8
Pod documented
665 # Check whether a status code is a valid code or not
666 # @param [String] argv1 Status code(DSN)
667 # @return [Boolean] 0 = Invalid status code, 1 = Valid status code
668 # @see code
669 # @since v5.0.0
670 12687 my $class = shift;
671 12687 ▶ my $argv1 = shift || return 0; return 0 if length $argv1 < 5 || length $argv1 > 7;
Branch: 1 branch
BranchTrueFalseTotal
if length $argv1 < 5 or length $argv1 > 7 4 12682 12686
Condition100%5/5
shift() || (return 0)
l!l
126861
length $argv1 < 5 or length $argv1 > 7
l!l&&r!l&&!r
3112682
MC/DC100%1/1
shift() || (return 0)
shift()
MC/DC100%2/2
length $argv1 < 5 or length $argv1 > 7
length $argv1 < 5 length $argv1 > 7
Truth table100%2/2
A
A= shift()
Aresult
11
00
Truth table100%3/3
A or B
A= length $argv1 < 5B= length $argv1 > 7
ABresult
1X1
011
000
672  
673 12682 my $token = []; push @$token, int $_ for split(/[.]/, $argv1);
674 12682 ▶ return 0 unless scalar @$token == 3;
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @$token == 3 1 12681 12682
675 12681 ▶ return 0 if $token->[0] < 2;
Branch: 1 branch
BranchTrueFalseTotal
if $token->[0] < 2 1 12680 12681
676 12680 ▶ return 0 if $token->[0] == 3;
Branch: 1 branch
BranchTrueFalseTotal
if $token->[0] == 3 1 12679 12680
677 12679 ▶ return 0 if $token->[0] > 5;
Branch: 1 branch
BranchTrueFalseTotal
if $token->[0] > 5 1 12678 12679
678 12678 ▶ return 0 if $token->[1] < 0;
Branch: 1 branch
BranchTrueFalseTotal
if $token->[1] < 0 1 12677 12678
679 12677 ▶ return 0 if $token->[1] > 7;
Branch: 1 branch
BranchTrueFalseTotal
if $token->[1] > 7 145 12532 12677
680 12532 ▶ return 0 if $token->[2] < 0;
Branch: 1 branch
BranchTrueFalseTotal
if $token->[2] < 0 1 12531 12532
681 12531 return 1;
682 }
683  
684 7526 ▶sub find {
Subroutine find: called CC=42 SCAR=38.1
Pod documented
685 # Get a DSN code value from given string including DSN
686 # @param [String] argv1 String including DSN
687 # @param [String] argv2 An SMTP Reply Code or 2 or 4 or 5
688 # @return [String] An SMTP Status Code
689 # @since v4.14.0
690 7526 my $class = shift;
691 7526 ▶ my $argv1 = shift || return ""; return "" if length $argv1 < 7;
Branch: 1 branch
BranchTrueFalseTotal
if length $argv1 < 7 244 7281 7525
Condition100%2/2
shift() || (return '')
l!l
75251
MC/DC100%1/1
shift() || (return '')
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
692 7281 ▶ my $argv2 = shift || '';
Condition100%2/2
shift() || ''
l!l
4566825
MC/DC100%1/1
shift() || ''
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
693  
694 7281 my $givenclass = substr($argv2, 0, 1);
695 7281 ▶ my $eestatuses = $givenclass eq '2' || $givenclass eq '4' || $givenclass eq '5' ? [$givenclass.'.'] : ['5.', '4.', '2.'];
Branch: 1 branch
BranchTrueFalseTotal
$givenclass eq '2' || $givenclass eq '4' || $givenclass eq '5' ? : 456 6825 7281
Condition100%6/6
$givenclass eq 2 or $givenclass eq 4 or $givenclass eq 5
l!l&&r!l&&!r
264306825
$givenclass eq 2 or $givenclass eq 4
l!l&&r!l&&!r
16107255
MC/DC100%3/3
$givenclass eq 2 or $givenclass eq 4 or $givenclass eq 5
$givenclass eq 2 $givenclass eq 4 $givenclass eq 5
Truth table100%4/4
A or B or C
A= $givenclass eq 2B= $givenclass eq 4C= $givenclass eq 5
ABCresult
1XX1
01X1
0011
0000
696 7281 my $esmtperror = ' '.$argv1.' ';
697 7281 my $lookingfor = {};
698  
699 7281 for my $e ( Sisimai::RFC791->find($esmtperror)->@* ) {
700 # Rewrite an IPv4 address in the given string(argv1) with '***.***.***.***'
701 2911 ▶ my $p0 = index($esmtperror, $e); next if $p0 == -1;
Branch: 1 branch
BranchTrueFalseTotal
if $p0 == -1 0 2911 2911
702 2911 substr($esmtperror, $p0, length $e, '***.***.***.***');
703 }
704  
705 7281 for my $e ( @$eestatuses ) {
706 # Count the number of "5.", "4.", and "2." in the error message
707 20931 my $p0 = 0;
708 20931 my $p1 = 0;
709 20931 ▶ while($p0 > -1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($p0 > -1) 26484 0 26484
710 # Find all of the "5." and "4." string and store its postion
711 26484 ▶ $p0 = index($esmtperror, $e, $p1); last if $p0 == -1;
Branch: 1 branch
BranchTrueFalseTotal
if $p0 == -1 20931 5553 26484
712 5553 $lookingfor->{ sprintf("%04d", $p0) } = $e;
713 5553 $p1 = $p0 + 5;
714 }
715 }
716 7281 ▶ return '' unless scalar keys %$lookingfor;
Branch: 1 branch
BranchTrueFalseTotal
unless scalar keys %$lookingfor 4225 3056 7281
717  
718 3056 my $statuscode = []; # List of SMTP Status Code, Keep the order of appearances
719 3056 my $anotherone = ''; # Alternative code
720 3056 my $readbuffer = '';
721 3056 my $characters = []; # Characters around the status code found by index()
722 3056 my $indexofees = -1; # A position of SMTP status code found by the index()
723  
724 3056 for my $e ( sort keys %$lookingfor ) {
725 # Try to find an SMTP Status Code from the given string
726 5553 ▶ $indexofees = index($esmtperror, $lookingfor->{ $e }, int $e); next if $indexofees == -1;
Branch: 1 branch
BranchTrueFalseTotal
if $indexofees == -1 0 5553 5553
727 5553 ▶ $characters = [
Condition50%3/6
ord substr($esmtperror, $indexofees - 1, 1) || 0
l!l
55530
ord substr($esmtperror, $indexofees + 2, 1) || 0
l!l
55530
ord substr($esmtperror, $indexofees + 3, 1) || 0
l!l
55530
MC/DC0%0/1
ord substr($esmtperror, $indexofees - 1, 1) || 0
ord substr($esmtperror, $indexofees - 1, 1)
MC/DC0%0/1
ord substr($esmtperror, $indexofees + 2, 1) || 0
ord substr($esmtperror, $indexofees + 2, 1)
MC/DC0%0/1
ord substr($esmtperror, $indexofees + 3, 1) || 0
ord substr($esmtperror, $indexofees + 3, 1)
Truth table50%1/2
A
A= ord substr($esmtperror, $indexofees - 1, 1)
Aresult
11
00
Truth table50%1/2
A
A= ord substr($esmtperror, $indexofees + 2, 1)
Aresult
11
00
Truth table50%1/2
A
A= ord substr($esmtperror, $indexofees + 3, 1)
Aresult
11
00
728 ord(substr($esmtperror, $indexofees - 1, 1)) || 0, # [0] The previous character of the status
729 ord(substr($esmtperror, $indexofees + 2, 1)) || 0, # [1] The value of the "Subject", "5.[7].261"
730 ord(substr($esmtperror, $indexofees + 3, 1)) || 0, # [2] "." chacater, a separator of the Subject and the Detail
731 ];
732  
733 5553 ▶ next if $characters->[0] > 45 && $characters->[0] < 58; # Previous character is a number
Branch: 1 branch
BranchTrueFalseTotal
if $characters->[0] > 45 and $characters->[0] < 58 1522 4031 5553
Condition100%3/3
$characters->[0] > 45 and $characters->[0] < 58
!ll&&!rl&&r
37702611522
MC/DC100%2/2
$characters->[0] > 45 and $characters->[0] < 58
$characters->[0] > 45 $characters->[0] < 58
Truth table100%3/3
A and B
A= $characters->[0] > 45B= $characters->[0] < 58
ABresult
0X0
100
111
734 4031 ▶ next if $characters->[0] == 86 || $characters->[0] == 118; # Avoid a version number("V" or "v")
Branch: 1 branch
BranchTrueFalseTotal
if $characters->[0] == 86 or $characters->[0] == 118 0 4031 4031
Condition33%1/3
$characters->[0] == 86 or $characters->[0] == 118
l!l&&r!l&&!r
004031
MC/DC0%0/2
$characters->[0] == 86 or $characters->[0] == 118
$characters->[0] == 86 $characters->[0] == 118
Truth table33%1/3
A or B
A= $characters->[0] == 86B= $characters->[0] == 118
ABresult
1X1
011
000
735 4031 ▶ next if $characters->[1] < 48 || $characters->[1] > 55; # The value of the subject is not a number(0-7)
Branch: 1 branch
BranchTrueFalseTotal
if $characters->[1] < 48 or $characters->[1] > 55 254 3777 4031
Condition100%3/3
$characters->[1] < 48 or $characters->[1] > 55
l!l&&r!l&&!r
152393777
MC/DC100%2/2
$characters->[1] < 48 or $characters->[1] > 55
$characters->[1] < 48 $characters->[1] > 55
Truth table100%3/3
A or B
A= $characters->[1] < 48B= $characters->[1] > 55
ABresult
1X1
011
000
736 3777 ▶ next if $characters->[2] != 46; # It is not a "." character: a separator
Branch: 1 branch
BranchTrueFalseTotal
if $characters->[2] != 46 42 3735 3777
737  
738 3735 $readbuffer = $lookingfor->{ $e }.chr($characters->[1]).'.';
739 3735 ▶ push @$characters, ord(substr($esmtperror, $indexofees + 4, 1)) || 0, # [3] The 1st digit of the detail
Condition62%5/8
ord substr($esmtperror, $indexofees + 4, 1) || 0
l!l
37350
ord substr($esmtperror, $indexofees + 5, 1) || 0
l!l
37350
ord substr($esmtperror, $indexofees + 6, 1) || 0
l!l
37350
ord substr($esmtperror, $indexofees + 7, 1) || 0
l!l
37341
MC/DC0%0/1
ord substr($esmtperror, $indexofees + 4, 1) || 0
ord substr($esmtperror, $indexofees + 4, 1)
MC/DC0%0/1
ord substr($esmtperror, $indexofees + 5, 1) || 0
ord substr($esmtperror, $indexofees + 5, 1)
MC/DC0%0/1
ord substr($esmtperror, $indexofees + 6, 1) || 0
ord substr($esmtperror, $indexofees + 6, 1)
MC/DC100%1/1
ord substr($esmtperror, $indexofees + 7, 1) || 0
ord substr($esmtperror, $indexofees + 7, 1)
Truth table50%1/2
A
A= ord substr($esmtperror, $indexofees + 4, 1)
Aresult
11
00
Truth table50%1/2
A
A= ord substr($esmtperror, $indexofees + 5, 1)
Aresult
11
00
Truth table50%1/2
A
A= ord substr($esmtperror, $indexofees + 6, 1)
Aresult
11
00
Truth table100%2/2
A
A= ord substr($esmtperror, $indexofees + 7, 1)
Aresult
11
00
740 ord(substr($esmtperror, $indexofees + 5, 1)) || 0, # [4] The 2nd digit of the detail
741 ord(substr($esmtperror, $indexofees + 6, 1)) || 0, # [5] The 3rd digit of the detail
742 ord(substr($esmtperror, $indexofees + 7, 1)) || 0; # [6] The next character
743  
744 3735 ▶ next if $characters->[3] < 48 || $characters->[3] > 57; # The 1st digit of the detail is not a number
Branch: 1 branch
BranchTrueFalseTotal
if $characters->[3] < 48 or $characters->[3] > 57 6 3729 3735
Condition66%2/3
$characters->[3] < 48 or $characters->[3] > 57
l!l&&r!l&&!r
603729
MC/DC50%1/2
$characters->[3] < 48 or $characters->[3] > 57
$characters->[3] < 48 $characters->[3] > 57
Truth table66%2/3
A or B
A= $characters->[3] < 48B= $characters->[3] > 57
ABresult
1X1
011
000
745 3729 $readbuffer .= chr $characters->[3];
746  
747 3729 ▶ if( Sisimai::SMTP::Status->is_ambiguous($readbuffer) || $readbuffer eq "4.4.7" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ("Sisimai::SMTP::Status"->is_ambiguous($readbuffer) or $readbuffer eq "4.4.7") 199 3530 3729
Condition100%3/3
"Sisimai::SMTP::Status"->is_ambiguous($readbuffer) or $readbuffer eq "4.4.7"
l!l&&r!l&&!r
172273530
MC/DC100%2/2
"Sisimai::SMTP::Status"->is_ambiguous($readbuffer) or $readbuffer eq "4.4.7"
"Sisimai::SMTP::Status"->is_ambiguous($readbuffer) $readbuffer eq "4.4.7"
Truth table100%3/3
A or B
A= "Sisimai::SMTP::Status"->is_ambiguous($readbuffer)B= $readbuffer eq "4.4.7"
ABresult
1X1
011
000
748 # Find another status code except *.0.0, 4.4.7
749 199 $anotherone = $readbuffer;
750 199 next;
751 }
752  
753 3530 ▶ if( $characters->[4] < 48 || $characters->[4] > 57 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($characters->[4] < 48 or $characters->[4] > 57) 3031 499 3530
Condition100%3/3
$characters->[4] < 48 or $characters->[4] > 57
l!l&&r!l&&!r
30265499
MC/DC100%2/2
$characters->[4] < 48 or $characters->[4] > 57
$characters->[4] < 48 $characters->[4] > 57
Truth table100%3/3
A or B
A= $characters->[4] < 48B= $characters->[4] > 57
ABresult
1X1
011
000
754 # The 2nd digit of the detail is not a number
755 3031 push @$statuscode, $readbuffer;
756 3031 next;
757 }
758 499 $readbuffer .= chr $characters->[4]; # The 2nd digit of the detail is a number
759  
760 499 ▶ if( $characters->[5] < 48 || $characters->[5] > 57 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($characters->[5] < 48 or $characters->[5] > 57) 359 140 499
Condition66%2/3
$characters->[5] < 48 or $characters->[5] > 57
l!l&&r!l&&!r
3590140
MC/DC50%1/2
$characters->[5] < 48 or $characters->[5] > 57
$characters->[5] < 48 $characters->[5] > 57
Truth table66%2/3
A or B
A= $characters->[5] < 48B= $characters->[5] > 57
ABresult
1X1
011
000
761 # The 3rd digit of the detail is not a number
762 359 push @$statuscode, $readbuffer;
763 359 next;
764 }
765 140 $readbuffer .= chr $characters->[5]; # The 3rd digit of the detail is a number
766  
767 140 ▶ next if $characters->[6] > 47 && $characters->[6] < 58;
Branch: 1 branch
BranchTrueFalseTotal
if $characters->[6] > 47 and $characters->[6] < 58 0 140 140
Condition33%1/3
$characters->[6] > 47 and $characters->[6] < 58
!ll&&!rl&&r
14000
MC/DC0%0/2
$characters->[6] > 47 and $characters->[6] < 58
$characters->[6] > 47 $characters->[6] < 58
Truth table33%1/3
A and B
A= $characters->[6] > 47B= $characters->[6] < 58
ABresult
0X0
100
111
768 140 push @$statuscode, $readbuffer;
769 }
770 3056 ▶ push @$statuscode, $anotherone if length $anotherone;
Branch: 1 branch
BranchTrueFalseTotal
if length $anotherone 189 2867 3056
771 3056 ▶ return '' if scalar @$statuscode == 0;
Branch: 1 branch
BranchTrueFalseTotal
if scalar @$statuscode == 0 483 2573 3056
772  
773 # Select one from picked status codes
774 2573 my $cv = shift @$statuscode; for my $e ( @$statuscode ) { $cv = __PACKAGE__->prefer($cv, $e, "") }
775 2573 return $cv;
776 }
777  
778 5038 ▶sub prefer {
Subroutine prefer: called CC=32 SCAR=34.9
Pod documented
779 # Return the preferred value selected from the arguments
780 # @param [String] argv0 The value of Status:
781 # @param [String] argv1 The delivery status picked from the error message
782 # @param [String] argv2 The value of An SMTP Reply Code
783 # @return [String] The preferred value
784 # @since v5.0.0
785 5038 my $class = shift;
786 5038 ▶ my $argv0 = shift || '';
Condition100%2/2
shift() || ''
l!l
34581580
MC/DC100%1/1
shift() || ''
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
787 5038 ▶ my $argv1 = shift || '';
Condition100%2/2
shift() || ''
l!l
31691869
MC/DC100%1/1
shift() || ''
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
788 5038 ▶ my $argv2 = shift || '';
Condition100%2/2
shift() || ''
l!l
28102228
MC/DC100%1/1
shift() || ''
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
789  
790 5038 ▶ my $statuscode = $argv0 || return $argv1; return $argv1 unless length $statuscode > 4;
Branch: 1 branch
BranchTrueFalseTotal
unless length $statuscode > 4 1 3457 3458
Condition100%2/2
$argv0 || (return $argv1)
l!l
34581580
MC/DC100%1/1
$argv0 || (return $argv1)
$argv0
Truth table100%2/2
A
A= $argv0
Aresult
11
00
791 3457 ▶ my $codeinmesg = $argv1 || return $argv0; return $argv0 unless length $codeinmesg > 4;
Branch: 1 branch
BranchTrueFalseTotal
unless length $codeinmesg > 4 1 2509 2510
Condition100%2/2
$argv1 || (return $argv0)
l!l
2510947
MC/DC100%1/1
$argv1 || (return $argv0)
$argv1
Truth table100%2/2
A
A= $argv1
Aresult
11
00
792 2509 ▶ return $codeinmesg if index($statuscode, '.9.') == 1;
Branch: 1 branch
BranchTrueFalseTotal
if index($statuscode, ".9.") == 1 0 2509 2509
793  
794 2509 ▶ my $esmtpreply = $argv2 || 0;
Condition100%2/2
$argv2 || 0
l!l
13431166
MC/DC100%1/1
$argv2 || 0
$argv2
Truth table100%2/2
A
A= $argv2
Aresult
11
00
795 2509 my $the1stchar = {
796 'field' => int substr($statuscode, 0, 1),
797 'error' => int substr($codeinmesg, 0, 1),
798 'reply' => int substr($esmtpreply, 0, 1),
799 };
800  
801 2509 ▶ if( $the1stchar->{'reply'} > 0 && $the1stchar->{'field'} != $the1stchar->{'error'} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($the1stchar->{"reply"} > 0 and $the1stchar->{"field"} != $the1stchar->{"error"}) 23 2486 2509
Condition100%3/3
$the1stchar->{"reply"} > 0 and $the1stchar->{"field"} != $the1stchar->{"error"}
!ll&&!rl&&r
1166132023
MC/DC100%2/2
$the1stchar->{"reply"} > 0 and $the1stchar->{"field"} != $the1stchar->{"error"}
$the1stchar->{"reply"} > 0 $the1stchar->{"field"} != $the1stchar->{"error"}
Truth table100%3/3
A and B
A= $the1stchar->{"reply"} > 0B= $the1stchar->{"field"} != $the1stchar->{"error"}
ABresult
0X0
100
111
802 # There is the 3rd argument (an SMTP Reply Code)
803 # Returns the value of $argv0 or $argv1 which begins with the 1st character of $argv2
804 23 ▶ return $statuscode if $the1stchar->{'reply'} == $the1stchar->{'field'};
Branch: 1 branch
BranchTrueFalseTotal
if $the1stchar->{"reply"} == $the1stchar->{"field"} 2 21 23
805 21 ▶ return $codeinmesg if $the1stchar->{'reply'} == $the1stchar->{'error'};
Branch: 1 branch
BranchTrueFalseTotal
if $the1stchar->{"reply"} == $the1stchar->{"error"} 21 0 21
806 }
807 2486 ▶ return $statuscode if $statuscode eq $codeinmesg;
Branch: 1 branch
BranchTrueFalseTotal
if $statuscode eq $codeinmesg 2103 383 2486
808  
809 383 my $zeroindex1 = {'field' => index($statuscode, '.0'), 'error' => index($codeinmesg, '.0') };
810 383 my $zeroindex2 = {'field' => index($statuscode, '.0.0'), 'error' => index($codeinmesg, '.0.0')};
811  
812 383 ▶ if( $zeroindex2->{'field'} > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($zeroindex2->{"field"} > 0) 75 308 383
813 # "Status:" field is "X.0.0"
814 75 ▶ return $codeinmesg if $zeroindex2->{'error'} < 0;
Branch: 1 branch
BranchTrueFalseTotal
if $zeroindex2->{"error"} < 0 75 0 75
815 0 return $statuscode;
816 }
817  
818 308 ▶ if( $zeroindex1->{'field'} > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($zeroindex1->{"field"} > 0) 65 243 308
819 # "Status:" field is "X.Y.0" or "X.0.Z"
820 65 ▶ return $codeinmesg if $zeroindex1->{'error'} < 0;
Branch: 1 branch
BranchTrueFalseTotal
if $zeroindex1->{"error"} < 0 44 21 65
821 }
822  
823 264 ▶ return $statuscode if $zeroindex2->{'error'} > 0; # An SMTP status code is "X.0.0"
Branch: 1 branch
BranchTrueFalseTotal
if $zeroindex2->{"error"} > 0 62 202 264
824 202 ▶ return $codeinmesg if $statuscode eq '4.4.7'; # "4.4.7" is an ambiguous code
Branch: 1 branch
BranchTrueFalseTotal
if $statuscode eq "4.4.7" 36 166 202
825 166 ▶ return $codeinmesg if $statuscode eq '4.7.0'; # "4.7.0" indicates "too many errors"
Branch: 1 branch
BranchTrueFalseTotal
if $statuscode eq "4.7.0" 11 155 166
826 155 ▶ return $codeinmesg if index($statuscode, '5.3.') == 0; # "5.3.Z" is an error of a system
Branch: 1 branch
BranchTrueFalseTotal
if index($statuscode, "5.3.") == 0 0 155 155
827 155 ▶ return $codeinmesg if index($statuscode, '.5.1') > 0; # "X.5.1" indicates an invalid command
Branch: 1 branch
BranchTrueFalseTotal
if index($statuscode, ".5.1") > 0 11 144 155
828 144 ▶ return $codeinmesg if index($statuscode, '.5.2') > 0; # "X.5.2" indicates a syntax error
Branch: 1 branch
BranchTrueFalseTotal
if index($statuscode, ".5.2") > 0 0 144 144
829 144 ▶ return $codeinmesg if index($statuscode, '.5.4') > 0; # "X.5.4" indicates an invalid command arguments
Branch: 1 branch
BranchTrueFalseTotal
if index($statuscode, ".5.4") > 0 0 144 144
830 144 ▶ return $codeinmesg if index($statuscode, '.5.5') > 0; # "X.5.5" indicates a wrong protocol version
Branch: 1 branch
BranchTrueFalseTotal
if index($statuscode, ".5.5") > 0 0 144 144
831  
832 144 ▶ if( $statuscode eq '5.1.1' ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($statuscode eq '5.1.1') { } 37 107 144
elsif ($statuscode eq '5.1.3') { } 5 102 107
833 # "5.1.1" is a code of "UserUnknown"
834 37 ▶ return $statuscode if index($codeinmesg, '5.5.') == 0 || $zeroindex1->{'error'} > 0;
Branch: 1 branch
BranchTrueFalseTotal
if index($codeinmesg, "5.5.") == 0 or $zeroindex1->{"error"} > 0 27 10 37
Condition100%3/3
index($codeinmesg, "5.5.") == 0 or $zeroindex1->{"error"} > 0
l!l&&r!l&&!r
171010
MC/DC100%2/2
index($codeinmesg, "5.5.") == 0 or $zeroindex1->{"error"} > 0
index($codeinmesg, "5.5.") == 0 $zeroindex1->{"error"} > 0
Truth table100%3/3
A or B
A= index($codeinmesg, "5.5.") == 0B= $zeroindex1->{"error"} > 0
ABresult
1X1
011
000
835 10 return $codeinmesg;
836  
837 } elsif( $statuscode eq '5.1.3' ) {
838 # "5.1.3"
839 5 ▶ return $codeinmesg if index($codeinmesg, '5.7.') == 0;
Branch: 1 branch
BranchTrueFalseTotal
if index($codeinmesg, "5.7.") == 0 5 0 5
840 }
841 102 return $statuscode;
842 }
843  
844 92 ▶sub is_explicit {
Subroutine is_explicit: called CC=4 SCAR=13.9
Pod documented
845 # is_explicit() returns 0 when the argument is empty or is an internal status code
846 # @param string argv1 Delivery status code
847 # @return bool 0: The delivery status is not explicit
848 92 my $class = shift;
849 92 ▶ my $argv1 = shift || return 0;
Condition100%2/2
shift() || (return 0)
l!l
911
MC/DC100%1/1
shift() || (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
850  
851 91 ▶ return 0 if length($argv1) == 7 && index($argv1, ".9.") == 1;
Branch: 1 branch
BranchTrueFalseTotal
if length $argv1 == 7 and index($argv1, ".9.") == 1 2 89 91
Condition66%2/3
length $argv1 == 7 and index($argv1, ".9.") == 1
!ll&&!rl&&r
8902
MC/DC50%1/2
length $argv1 == 7 and index($argv1, ".9.") == 1
length $argv1 == 7 index($argv1, ".9.") == 1
Truth table66%2/3
A and B
A= length $argv1 == 7B= index($argv1, ".9.") == 1
ABresult
0X0
100
111
852 89 return 1;
853 }
854  
855 4553 ▶sub is_ambiguous {
Subroutine is_ambiguous: called CC=4 SCAR=13.9
Pod documented
856 # is_ambiguous() returns 1 when the argument is not empty and is ends with ".0.0".
857 # @param string argv1 Delivery status code
858 # @return bool 1: The delivery status is ambiguous
859 4553 my $class = shift;
860 4553 ▶ my $argv1 = shift || return 1;
Condition100%2/2
shift() || (return 1)
l!l
4355198
MC/DC100%1/1
shift() || (return 1)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
861 4355 ▶ return 1 if length($argv1) == 5 && substr($argv1, -4, 4) eq ".0.0";
Branch: 1 branch
BranchTrueFalseTotal
if length $argv1 == 5 and substr($argv1, -4, 4) eq ".0.0" 352 4003 4355
Condition100%3/3
length $argv1 == 5 and substr($argv1, -4, 4) eq ".0.0"
!ll&&!rl&&r
293974352
MC/DC100%2/2
length $argv1 == 5 and substr($argv1, -4, 4) eq ".0.0"
length $argv1 == 5 substr($argv1, -4, 4) eq ".0.0"
Truth table100%3/3
A and B
A= length $argv1 == 5B= substr($argv1, -4, 4) eq ".0.0"
ABresult
0X0
100
111
862 4003 return 0
863 }
864  
865 93 1;
866 __END__
« Sisimai/RFC3834.pm ↑ Summary Sisimai/Lhost/Gmail.pm »