| 1 | package Sisimai::Rhost::GoDaddy; | ||||||||||||||||||||
| 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 | # https://www.godaddy.com/help/what-does-my-email-bounceback-mean-3568 | ||||||||||||||||||||
| 7 | 21 | ▶ | sub find { | ||||||||||||||||||
|
Subroutine
find: called CC=8 SCAR=20.8
Pod
undocumented
| |||||||||||||||||||||
| 8 | # Detect bounce reason from GoDaddy (smtp.secureserver.net) | ||||||||||||||||||||
| 9 | # @param [Sisimai::Fact] argvs Decoded email object | ||||||||||||||||||||
| 10 | # @return [String] The bounce reason for GoDaddy | ||||||||||||||||||||
| 11 | # @see https://ca.godaddy.com/help/fix-rejected-email-with-a-bounce-error-40685 | ||||||||||||||||||||
| 12 | # @since v4.22.2 | ||||||||||||||||||||
| 13 | 21 | my $class = shift; | |||||||||||||||||||
| 14 | 21 | ▶ | 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()
| |||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 19 | require Sisimai::Eb; | |||||||||||||||||||
| 17 | 19 | state $errorcodes = { | |||||||||||||||||||
| 18 | # Sender bounces | ||||||||||||||||||||
| 19 | # ----------------------------------------------------------------------------------------- | ||||||||||||||||||||
| 20 | # - 535 Authentication not allowed on IBSMTP Servers. IB401 | ||||||||||||||||||||
| 21 | # - Authentication is not allowed on inbound mail. This happens when you have incorrect | ||||||||||||||||||||
| 22 | # outgoing SMTP server settings set up in your email client, like Outlook or Gmail. | ||||||||||||||||||||
| 23 | # - Set up your email client using the SMTP server setting smtpout.secureserver.net. | ||||||||||||||||||||
| 24 | 'IB401' => $Sisimai::Eb::ReSAFE, | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | # - 550 jane@coolexample.com Blank From: addresses are not allowed. Provide a valid From. | ||||||||||||||||||||
| 27 | # IB501 | ||||||||||||||||||||
| 28 | # - The email message "from" field is blank. | ||||||||||||||||||||
| 29 | # - Add a valid "from" address and try to send the email again. | ||||||||||||||||||||
| 30 | 'IB501' => $Sisimai::Eb::ReNRFC, | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | # - 550 jane@coolexample.com IP addresses are not allowed as a From: Address. Provide a | ||||||||||||||||||||
| 33 | # valid From. IB502 | ||||||||||||||||||||
| 34 | # - Email messages can't be sent "from" an IP address. | ||||||||||||||||||||
| 35 | # - Add a valid "from" address and try to send the email again. | ||||||||||||||||||||
| 36 | 'IB502' => $Sisimai::Eb::ReNRFC, | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | # - 550 coolexample.com From: Domain is invalid. Provide a valid From: IB506 | ||||||||||||||||||||
| 39 | # - The domain doesn't have valid MX Records, an IP address, or there were issues during | ||||||||||||||||||||
| 40 | # the DNS lookup when the email was sent. | ||||||||||||||||||||
| 41 | # - Verify that you're sending from a valid domain. Then verify that the domain has valid | ||||||||||||||||||||
| 42 | # DNS records by checking your zone file. If the DNS isn't valid, it must be fixed before | ||||||||||||||||||||
| 43 | # you resend the email. | ||||||||||||||||||||
| 44 | 'IB506' => $Sisimai::Eb::ReFROM, | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | # - 550 jane@coolexample.com Invalid SPF record. Inspect your SPF settings, and try again. | ||||||||||||||||||||
| 47 | # IB508 | ||||||||||||||||||||
| 48 | # - The sending email address's domain has an SPF record that does not authorize the sending | ||||||||||||||||||||
| 49 | # email server to send email from the domain. | ||||||||||||||||||||
| 50 | # - Modify the SPF record to include the server you're trying to send from or remove the SPF | ||||||||||||||||||||
| 51 | # record from the domain. | ||||||||||||||||||||
| 52 | 'IB508' => $Sisimai::Eb::ReAUTH, | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | # - 421 Temporarily rejected. Reverse DNS for this IP failed. IB108 | ||||||||||||||||||||
| 55 | # - The IP address attempting to send mail does not have reverse DNS setup, or the DNS | ||||||||||||||||||||
| 56 | # lookup failed. | ||||||||||||||||||||
| 57 | # - Verify the sending IP address has reverse DNS set up before resending the email. | ||||||||||||||||||||
| 58 | # GoDaddy manages reverse DNS when using our email services. We do not support custom | ||||||||||||||||||||
| 59 | # reverse DNS. | ||||||||||||||||||||
| 60 | 'IB108' => $Sisimai::Eb::ReQPTR, | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | # Content bounces | ||||||||||||||||||||
| 63 | # ----------------------------------------------------------------------------------------- | ||||||||||||||||||||
| 64 | # - 552 This message has been rejected due to content judged to be spam by the internet | ||||||||||||||||||||
| 65 | # community. IB212 | ||||||||||||||||||||
| 66 | # - The email message contains a link, attachment or pattern caught by our filters as spam. | ||||||||||||||||||||
| 67 | 'IB212' => $Sisimai::Eb::ReSPAM, | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | # - 552 Virus infected message rejected. IB705 | ||||||||||||||||||||
| 70 | # - The email message containing a link, attachment or pattern caught by our filters as a | ||||||||||||||||||||
| 71 | # possible virus. | ||||||||||||||||||||
| 72 | 'IB705' => $Sisimai::Eb::ReEXEC, | ||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | # Rate limiting bounces | ||||||||||||||||||||
| 75 | # ----------------------------------------------------------------------------------------- | ||||||||||||||||||||
| 76 | # - 452 This message contains too many recipients. Reduce the number of recipients and | ||||||||||||||||||||
| 77 | # retry. IB605 | ||||||||||||||||||||
| 78 | # - The message has attempted to mail too many recipients. | ||||||||||||||||||||
| 79 | # - Reduce the number of recipients and try again. | ||||||||||||||||||||
| 80 | 'IB605' => $Sisimai::Eb::ReRATE, | ||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | # - 421 Connection refused, too many sessions from This IP. Lower the number of concurrent | ||||||||||||||||||||
| 83 | # sessions. IB007 | ||||||||||||||||||||
| 84 | # - This IP address currently has too many sessions open. | ||||||||||||||||||||
| 85 | # - Check with your email provider to reduce the number of open sessions on your IP address | ||||||||||||||||||||
| 86 | # and then try again. | ||||||||||||||||||||
| 87 | 'IB007' => $Sisimai::Eb::ReRATE, | ||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | # - 421 Server temporarily unavailable. Try again later. IB101 | ||||||||||||||||||||
| 90 | # - The email queue is experiencing higher than normal email volume. | ||||||||||||||||||||
| 91 | # - Try again later. | ||||||||||||||||||||
| 92 | 'IB101' => $Sisimai::Eb::ReRATE, | ||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | # - 554 This IP has been temporarily blocked for attempting to send too many messages | ||||||||||||||||||||
| 95 | # containing content judged to be spam by the Internet community. IB110 | ||||||||||||||||||||
| 96 | # - This IP address has attempted to send too many messages containing content judged to be | ||||||||||||||||||||
| 97 | # spam and has been blocked for an hour. | ||||||||||||||||||||
| 98 | # - If you're not sending spam, you'll need to contact your Internet Service Provider (ISP) | ||||||||||||||||||||
| 99 | # to see why your IP address is sending so many emails. Something in your system is | ||||||||||||||||||||
| 100 | # causing the issue, and you'll need to troubleshoot. | ||||||||||||||||||||
| 101 | 'IB110' => $Sisimai::Eb::ReBLOC, | ||||||||||||||||||||
| 102 | |||||||||||||||||||||
| 103 | # - 554 This IP has been blocked for the day, for attempting to send too many messages | ||||||||||||||||||||
| 104 | # containing content judged to be spam by the Internet community. IB111 | ||||||||||||||||||||
| 105 | # - This IP address has attempted to send too many messages containing content judged to be | ||||||||||||||||||||
| 106 | # spam and has been blocked for the remainder of the day. | ||||||||||||||||||||
| 107 | 'IB111' => $Sisimai::Eb::ReBLOC, | ||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | # - 554 This IP has been temporarily blocked for attempting to mail too many invalid | ||||||||||||||||||||
| 110 | # recipients. IB112 | ||||||||||||||||||||
| 111 | # - This IP address has attempted to email too many invalid recipients and has been blocked | ||||||||||||||||||||
| 112 | # for an hour. | ||||||||||||||||||||
| 113 | 'IB112' => $Sisimai::Eb::ReBLOC, | ||||||||||||||||||||
| 114 | |||||||||||||||||||||
| 115 | # - 554 This IP has been blocked for the day, for attempting to mail too many invalid | ||||||||||||||||||||
| 116 | # recipients. IB113 | ||||||||||||||||||||
| 117 | # - This IP address has attempted to email too many invalid recipients and has been blocked | ||||||||||||||||||||
| 118 | # for the remainder of the day. | ||||||||||||||||||||
| 119 | 'IB113' => $Sisimai::Eb::ReBLOC, | ||||||||||||||||||||
| 120 | |||||||||||||||||||||
| 121 | # - 550 This IP has sent too many messages this hour. IB504 | ||||||||||||||||||||
| 122 | # - This IP address has reached the maximum allowed messages for that hour. | ||||||||||||||||||||
| 123 | 'IB504' => $Sisimai::Eb::ReRATE, | ||||||||||||||||||||
| 124 | |||||||||||||||||||||
| 125 | # - 550 This message has exceeded the max number of messages per session. Open a new session | ||||||||||||||||||||
| 126 | # and try again. IB510 | ||||||||||||||||||||
| 127 | # - This IP address has reached the maximum allowed messages for that session. | ||||||||||||||||||||
| 128 | 'IB510' => $Sisimai::Eb::ReRATE, | ||||||||||||||||||||
| 129 | |||||||||||||||||||||
| 130 | # - 550 This IP has sent too many to too many recipients this hour. IB607 | ||||||||||||||||||||
| 131 | # - This IP address has reached the maximum allowed recipients for that hour. | ||||||||||||||||||||
| 132 | 'IB607' => $Sisimai::Eb::ReRATE, | ||||||||||||||||||||
| 133 | |||||||||||||||||||||
| 134 | # Remote block list (RBL) bounces | ||||||||||||||||||||
| 135 | # ----------------------------------------------------------------------------------------- | ||||||||||||||||||||
| 136 | # - 554 Connection refused. This IP has a poor reputation on Cloudmark Sender Intelligence | ||||||||||||||||||||
| 137 | # (CSI). IB103 | ||||||||||||||||||||
| 138 | # - This IP address has a poor reputation on Cloudmark Sender Intelligence (CSI). | ||||||||||||||||||||
| 139 | 'IB103' => $Sisimai::Eb::ReFAMA, | ||||||||||||||||||||
| 140 | |||||||||||||||||||||
| 141 | # - 554 Connection refused. This IP address is listed on the Spamhaus Block List (SBL). IB104 | ||||||||||||||||||||
| 142 | # - This IP address is listed on the Spamhaus Block List. | ||||||||||||||||||||
| 143 | 'IB104' => $Sisimai::Eb::ReBLOC, | ||||||||||||||||||||
| 144 | |||||||||||||||||||||
| 145 | # - 554 Connection refused. This IP address is listed on the Exploits Block List (XBL). IB105 | ||||||||||||||||||||
| 146 | # - This IP address is listed on the Spamhaus Exploits Block List. | ||||||||||||||||||||
| 147 | 'IB105' => $Sisimai::Eb::ReBLOC, | ||||||||||||||||||||
| 148 | |||||||||||||||||||||
| 149 | # - 554 Connection refused. This IP address is listed on the Policy Block List (PBL). IB106 | ||||||||||||||||||||
| 150 | # - This IP address is listed on the Spamhaus Policy Block List. | ||||||||||||||||||||
| 151 | 'IB106' => $Sisimai::Eb::ReBLOC, | ||||||||||||||||||||
| 152 | }; | ||||||||||||||||||||
| 153 | 19 | state $messagesof = { | |||||||||||||||||||
| 154 | $Sisimai::Eb::ReAUTH => [ | ||||||||||||||||||||
| 155 | # - 550 SPF Sender Invalid - envelope rejected | ||||||||||||||||||||
| 156 | # - 550 5.7.9: This mail has been blocked because the sender is unauthenticated | ||||||||||||||||||||
| 157 | # - 550-5.7.26 DKIM = did not pass | ||||||||||||||||||||
| 158 | "spf sender invalid - envelope rejected", | ||||||||||||||||||||
| 159 | "this mail has been blocked because the sender is unauthenticated", | ||||||||||||||||||||
| 160 | "dkim = did not pass", | ||||||||||||||||||||
| 161 | ], | ||||||||||||||||||||
| 162 | $Sisimai::Eb::ReBLOC => [ | ||||||||||||||||||||
| 163 | # - 554 RBL Reject. | ||||||||||||||||||||
| 164 | # - This IP address was blocked from our internal RBL. | ||||||||||||||||||||
| 165 | # - Use the link provided in the bounceback to submit a request to remove this IP address. | ||||||||||||||||||||
| 166 | 'rbl reject', | ||||||||||||||||||||
| 167 | 'www.spamhaus.org/query/bl?ip=' | ||||||||||||||||||||
| 168 | ], | ||||||||||||||||||||
| 169 | $Sisimai::Eb::ReTIME => [ | ||||||||||||||||||||
| 170 | # - 451 Sorry, I wasn't able to establish an SMTP connection. I'm not going to try again; | ||||||||||||||||||||
| 171 | # this message has been in the queue too long. | ||||||||||||||||||||
| 172 | # - The recipient's email address has been misspelled or the recipient's email provider | ||||||||||||||||||||
| 173 | # has blocked sending from your address. | ||||||||||||||||||||
| 174 | 'has been in the queue too long', | ||||||||||||||||||||
| 175 | |||||||||||||||||||||
| 176 | # - Delivery timeout | ||||||||||||||||||||
| 177 | # - This could happen for several reasons. | ||||||||||||||||||||
| 178 | 'delivery timeout', | ||||||||||||||||||||
| 179 | ], | ||||||||||||||||||||
| 180 | $Sisimai::Eb::ReFULL => [ | ||||||||||||||||||||
| 181 | # - Account storage limit | ||||||||||||||||||||
| 182 | # - The recipient's account has reached its storage limit and can't receive email right | ||||||||||||||||||||
| 183 | # now. | ||||||||||||||||||||
| 184 | # - The recipient needs to delete messages from their inbox or the receiving folder to | ||||||||||||||||||||
| 185 | # make space for more email. | ||||||||||||||||||||
| 186 | 'account storage limit', | ||||||||||||||||||||
| 187 | ], | ||||||||||||||||||||
| 188 | $Sisimai::Eb::RePASS => [ | ||||||||||||||||||||
| 189 | # - 550 5.7.1: Relay access denied | ||||||||||||||||||||
| 190 | "relay access denied", | ||||||||||||||||||||
| 191 | ], | ||||||||||||||||||||
| 192 | $Sisimai::Eb::ReRATE => [ | ||||||||||||||||||||
| 193 | # - 550 5.7.232 Your message can't be sent because your trial tenant has exceeded | ||||||||||||||||||||
| 194 | # its daily limit for sending email to external recipients (tenant external recipient rate limit) | ||||||||||||||||||||
| 195 | # - 550 5.7.233 - Your message can't be sent because your tenant exceeded its daily | ||||||||||||||||||||
| 196 | # limit for sending email to external recipients (tenant external recipient rate limit) | ||||||||||||||||||||
| 197 | "exceeded its daily limit", | ||||||||||||||||||||
| 198 | ], | ||||||||||||||||||||
| 199 | $Sisimai::Eb::ReFROM => [ | ||||||||||||||||||||
| 200 | # - 550 5.1.8 Access denied, bad outbound sender AS (42004) | ||||||||||||||||||||
| 201 | "bad outbound sender as (42004)", | ||||||||||||||||||||
| 202 | ], | ||||||||||||||||||||
| 203 | $Sisimai::Eb::ReSAFE => [ | ||||||||||||||||||||
| 204 | # - 550 Please turn on SMTP Authentication in your mail client | ||||||||||||||||||||
| 205 | "turn on smtp authentication in your mail client", | ||||||||||||||||||||
| 206 | ], | ||||||||||||||||||||
| 207 | $Sisimai::Eb::ReSPAM => [ | ||||||||||||||||||||
| 208 | # - 552 Message rejected for spam or virus content | ||||||||||||||||||||
| 209 | # - The email message contains a link, attachment, or pattern caught by our filters as spam. | ||||||||||||||||||||
| 210 | 'message rejected for spam or virus content', | ||||||||||||||||||||
| 211 | ], | ||||||||||||||||||||
| 212 | $Sisimai::Eb::ReQUIT => [ | ||||||||||||||||||||
| 213 | # - Account disabled | ||||||||||||||||||||
| 214 | # - The recipient account exists but its ability to receive mail was disabled. | ||||||||||||||||||||
| 215 | # - Typically, these accounts remain permanently disabled, but you can try sending the | ||||||||||||||||||||
| 216 | # email again later. | ||||||||||||||||||||
| 217 | 'account disabled', | ||||||||||||||||||||
| 218 | ], | ||||||||||||||||||||
| 219 | $Sisimai::Eb::RePROC => [ | ||||||||||||||||||||
| 220 | # - This message is looping: it already has my Delivered-To line. (#5.4.6) | ||||||||||||||||||||
| 221 | # - The recipient account is forwarding the message in a loop. | ||||||||||||||||||||
| 222 | # - This is oftentimes because the receiver has two addresses that forward to each | ||||||||||||||||||||
| 223 | # other. They need to correct their forwarding settings. | ||||||||||||||||||||
| 224 | 'message is looping', | ||||||||||||||||||||
| 225 | ], | ||||||||||||||||||||
| 226 | $Sisimai::Eb::ReUSER => [ | ||||||||||||||||||||
| 227 | # - 550 Recipient not found | ||||||||||||||||||||
| 228 | # - The recipient is not a valid email address. | ||||||||||||||||||||
| 229 | # - Remove the invalid recipient from your email. | ||||||||||||||||||||
| 230 | 'recipient not found', | ||||||||||||||||||||
| 231 | |||||||||||||||||||||
| 232 | # - Account does not exist | ||||||||||||||||||||
| 233 | # - The email address that you sent to does not exist. | ||||||||||||||||||||
| 234 | # - Verify that the recipient email address was entered correctly. | ||||||||||||||||||||
| 235 | 'account does not exist' | ||||||||||||||||||||
| 236 | ], | ||||||||||||||||||||
| 237 | }; | ||||||||||||||||||||
| 238 | |||||||||||||||||||||
| 239 | 19 | my $issuedcode = $argvs->{'diagnosticcode'}; | |||||||||||||||||||
| 240 | 19 | my $positionib = index($issuedcode, ' IB'); | |||||||||||||||||||
| 241 | 19 | my $reasontext = ''; | |||||||||||||||||||
| 242 | |||||||||||||||||||||
| 243 | # 192.0.2.22 has sent to too many recipients this hour. IB607 ... | ||||||||||||||||||||
| 244 | 19 | ▶ | $reasontext = $errorcodes->{ substr($issuedcode, $positionib + 1, 5) } || '' if $positionib > 1; | ||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$errorcodes{substr $issuedcode, $positionib + 1, 5} || ''
MC/DC0%0/1
$$errorcodes{substr $issuedcode, $positionib + 1, 5} || ''
$$errorcodes{substr $issuedcode, $positionib + 1, 5}
Truth table50%1/2
A
A= $$errorcodes{substr $issuedcode, $positionib + 1, 5}
| |||||||||||||||||||||
| 245 | 19 | ▶ | return $reasontext if length $reasontext; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 246 | |||||||||||||||||||||
| 247 | 8 | $issuedcode = lc $issuedcode; | |||||||||||||||||||
| 248 | 8 | for my $e ( keys %$messagesof ) { | |||||||||||||||||||
| 249 | # Try to find the error message matches with the given error message string | ||||||||||||||||||||
| 250 | 74 | ▶ | next unless grep { index($issuedcode, $_) > -1 } $messagesof->{ $e }->@*; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 251 | 6 | $reasontext = $e; | |||||||||||||||||||
| 252 | 6 | last; | |||||||||||||||||||
| 253 | } | ||||||||||||||||||||
| 254 | 8 | return $reasontext; | |||||||||||||||||||
| 255 | } | ||||||||||||||||||||
| 256 | |||||||||||||||||||||
| 257 | 5 | 1; | |||||||||||||||||||
| 258 | __END__ | ||||||||||||||||||||