| 1 | package Sisimai::Rhost::YahooInc; | ||||||||||||||||||||
| 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 | 52 | ▶ | sub find { | ||||||||||||||||||
|
Subroutine
find: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||
| 7 | # Detect bounce reason from Yahoo Inc. (*.yahoodns.net) | ||||||||||||||||||||
| 8 | # @param [Sisimai::Fact] argvs Decoded email object | ||||||||||||||||||||
| 9 | # @return [String] The bounce reason for YahooInc | ||||||||||||||||||||
| 10 | # @see https://senders.yahooinc.com/smtp-error-codes | ||||||||||||||||||||
| 11 | # https://smtpfieldmanual.com/provider/yahoo | ||||||||||||||||||||
| 12 | # https://www.postmastery.com/yahoo-postmaster/ | ||||||||||||||||||||
| 13 | # @since v5.1.0 | ||||||||||||||||||||
| 14 | 52 | my $class = shift; | |||||||||||||||||||
| 15 | 52 | ▶ | my $argvs = shift // return ""; return "" unless $argvs->{'diagnosticcode'}; | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
shift() // (return "")
MC/DC100%1/1
shift() // (return "")
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 50 | require Sisimai::Eb; | |||||||||||||||||||
| 18 | 50 | state $messagesof = { | |||||||||||||||||||
| 19 | $Sisimai::Eb::ReAUTH => [ | ||||||||||||||||||||
| 20 | # - 550 5.7.9 This mail has been blocked because the sender is unauthenticated. Yahoo | ||||||||||||||||||||
| 21 | # requires all senders to authenticate with either SPF or DKIM. | ||||||||||||||||||||
| 22 | 'yahoo requires all senders to authenticate with either spf or dkim', | ||||||||||||||||||||
| 23 | ], | ||||||||||||||||||||
| 24 | $Sisimai::Eb::ReBLOC => [ | ||||||||||||||||||||
| 25 | # - 553 5.7.1 [BL21] Connections will not be accepted from 192.0.2.25, | ||||||||||||||||||||
| 26 | # because the ip is in Spamhaus's list; see http://postmaster.yahoo.com/550-bl23.html | ||||||||||||||||||||
| 27 | # - 553 5.7.1 [BL23] Connections not accepted from IP addresses on Spamhaus XBL; | ||||||||||||||||||||
| 28 | # see http://postmaster.yahoo.com/errors/550-bl23.html [550]", | ||||||||||||||||||||
| 29 | " because the ip is in spamhaus's list;", | ||||||||||||||||||||
| 30 | 'not accepted from ip addresses on spamhaus xbl', | ||||||||||||||||||||
| 31 | ], | ||||||||||||||||||||
| 32 | $Sisimai::Eb::RePASS => [ | ||||||||||||||||||||
| 33 | # - 550 relaying denied for <***@yahoo.com> | ||||||||||||||||||||
| 34 | 'relaying denied for ', | ||||||||||||||||||||
| 35 | ], | ||||||||||||||||||||
| 36 | $Sisimai::Eb::ReNRFC => ['headers are not rfc compliant'], | ||||||||||||||||||||
| 37 | $Sisimai::Eb::ReWONT => [ | ||||||||||||||||||||
| 38 | # - 554 Message not allowed - [PH01] Email not accepted for policy reasons. | ||||||||||||||||||||
| 39 | # Please visit https://postmaster.yahooinc.com/error-codes | ||||||||||||||||||||
| 40 | # - 554 5.7.9 Message not accepted for policy reasons. | ||||||||||||||||||||
| 41 | # See https://postmaster.yahooinc.com/error-codes | ||||||||||||||||||||
| 42 | 'not accepted for policy reasons', | ||||||||||||||||||||
| 43 | ], | ||||||||||||||||||||
| 44 | $Sisimai::Eb::ReRATE => [ | ||||||||||||||||||||
| 45 | # - 421 Max message per connection reached, closing transmission channel | ||||||||||||||||||||
| 46 | 'max message per connection reached', | ||||||||||||||||||||
| 47 | # - 450 User is receiving mail too quickly | ||||||||||||||||||||
| 48 | 'user is receiving mail too quickly', | ||||||||||||||||||||
| 49 | ], | ||||||||||||||||||||
| 50 | $Sisimai::Eb::ReFROM => [ | ||||||||||||||||||||
| 51 | # Observed the following error message since around March 2024: | ||||||||||||||||||||
| 52 | # | ||||||||||||||||||||
| 53 | # - 421 4.7.0 [TSS04] Messages from 192.0.2.25 temporarily deferred due to unexpected | ||||||||||||||||||||
| 54 | # volume or user complaints - 4.16.55.1; | ||||||||||||||||||||
| 55 | # see https://postmaster.yahooinc.com/error-codes (in reply to MAIL FROM command)) | ||||||||||||||||||||
| 56 | # | ||||||||||||||||||||
| 57 | # However, the same error message is returned even for domains that are considered to | ||||||||||||||||||||
| 58 | # have a poor reputation without SPF, DKIM, or DMARC settings, or for other reasons. | ||||||||||||||||||||
| 59 | # It seems that the error message is not as granular as Google's. | ||||||||||||||||||||
| 60 | 'temporarily deferred due to unexpected volume or user complaints', | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | # - 451 Message temporarily deferred due to unresolvable RFC.5321 from domain. | ||||||||||||||||||||
| 63 | # See https://senders.yahooinc.com/error-codes#unresolvable-from-domain | ||||||||||||||||||||
| 64 | 'due to unresolvable rfc.5321 domain', | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | # - 553 5.7.2 [TSS09] All messages from 192.0.2.25 will be permanently deferred; | ||||||||||||||||||||
| 67 | # Retrying will NOT succeed. See https://postmaster.yahooinc.com/error-codes | ||||||||||||||||||||
| 68 | # - 553 5.7.2 [TSS11] All messages from 192.0.2.25 will be permanently deferred; | ||||||||||||||||||||
| 69 | # Retrying will NOT succeed. See https://postmaster.yahooinc.com/error-codes | ||||||||||||||||||||
| 70 | ' will be permanently deferred', | ||||||||||||||||||||
| 71 | ], | ||||||||||||||||||||
| 72 | $Sisimai::Eb::ReQUIT => [ | ||||||||||||||||||||
| 73 | # - 554 delivery error: dd ****@yahoo.com is no longer valid. | ||||||||||||||||||||
| 74 | # - 554 30 Sorry, your message to *****@aol.jp cannot be delivered. | ||||||||||||||||||||
| 75 | # This mailbox is disabled (554.30) | ||||||||||||||||||||
| 76 | ' is no longer valid.', | ||||||||||||||||||||
| 77 | 'this mailbox is disabled', | ||||||||||||||||||||
| 78 | ], | ||||||||||||||||||||
| 79 | $Sisimai::Eb::ReCOMM => [ | ||||||||||||||||||||
| 80 | # - 501 Syntax error in parameters or arguments | ||||||||||||||||||||
| 81 | 'syntax error in parameters or arguments', | ||||||||||||||||||||
| 82 | ], | ||||||||||||||||||||
| 83 | $Sisimai::Eb::ReUSER => [ | ||||||||||||||||||||
| 84 | # - 554 delivery error: dd This user doesn't have a yahoo.com account (***@yahoo.com) | ||||||||||||||||||||
| 85 | # - 552 1 Requested mail action aborted, mailbox not found (in reply to end of DATA command) | ||||||||||||||||||||
| 86 | "dd this user doesn't have a ", | ||||||||||||||||||||
| 87 | 'mailbox not found', | ||||||||||||||||||||
| 88 | ], | ||||||||||||||||||||
| 89 | }; | ||||||||||||||||||||
| 90 | |||||||||||||||||||||
| 91 | 50 | my $issuedcode = lc $argvs->{'diagnosticcode'}; | |||||||||||||||||||
| 92 | 50 | my $reasontext = ''; | |||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | 50 | for my $e ( keys %$messagesof ) { | |||||||||||||||||||
| 95 | # Try to find the error message matches with the given error message string | ||||||||||||||||||||
| 96 | 219 | ▶ | next unless grep { index($issuedcode, $_) > -1 } $messagesof->{ $e }->@*; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 97 | 48 | $reasontext = $e; | |||||||||||||||||||
| 98 | 48 | last; | |||||||||||||||||||
| 99 | } | ||||||||||||||||||||
| 100 | 50 | return $reasontext; | |||||||||||||||||||
| 101 | } | ||||||||||||||||||||
| 102 | |||||||||||||||||||||
| 103 | 7 | 1; | |||||||||||||||||||
| 104 | __END__ | ||||||||||||||||||||