Sisimai/Rhost/FrancePTT.pm

filter: Statementstmt 93.3% 28 / 30 Branchbran 87.5% 7 / 8 Conditioncond 100% 5 / 5 MC/DCmcdc 100% 3 / 3 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 92.1% 47 / 51 CC 8 SCAR 18.1
CC
8
Cov
93%
find
8.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.1
« Sisimai/Rhost/Cox.pm ↑ Summary Sisimai/Rhost/GoDaddy.pm »
1 package Sisimai::Rhost::FrancePTT;
2 8 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 91 ▶sub find {
Subroutine find: called CC=8 SCAR=20.8
Pod undocumented
7 # Detect bounce reason from Orange and La Poste
8 # @param [Sisimai::Fact] argvs Decdoed email object
9 # @return [String] The bounce reason for Orange, La Poste
10 # @see
11 # - Orange Postmaster Page: https://postmaster.orange.fr/index.html
12 # - https://www.postmastery.com/orange-postmaster-smtp-error-codes-ofr/
13 # - https://smtpfieldmanual.com/provider/orange
14 # @since v4.22.3
15 91 my $class = shift;
16 91 ▶ my $argvs = shift // return ""; return "" unless $argvs->{'diagnosticcode'};
Branch: 1 branch
BranchTrueFalseTotal
unless $argvs->{"diagnosticcode"} 6 84 90
Condition100%2/2
shift() // (return "")
l!l
901
MC/DC100%1/1
shift() // (return "")
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
17  
18 84 require Sisimai::Eb;
19 84 state $errorcodes = {
20 # - Your sending IP is listed on Abusix RBL
21 # Please visit: https://lookup.abusix.com/search?q=$IP
22 "100" => $Sisimai::Eb::ReBLOC,
23  
24 # - Your sending IP is listed by SpamHaus RBL
25 # Please visit: https://check.spamhaus.org/listed/?searchterm=$IP
26 # - 550 5.7.1 Service unavailable; client [192.0.2.1] blocked using Spamhaus
27 # Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos services.
28 # Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien ci-dessous
29 # et a suivre la procedure.
30 # - The emails sent to the mail host Laposte.net were blocked by our services. To regularize
31 # your situation please click on the link below and follow the procedure
32 # https://www.spamhaus.org/lookup/ LPNAAA_101 (in reply to RCPT TO command))
33 '101' => $Sisimai::Eb::ReBLOC,
34  
35 # - Your sending IP is listed by Cloudmark RBL
36 # Please visit: https://csi.cloudmark.com/reset-request/?ip=$IP#
37 # - 550 mwinf5c04 ME Adresse IP source bloquee pour incident de spam.
38 # - Client host blocked for spamming issues. OFR006_102 Ref http://csi.cloudmark.com ...
39 # - 550 5.5.0 Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos
40 # services. Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien
41 # ci-dessous et a suivre la procedure.
42 # - The emails sent to the mail host Laposte.net were blocked by our services. To regularize
43 # your situation please click on the link below and follow the procedure
44 # https://senderscore.org/blacklistlookup/ LPN007_102
45 '102' => $Sisimai::Eb::ReBLOC,
46  
47 # - Your sending IP has been blacklisted by Orange
48 # Please contact Orange by using our contact form and select option
49 # "Un problème d'envoi d'emails vers les adresses Orange ou Wanadoo (deliverability issue)"
50 # - 550 mwinf5c10 ME Service refuse. Veuillez essayer plus tard.
51 # - Service refused, please try later. OFR006_103 192.0.2.1 [103]
52 '103' => $Sisimai::Eb::ReBLOC,
53  
54 # - 421 mwinf5c79 ME Trop de connexions, veuillez verifier votre configuration.
55 # - Too many connections, slow down. OFR005_104 [104]
56 # - Too many connections, slow down. LPN105_104
57 '104' => $Sisimai::Eb::ReRATE,
58  
59 # - Your IP address is missing a DNS PTR record, it also called a rDNS (reverse DNS)
60 # Please set up a valid DNS PTR record for your IP address that point to your domain,
61 # It's important that the sending IP address must match the IP address of the hostname
62 # defined in the PTR record
63 # - Service refused, please try later. LPN006_107
64 "107" => $Sisimai::Eb::ReQPTR,
65  
66 # - You are sending too many messages per SMTP connection
67 # Please reduce the number of messages per connection, recommended value is 100
68 # messages per connections
69 # - Veuillez essayer plus tard. LPN003_109
70 "109" => $Sisimai::Eb::ReRATE,
71  
72 # - Invalid HELO/EHLO
73 # Please set up a valid HELO/EHLO, it must be fully qualified domain name (FQDN) and
74 # should resolve (DNS record needed). E.g.: "mail.yourdomain.com"
75 # - Veuillez essayer plus tard. OFR004_201
76 "201" => $Sisimai::Eb::ReBLOC,
77 "20X" => $Sisimai::Eb::ReBLOC,
78  
79 # - Sender's Domain name SPF Error
80 # Please verify your mail from domain name DNS/TXT configuration for your SPF
81 # configuration. Please visit https://mxtoolbox.com/supertool3?action=spf:$YOUR_DOMAIN
82 # to check your domain. (replace $YOUR_DOMAIN by your sender domain name)
83 # Please note:
84 # If you have changed your DNS record recently, please let DNS caches expire (TTL)
85 "39X" => $Sisimai::Eb::ReAUTH,
86  
87 # - Sender's Domain DNS Error
88 # Please verify your mail from domain name DNS configuration. Your domain name must
89 # have valid A or MX records. You can check your DNS configuration on MxToolBox
90 # Please note:
91 # If you have changed your DNS record recently, please let DNS caches expire (TTL)
92 # - 5.0.1 Emetteur invalide. Invalid Sender. LPN105_405
93 # - 501 5.1.0 Emetteur invalide. Invalid Sender. OFR004_405 [405] (in reply to MAIL FROM command))
94 '405' => $Sisimai::Eb::ReFROM,
95  
96 # - Your Sender has been rejected
97 # Please contact Orange by using our contact form and select option
98 # "Un problème d'envoi d'emails vers les adresses Orange ou Wanadoo (deliverability issue)"
99 "406" => $Sisimai::Eb::ReFROM,
100  
101 # - User doesn't exist here
102 # Please remove this email address from your distribution list, it does not exist
103 # - 550 5.1.1 Adresse d au moins un destinataire invalide.
104 # - Invalid recipient. LPN416 (in reply to RCPT TO command)
105 # - Invalid recipient. OFR_416 [416] (in reply to RCPT TO command)
106 '416' => $Sisimai::Eb::ReUSER,
107  
108 # - 552 5.1.1 Boite du destinataire pleine.
109 # - Recipient overquota. OFR_417 [417] (in reply to RCPT TO command))
110 '417' => $Sisimai::Eb::ReFULL,
111  
112 # - 550 5.5.0 Boite du destinataire archivee.
113 # - Archived recipient. LPN007_420 (in reply to RCPT TO command)
114 '420' => $Sisimai::Eb::ReQUIT,
115  
116 # - Your sender domain name has been blacklisted
117 # Your sender domain name has been blacklisted by Abusix OR SpamHaus, Please visit:
118 # - https://lookup.abusix.com/search?q=$YOUR_DOMAIN
119 # - https://check.spamhaus.org/listed/?searchterm=$YOUR_DOMAIN
120 "425" => $Sisimai::Eb::ReFROM,
121  
122 # - 550 5.5.0 Le compte du destinataire est bloque. The recipient account isblocked.
123 # LPN007_426 (in reply to RCPT TO command)
124 '426' => $Sisimai::Eb::ReQUIT,
125  
126 # - 421 4.2.0 Service refuse. Veuillez essayer plus tard. Service refused, please try later.
127 # OFR005_505 [505] (in reply to end of DATA command)
128 # - 421 4.2.1 Service refuse. Veuillez essayer plus tard. Service refused, please try later.
129 # LPN007_505 (in reply to end of DATA command)
130 '505' => $Sisimai::Eb::RePROC,
131  
132 # - Your message has been blocked by Orange, suspected spam
133 # Please contact Orange by using our contact form and select option
134 # "Un problème d'envoi d'emails vers les adresses Orange ou Wanadoo (deliverability issue)"
135 # - Mail rejete. Mail rejected. OFR_506 [506]
136 '506' => $Sisimai::Eb::ReSPAM,
137  
138 # - 550 5.5.0 Service refuse. Veuillez essayer plus tard. service refused, please try later.
139 # LPN005_510 (in reply to end of DATA command)
140 '510' => $Sisimai::Eb::ReBLOC,
141  
142 # - DMARC authentication failed, message rejected as defined by your DMARC policy
143 # Please check your SPF/DKIM/DMARC configuration. Please visit MxToolBox DMARC to
144 # check your domain configuration
145 "515" => $Sisimai::Eb::ReAUTH,
146  
147 # - 571 5.7.1 Message refused, DMARC verification Failed.
148 # - Message refuse, verification DMARC en echec LPN007_517
149 '517' => $Sisimai::Eb::ReAUTH,
150  
151 # - The sending IP address is not authorized to send messages for your domain as defined
152 # in the sender's Domain name SPF configuration (DNS/TXT)
153 # Please verify your mail from domain name DNS/TXT configuration for your SPF configuration.
154 # Please visit https://mxtoolbox.com/supertool3?action=spf:$YOUR_DOMAIN to check your
155 # domain. (replace $YOUR_DOMAIN by your sender domain name)
156 "519" => $Sisimai::Eb::ReAUTH,
157  
158 # - Due to bad behavior you have been rate limited, please try again later
159 # Due to inappropriate behavior, you have been rate limited. Please check what you
160 # are trying to send
161 # - 421 mwinf5c77 ME Service refuse. Veuillez essayer plus tard. Service refused, please try
162 # later. OFR_999 [999]
163 "99X" => $Sisimai::Eb::ReRATE,
164  
165 # Other undocumented or old error codes
166 "105" => "", # Veuillez essayer plus tard.
167 "108" => "", # service refused, please try later. LPN001_108
168 "305" => $Sisimai::Eb::ReSAFE, # 550 5.7.0 Code d'authentification invalide OFR_305
169 "401" => $Sisimai::Eb::ReAUTH, # 550 5.5.0 SPF: *** is not allowed to send mail. LPN004_401
170 "402" => $Sisimai::Eb::ReSAFE, # 550 5.5.0 Authentification requise. Authentication Required. LPN105_402
171 "403" => $Sisimai::Eb::ReFROM, # 5.0.1 Emetteur invalide. Invalid Sender.
172 "415" => $Sisimai::Eb::ReFROM, # Emetteur invalide. Invalid Sender. OFR_415
173 "421" => $Sisimai::Eb::ReFROM, # 5.5.3 Mail from not owned by user. LPN105_421.
174 "423" => "", # Service refused, please try later. LPN105_423
175 "424" => "", # Veuillez essayer plus tard. LPN105_424
176 "513" => "", # Mail rejete. Mail rejected. OUK_513
177 "514" => $Sisimai::Eb::ReSIZE, # Taille limite du message atteinte
178 "630" => $Sisimai::Eb::ReWONT, # 554 5.7.1 Client host rejected LPN000_630
179 };
180 84 state $messagesof = {
181 $Sisimai::Eb::ReAUTH => [
182 # - 421 smtp.orange.fr [192.0.2.1] Emetteur invalide, Veuillez verifier la configuration
183 # SPF/DNS de votre nom de domaine. Invalid Sender. SPF check failed, please verify the
184 # SPF/DNS configuration for your domain name.
185 'spf/dns de votre nom de domaine',
186 ],
187 };
188 84 my $issuedcode = $argvs->{'diagnosticcode'};
189 84 my $reasontext = '';
190  
191 84 ▶ if( $issuedcode =~ /\b(LPN|LPNAAA|OFR|OUK)(_[0-9]{3}|[0-9]{3}[-_][0-9]{3})\b/i ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($issuedcode =~ /\b(LPN|LPNAAA|OFR|OUK)(_[0-9]{3}|[0-9]{3}[-_][0-9]{3})\b/iu) 82 2 84
192 # OUK_513, LPN105-104, OFR102-104, ofr_506
193 82 my $v = sprintf("%03d", substr($1.$2, -3, 3));
194 82 my $x = $v; $x =~ s/.\z/X/;
195 82 ▶ $reasontext = $errorcodes->{ $v } || $errorcodes->{ $x };
Condition100%3/3
$errorcodes->{$v} || $errorcodes->{$x}
l!l&&r!l&&!r
7066
MC/DC100%2/2
$errorcodes->{$v} || $errorcodes->{$x}
$errorcodes->{$v} $errorcodes->{$x}
Truth table100%3/3
A || B
A= $errorcodes->{$v}B= $errorcodes->{$x}
ABresult
1X1
011
000
196 }
197 84 ▶ return $reasontext if length $reasontext;
Branch: 1 branch
BranchTrueFalseTotal
if length $reasontext 76 8 84
198  
199 8 $issuedcode = lc $issuedcode;
200 8 for my $e ( keys %$messagesof ) {
201 # Try to find the error message matches with the given error message string
202 8 ▶ next unless grep { index($issuedcode, $_) > -1 } $messagesof->{ $e }->@*;
Branch: 1 branch
BranchTrueFalseTotal
unless grep {index($issuedcode, $_) != -1;} @{$$messagesof{$e}} 8 0 8
203 0 $reasontext = $e;
204 0 last;
205 }
206 8 return $reasontext;
207 }
208  
209 8 1;
210 __END__
« Sisimai/Rhost/Cox.pm ↑ Summary Sisimai/Rhost/GoDaddy.pm »