sisimai 5.0.3-java → 5.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codecovio.yml +3 -1
  3. data/.github/workflows/rake-test.yml +6 -2
  4. data/ChangeLog.md +34 -0
  5. data/README-JA.md +20 -17
  6. data/README.md +20 -17
  7. data/lib/sisimai/arf.rb +3 -3
  8. data/lib/sisimai/fact/json.rb +2 -2
  9. data/lib/sisimai/fact/yaml.rb +2 -2
  10. data/lib/sisimai/fact.rb +4 -19
  11. data/lib/sisimai/lhost/activehunter.rb +4 -3
  12. data/lib/sisimai/lhost/amavis.rb +4 -4
  13. data/lib/sisimai/lhost/amazonses.rb +6 -6
  14. data/lib/sisimai/lhost/amazonworkmail.rb +4 -4
  15. data/lib/sisimai/lhost/aol.rb +4 -4
  16. data/lib/sisimai/lhost/apachejames.rb +4 -4
  17. data/lib/sisimai/lhost/barracuda.rb +4 -4
  18. data/lib/sisimai/lhost/bigfoot.rb +4 -4
  19. data/lib/sisimai/lhost/biglobe.rb +4 -4
  20. data/lib/sisimai/lhost/courier.rb +4 -4
  21. data/lib/sisimai/lhost/domino.rb +4 -4
  22. data/lib/sisimai/lhost/dragonfly.rb +114 -0
  23. data/lib/sisimai/lhost/einsundeins.rb +4 -4
  24. data/lib/sisimai/lhost/exchange2003.rb +4 -3
  25. data/lib/sisimai/lhost/exchange2007.rb +4 -3
  26. data/lib/sisimai/lhost/exim.rb +4 -4
  27. data/lib/sisimai/lhost/ezweb.rb +4 -4
  28. data/lib/sisimai/lhost/facebook.rb +4 -4
  29. data/lib/sisimai/lhost/fml.rb +4 -4
  30. data/lib/sisimai/lhost/gmail.rb +4 -4
  31. data/lib/sisimai/lhost/gmx.rb +4 -4
  32. data/lib/sisimai/lhost/googlegroups.rb +4 -4
  33. data/lib/sisimai/lhost/gsuite.rb +4 -4
  34. data/lib/sisimai/lhost/imailserver.rb +4 -3
  35. data/lib/sisimai/lhost/interscanmss.rb +5 -4
  36. data/lib/sisimai/lhost/kddi.rb +4 -4
  37. data/lib/sisimai/lhost/mailfoundry.rb +4 -4
  38. data/lib/sisimai/lhost/mailmarshalsmtp.rb +5 -4
  39. data/lib/sisimai/lhost/mailru.rb +4 -4
  40. data/lib/sisimai/lhost/mcafee.rb +4 -4
  41. data/lib/sisimai/lhost/messagelabs.rb +4 -3
  42. data/lib/sisimai/lhost/messagingserver.rb +5 -4
  43. data/lib/sisimai/lhost/mfilter.rb +4 -4
  44. data/lib/sisimai/lhost/mxlogic.rb +3 -3
  45. data/lib/sisimai/lhost/notes.rb +4 -4
  46. data/lib/sisimai/lhost/office365.rb +4 -4
  47. data/lib/sisimai/lhost/opensmtpd.rb +9 -7
  48. data/lib/sisimai/lhost/outlook.rb +4 -4
  49. data/lib/sisimai/lhost/postfix.rb +4 -4
  50. data/lib/sisimai/lhost/powermta.rb +4 -4
  51. data/lib/sisimai/lhost/qmail.rb +10 -10
  52. data/lib/sisimai/lhost/receivingses.rb +4 -4
  53. data/lib/sisimai/lhost/sendgrid.rb +4 -4
  54. data/lib/sisimai/lhost/sendmail.rb +4 -4
  55. data/lib/sisimai/lhost/surfcontrol.rb +4 -4
  56. data/lib/sisimai/lhost/v5sendmail.rb +5 -4
  57. data/lib/sisimai/lhost/verizon.rb +4 -4
  58. data/lib/sisimai/lhost/x1.rb +3 -3
  59. data/lib/sisimai/lhost/x2.rb +3 -3
  60. data/lib/sisimai/lhost/x3.rb +3 -3
  61. data/lib/sisimai/lhost/x4.rb +3 -3
  62. data/lib/sisimai/lhost/x5.rb +3 -3
  63. data/lib/sisimai/lhost/x6.rb +3 -3
  64. data/lib/sisimai/lhost/yahoo.rb +4 -4
  65. data/lib/sisimai/lhost/yandex.rb +4 -4
  66. data/lib/sisimai/lhost/zoho.rb +4 -4
  67. data/lib/sisimai/lhost.rb +5 -5
  68. data/lib/sisimai/mail/maildir.rb +1 -1
  69. data/lib/sisimai/mail/stdin.rb +1 -1
  70. data/lib/sisimai/mda.rb +3 -3
  71. data/lib/sisimai/message.rb +8 -8
  72. data/lib/sisimai/order.rb +1 -0
  73. data/lib/sisimai/reason/badreputation.rb +1 -1
  74. data/lib/sisimai/reason/norelaying.rb +1 -0
  75. data/lib/sisimai/reason/rejected.rb +1 -0
  76. data/lib/sisimai/reason.rb +8 -8
  77. data/lib/sisimai/rfc3464.rb +3 -3
  78. data/lib/sisimai/rfc3834.rb +2 -2
  79. data/lib/sisimai/rhost/apple.rb +92 -0
  80. data/lib/sisimai/rhost/cox.rb +81 -32
  81. data/lib/sisimai/rhost/franceptt.rb +84 -81
  82. data/lib/sisimai/rhost/godaddy.rb +205 -43
  83. data/lib/sisimai/rhost/google.rb +3 -5
  84. data/lib/sisimai/rhost/iua.rb +2 -2
  85. data/lib/sisimai/rhost/kddi.rb +6 -5
  86. data/lib/sisimai/rhost/microsoft.rb +4 -5
  87. data/lib/sisimai/rhost/mimecast.rb +15 -4
  88. data/lib/sisimai/rhost/nttdocomo.rb +1 -1
  89. data/lib/sisimai/rhost/spectrum.rb +100 -40
  90. data/lib/sisimai/rhost/tencent.rb +46 -25
  91. data/lib/sisimai/rhost/yahooinc.rb +110 -0
  92. data/lib/sisimai/rhost.rb +28 -35
  93. data/lib/sisimai/smtp/reply.rb +4 -3
  94. data/lib/sisimai/smtp/transcript.rb +3 -3
  95. data/lib/sisimai/version.rb +1 -1
  96. data/lib/sisimai.rb +0 -6
  97. data/set-of-emails/maildir/bsd/lhost-dragonfly-01.eml +36 -0
  98. data/set-of-emails/maildir/bsd/lhost-dragonfly-02.eml +32 -0
  99. data/set-of-emails/maildir/bsd/lhost-dragonfly-03.eml +32 -0
  100. data/set-of-emails/maildir/bsd/lhost-dragonfly-04.eml +31 -0
  101. data/set-of-emails/maildir/bsd/lhost-dragonfly-05.eml +32 -0
  102. data/set-of-emails/maildir/bsd/lhost-dragonfly-06.eml +32 -0
  103. data/set-of-emails/maildir/bsd/lhost-dragonfly-07.eml +32 -0
  104. data/set-of-emails/maildir/bsd/lhost-dragonfly-08.eml +32 -0
  105. data/set-of-emails/maildir/bsd/lhost-dragonfly-09.eml +32 -0
  106. data/set-of-emails/maildir/bsd/lhost-dragonfly-10.eml +32 -0
  107. data/set-of-emails/maildir/bsd/lhost-dragonfly-11.eml +32 -0
  108. data/set-of-emails/maildir/bsd/lhost-dragonfly-12.eml +32 -0
  109. data/set-of-emails/maildir/bsd/lhost-dragonfly-13.eml +32 -0
  110. data/set-of-emails/maildir/bsd/lhost-dragonfly-14.eml +32 -0
  111. data/set-of-emails/maildir/bsd/lhost-dragonfly-15.eml +32 -0
  112. data/set-of-emails/maildir/bsd/lhost-dragonfly-16.eml +32 -0
  113. data/set-of-emails/maildir/bsd/lhost-dragonfly-17.eml +32 -0
  114. data/set-of-emails/maildir/bsd/lhost-dragonfly-18.eml +32 -0
  115. data/set-of-emails/maildir/bsd/lhost-dragonfly-19.eml +32 -0
  116. data/set-of-emails/maildir/bsd/lhost-dragonfly-20.eml +32 -0
  117. data/set-of-emails/maildir/bsd/lhost-dragonfly-21.eml +33 -0
  118. data/set-of-emails/maildir/bsd/lhost-dragonfly-22.eml +32 -0
  119. data/set-of-emails/maildir/bsd/lhost-dragonfly-23.eml +32 -0
  120. data/set-of-emails/maildir/bsd/lhost-dragonfly-24.eml +32 -0
  121. data/set-of-emails/maildir/bsd/lhost-dragonfly-25.eml +33 -0
  122. data/set-of-emails/maildir/bsd/lhost-dragonfly-26.eml +33 -0
  123. data/set-of-emails/maildir/bsd/lhost-dragonfly-27.eml +47 -0
  124. data/set-of-emails/maildir/bsd/lhost-dragonfly-28.eml +47 -0
  125. data/set-of-emails/maildir/bsd/lhost-dragonfly-29.eml +32 -0
  126. data/set-of-emails/maildir/bsd/lhost-dragonfly-30.eml +32 -0
  127. data/set-of-emails/maildir/bsd/lhost-opensmtpd-10.eml +58 -0
  128. data/set-of-emails/maildir/bsd/lhost-opensmtpd-11.eml +58 -0
  129. data/set-of-emails/maildir/bsd/lhost-opensmtpd-12.eml +62 -0
  130. data/set-of-emails/maildir/bsd/lhost-opensmtpd-13.eml +62 -0
  131. data/set-of-emails/maildir/bsd/lhost-opensmtpd-14.eml +58 -0
  132. data/set-of-emails/maildir/bsd/lhost-opensmtpd-15.eml +63 -0
  133. data/set-of-emails/maildir/bsd/lhost-opensmtpd-16.eml +62 -0
  134. data/set-of-emails/maildir/bsd/lhost-opensmtpd-17.eml +63 -0
  135. data/set-of-emails/maildir/bsd/lhost-qmail-11.eml +29 -0
  136. data/set-of-emails/maildir/bsd/lhost-qmail-12.eml +29 -0
  137. data/set-of-emails/maildir/bsd/lhost-qmail-13.eml +29 -0
  138. data/set-of-emails/maildir/bsd/lhost-qmail-14.eml +34 -0
  139. data/set-of-emails/maildir/bsd/lhost-qmail-15.eml +30 -0
  140. data/set-of-emails/maildir/bsd/lhost-qmail-16.eml +31 -0
  141. data/set-of-emails/maildir/bsd/lhost-qmail-17.eml +38 -0
  142. data/set-of-emails/maildir/bsd/lhost-qmail-18.eml +31 -0
  143. data/set-of-emails/maildir/bsd/lhost-qmail-19.eml +31 -0
  144. data/set-of-emails/maildir/bsd/lhost-qmail-20.eml +46 -0
  145. data/set-of-emails/maildir/bsd/lhost-qmail-21.eml +41 -0
  146. data/set-of-emails/maildir/bsd/lhost-qmail-22.eml +42 -0
  147. data/set-of-emails/maildir/bsd/lhost-qmail-23.eml +43 -0
  148. data/set-of-emails/maildir/bsd/lhost-qmail-24.eml +43 -0
  149. data/set-of-emails/maildir/bsd/lhost-qmail-25.eml +54 -0
  150. data/set-of-emails/maildir/bsd/rhost-apple-01.eml +79 -0
  151. data/set-of-emails/maildir/bsd/rhost-apple-02.eml +81 -0
  152. data/set-of-emails/maildir/bsd/rhost-apple-03.eml +75 -0
  153. data/set-of-emails/maildir/bsd/rhost-apple-04.eml +74 -0
  154. data/set-of-emails/maildir/bsd/rhost-yahooinc-01.eml +80 -0
  155. data/set-of-emails/maildir/bsd/rhost-yahooinc-02.eml +83 -0
  156. data/set-of-emails/maildir/bsd/rhost-yahooinc-03.eml +125 -0
  157. metadata +65 -2
@@ -6,144 +6,147 @@ module Sisimai
6
6
  module FrancePTT
7
7
  class << self
8
8
  ErrorCodes = {
9
- # 550 5.7.1 Service unavailable; client [X.X.X.X] blocked using Spamhaus
10
- # Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos services.
11
- # Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien ci-dessous et a suivre la procedure.
12
- # The emails sent to the mail host Laposte.net were blocked by our services.
13
- # To regularize your situation please click on the link below and follow the procedure
14
- # https://www.spamhaus.org/lookup/ LPNAAA_101 (in reply to RCPT TO command))
9
+ # - 550 5.7.1 Service unavailable; client [192.0.2.1] blocked using Spamhaus
10
+ # Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos services.
11
+ # Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien ci-dessous
12
+ # et a suivre la procedure.
13
+ # - The emails sent to the mail host Laposte.net were blocked by our services. To regularize
14
+ # your situation please click on the link below and follow the procedure
15
+ # https://www.spamhaus.org/lookup/ LPNAAA_101 (in reply to RCPT TO command))
15
16
  '101' => 'blocked',
16
17
 
17
- # 550 mwinf5c04 ME Adresse IP source bloquee pour incident de spam.
18
- # Client host blocked for spamming issues. OFR006_102 Ref
19
- #
20
- # refused to talk to me: 550 5.5.0 Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos services.
21
- # Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien ci-dessous et a suivre la procedure.
22
- # The emails sent to the mail host Laposte.net were blocked by our services.
23
- # To regularize your situation please click on the link below and follow the procedure
24
- # https://senderscore.org/blacklistlookup/ LPN007_102
18
+ # - 550 mwinf5c04 ME Adresse IP source bloquee pour incident de spam.
19
+ # - Client host blocked for spamming issues. OFR006_102 Ref http://csi.cloudmark.com ...
20
+ # - 550 5.5.0 Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos
21
+ # services. Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien
22
+ # ci-dessous et a suivre la procedure.
23
+ # - The emails sent to the mail host Laposte.net were blocked by our services. To regularize
24
+ # your situation please click on the link below and follow the procedure
25
+ # https://senderscore.org/blacklistlookup/ LPN007_102
25
26
  '102' => 'blocked',
26
27
 
27
- # refused to talk to me: 550 mwinf5c10 ME Service refuse. Veuillez essayer plus tard.
28
- # Service refused, please try later. OFR006_103 X.X.X.X [103]
28
+ # - 550 mwinf5c10 ME Service refuse. Veuillez essayer plus tard.
29
+ # - Service refused, please try later. OFR006_103 192.0.2.1 [103]
29
30
  '103' => 'blocked',
30
31
 
31
- # refused to talk to me: 421 mwinf5c79 ME Trop de connexions, veuillez verifier votre configuration.
32
- # Too many connections, slow down. OFR005_104 [104]
33
- # Too many connections, slow down. LPN105_104
32
+ # - 421 mwinf5c79 ME Trop de connexions, veuillez verifier votre configuration.
33
+ # - Too many connections, slow down. OFR005_104 [104]
34
+ # - Too many connections, slow down. LPN105_104
34
35
  '104' => 'toomanyconn',
35
36
 
36
- # Veuillez essayer plus tard.
37
- '105' => nil,
37
+ '105' => nil, # Veuillez essayer plus tard.
38
+ '107' => nil, # Service refused, please try later. LPN006_107
39
+ '108' => nil, # service refused, please try later. LPN001_108
40
+ '109' => nil, # Veuillez essayer plus tard. LPN003_109
41
+ '201' => nil, # Veuillez essayer plus tard. OFR004_201
38
42
 
39
- # refused to talk to me: 421 4.2.1 Service refuse. Veuillez essayer plus tard.
40
- # Service refused, please try later. LPN006_107)
41
- '107' => nil,
42
-
43
- # refused to talk to me: 550 5.5.0 Service refuse. Veuillez essayer plus tard.
44
- # service refused, please try later. LPN001_108
45
- '108' => nil,
46
-
47
- # Veuillez essayer plus tard. LPN003_109
48
- '109' => nil,
49
-
50
- # Veuillez essayer plus tard. OFR004_201
51
- '201' => nil,
52
-
53
- # 550 5.7.0 Code d'authentification invalide OFR_305
43
+ # - 550 5.7.0 Code d'authentification invalide OFR_305
54
44
  '305' => 'securityerror',
55
45
 
56
- # 550 5.5.0 SPF: *** is not allowed to send mail. LPN004_401
57
- '401' => 'blocked',
46
+ # - 550 5.5.0 SPF: *** is not allowed to send mail. LPN004_401
47
+ '401' => 'authfailure',
58
48
 
59
- # 550 5.5.0 Authentification requise. Authentication Required. LPN105_402
49
+ # - 550 5.5.0 Authentification requise. Authentication Required. LPN105_402
60
50
  '402' => 'securityerror',
61
51
 
62
- # 5.0.1 Emetteur invalide. Invalid Sender.
52
+ # - 5.0.1 Emetteur invalide. Invalid Sender.
63
53
  '403' => 'rejected',
64
54
 
65
- # 5.0.1 Emetteur invalide. Invalid Sender. LPN105_405
66
- # 501 5.1.0 Emetteur invalide. Invalid Sender. OFR004_405 [405] (in reply to MAIL FROM command))
55
+ # - 5.0.1 Emetteur invalide. Invalid Sender. LPN105_405
56
+ # - 501 5.1.0 Emetteur invalide. Invalid Sender. OFR004_405 [405] (in reply to MAIL FROM command))
67
57
  '405' => 'rejected',
68
58
 
69
59
  # Emetteur invalide. Invalid Sender. OFR_415
70
60
  '415' => 'rejected',
71
61
 
72
- # 550 5.1.1 Adresse d au moins un destinataire invalide.
73
- # Invalid recipient. LPN416 (in reply to RCPT TO command)
74
- # Invalid recipient. OFR_416 [416] (in reply to RCPT TO command)
62
+ # - 550 5.1.1 Adresse d au moins un destinataire invalide.
63
+ # - Invalid recipient. LPN416 (in reply to RCPT TO command)
64
+ # - Invalid recipient. OFR_416 [416] (in reply to RCPT TO command)
75
65
  '416' => 'userunknown',
76
66
 
77
- # 552 5.1.1 Boite du destinataire pleine.
78
- # Recipient overquota. OFR_417 [417] (in reply to RCPT TO command))
67
+ # - 552 5.1.1 Boite du destinataire pleine.
68
+ # - Recipient overquota. OFR_417 [417] (in reply to RCPT TO command))
79
69
  '417' => 'mailboxfull',
80
70
 
81
- # Adresse d au moins un destinataire invalide
82
- '418' => 'userunknown',
71
+ # - Adresse d au moins un destinataire invalide
83
72
 
84
- # 550 5.5.0 Boite du destinataire archivee.
85
- # Archived recipient. LPN007_420 (in reply to RCPT TO command)
73
+ # - 550 5.5.0 Boite du destinataire archivee.
74
+ # - Archived recipient. LPN007_420 (in reply to RCPT TO command)
86
75
  '420' => 'suspend',
87
76
 
88
- # 5.5.3 Mail from not owned by user. LPN105_421.
77
+ # - 5.5.3 Mail from not owned by user. LPN105_421.
89
78
  '421' => 'rejected',
90
79
 
91
- # Service refused, please try later. LPN105_423
92
- '423' => nil,
80
+ '423' => nil, # Service refused, please try later. LPN105_423
81
+ '424' => nil, # Veuillez essayer plus tard. LPN105_424
93
82
 
94
- # Veuillez essayer plus tard. LPN105_424
95
- '424' => nil,
96
-
97
- # 550 5.5.0 Le compte du destinataire est bloque. The recipient account isblocked. LPN007_426 (in reply to RCPT TO command)
83
+ # - 550 5.5.0 Le compte du destinataire est bloque. The recipient account isblocked.
84
+ # LPN007_426 (in reply to RCPT TO command)
98
85
  '426' => 'suspend',
99
86
 
100
- # 421 4.2.0 Service refuse. Veuillez essayer plus tard.
101
- # Service refused, please try later. OFR005_505 [505] (in reply to end of DATA command)
102
- #
103
- # 421 4.2.1 Service refuse. Veuillez essayer plus tard.
104
- # Service refused, please try later. LPN007_505 (in reply to end of DATA command)
87
+ # - 421 4.2.0 Service refuse. Veuillez essayer plus tard. Service refused, please try later.
88
+ # OFR005_505 [505] (in reply to end of DATA command)
89
+ # - 421 4.2.1 Service refuse. Veuillez essayer plus tard. Service refused, please try later.
90
+ # LPN007_505 (in reply to end of DATA command)
105
91
  '505' => 'systemerror',
106
92
 
107
- # Mail rejete. Mail rejected. OFR_506 [506]
93
+ # - Mail rejete. Mail rejected. OFR_506 [506]
108
94
  '506' => 'spamdetected',
109
95
 
110
- # 550 5.5.0 Service refuse. Veuillez essayer plus tard.
111
- # service refused, please try later. LPN005_510 (in reply to end of DATA command)
96
+ # - 550 5.5.0 Service refuse. Veuillez essayer plus tard. service refused, please try later.
97
+ # LPN005_510 (in reply to end of DATA command)
112
98
  '510' => 'blocked',
113
99
 
114
- # Mail rejete. Mail rejected. OUK_513
115
- '513' => nil,
100
+ '513' => nil, # Mail rejete. Mail rejected. OUK_513
116
101
 
117
- # Taille limite du message atteinte
102
+ # - Taille limite du message atteinte
118
103
  '514' => 'mesgtoobig',
119
104
 
120
- # 571 5.7.1 Message refused, DMARC verification Failed.
121
- # Message refuse, verification DMARC en echec LPN007_517
122
- '517' => 'policyviolation',
105
+ # - 571 5.7.1 Message refused, DMARC verification Failed.
106
+ # - Message refuse, verification DMARC en echec LPN007_517
107
+ '517' => 'authfailure',
123
108
 
124
- # 554 5.7.1 Client host rejected
125
- # LPN000_630
109
+ # - 554 5.7.1 Client host rejected LPN000_630
126
110
  '630' => 'policyviolation',
127
111
 
128
- # 421 mwinf5c77 ME Service refuse. Veuillez essayer plus tard.
129
- # Service refused, please try later. OFR_999 [999]
112
+ # - 421 mwinf5c77 ME Service refuse. Veuillez essayer plus tard. Service refused, please try
113
+ # later. OFR_999 [999]
130
114
  '999' => 'blocked',
131
115
  }.freeze
116
+ MessagesOf = {
117
+ 'authfailure' => [
118
+ # - 421 smtp.orange.fr [192.0.2.1] Emetteur invalide, Veuillez verifier la configuration
119
+ # SPF/DNS de votre nom de domaine. Invalid Sender. SPF check failed, please verify the
120
+ # SPF/DNS configuration for your domain name.
121
+ 'spf/dns de votre nom de domaine',
122
+ ],
123
+ }.freeze
132
124
 
133
125
  # Detect bounce reason from Oranage or La Poste
134
- # @param [Sisimai::Fact] argvs Parsed email object
126
+ # @param [Sisimai::Fact] argvs Decoded email object
135
127
  # @return [String] The bounce reason for Orange or La Poste
128
+ # @see https://www.postmastery.com/orange-postmaster-smtp-error-codes-ofr/
129
+ # https://smtpfieldmanual.com/provider/orange
136
130
  def get(argvs)
137
- return argvs['reason'] unless argvs['reason'].empty?
138
-
139
- statusmesg = argvs['diagnosticcode']
131
+ issuedcode = argvs['diagnosticcode']
140
132
  reasontext = ''
141
133
 
142
- if cv = statusmesg.match(/\b(LPN|LPNAAA|OFR|OUK)(_[0-9]{3}|[0-9]{3}[-_][0-9]{3})\b/i)
134
+ if cv = issuedcode.match(/\b(LPN|LPNAAA|OFR|OUK)(_[0-9]{3}|[0-9]{3}[-_][0-9]{3})\b/i)
143
135
  # OUK_513, LPN105-104, OFR102-104, ofr_506
144
136
  v = sprintf("%03d", (cv[1] + cv[2])[-3, 3])
145
137
  reasontext = ErrorCodes[v] || 'undefined'
146
138
  end
139
+ return reasontext if reasontext.size > 0
140
+
141
+ issuedcode = issuedcode.downcase
142
+ MessagesOf.each_key do |e|
143
+ MessagesOf[e].each do |f|
144
+ next unless issuedcode.include?(f)
145
+ reasontext = e
146
+ break
147
+ end
148
+ break if reasontext.size > 0
149
+ end
147
150
  return reasontext
148
151
  end
149
152
 
@@ -7,59 +7,221 @@ module Sisimai
7
7
  class << self
8
8
  # https://www.godaddy.com/help/what-does-my-email-bounceback-mean-3568
9
9
  ErrorCodes = {
10
- 'IB103' => 'badreputation', # 554 Connection refused. This IP has a poor reputation on Cloudmark Sender Intelligence (CSI). IB103
11
- 'IB104' => 'blocked', # 554 Connection refused. This IP is listed on the Spamhaus Block List (SBL). IB104
12
- 'IB105' => 'blocked', # 554 Connection refused. This IP is listed on the Exploits Block List (XBL). IB105
13
- 'IB106' => 'blocked', # 554 Connection refused. This IP is listed on the Policy Block List (PBL). IB106
14
- 'IB007' => 'toomanyconn', # 421 Connection refused, too many sessions from This IP. Please lower the number of concurrent sessions. IB007
15
- 'IB101' => 'expired', # 421 Server temporarily unavailable. Try again later. IB101
16
- 'IB108' => 'blocked', # 421 Temporarily rejected. Reverse DNS for this IP failed. IB108
17
- 'IB110' => 'blocked', # 554 This IP has been temporarily blocked for attempting to send too many messages containing content judged to be spam by the Internet community. IB110
18
- 'IB111' => 'blocked', # 554 This IP has been blocked for the day, for attempting to send too many messages containing content judged to be spam by the Internet community. IB111
19
- 'IB112' => 'blocked', # 554 This IP has been temporarily blocked for attempting to mail too many invalid recipients. IB112
20
- 'IB113' => 'blocked', # 554 This IP has been blocked for the day, for attempting to mail too many invalid recipients. IB113
21
- 'IB212' => 'spamdetected', # 552 This message has been rejected due to content judged to be spam by the Internet community. IB212
22
- 'IB401' => 'securityerror', # 535 Authentication not allowed on IBSMTP Servers. IB401
23
- 'IB501' => 'rejected', # 550 holly@coolexample.com Blank From: addresses are not allowed. Please provide a valid From. IB501
24
- 'IB502' => 'rejected', # 550 holly@coolexample.com IP addresses are not allowed as a From: Address. Please provide a valid From. IB502
25
- 'IB504' => 'toomanyconn', # 550 This IP has sent too many messages this hour. IB504
26
- 'IB506' => 'rejected', # 550 coolexample.com From: Domain is invalid. Please provide a valid From: IB506
27
- 'IB508' => 'rejected', # 550 holly@coolexample.com Invalid SPF record. Please inspect your SPF settings, and try again. IB508
28
- 'IB510' => 'toomanyconn', # 550 This message has exceeded the max number of messages per session. Please open a new session and try again. IB510
29
- 'IB607' => 'toomanyconn', # 550 This IP has sent too many to too many recipients this hour. IB607
30
- 'IB705' => 'virusdetected', # 552 Virus infected message rejected. IB705
10
+ # Sender bounces
11
+ # ---------------------------------------------------------------------------------------
12
+ # - 535 Authentication not allowed on IBSMTP Servers. IB401
13
+ # - Authentication is not allowed on inbound mail. This happens when you have incorrect
14
+ # outgoing SMTP server settings set up in your email client, like Outlook or Gmail.
15
+ # - Set up your email client using the SMTP server setting smtpout.secureserver.net.
16
+ 'IB401' => 'securityerror',
17
+
18
+ # - 550 jane@coolexample.com Blank From: addresses are not allowed. Provide a valid From.
19
+ # IB501
20
+ # - The email message "from" field is blank.
21
+ # - Add a valid "from" address and try to send the email again.
22
+ 'IB501' => 'notcompliantrfc',
23
+
24
+ # - 550 jane@coolexample.com IP addresses are not allowed as a From: Address. Provide a
25
+ # valid From. IB502
26
+ # - Email messages can't be sent "from" an IP address.
27
+ # - Add a valid "from" address and try to send the email again.
28
+ 'IB502' => 'notcompliantrfc',
29
+
30
+ # - 550 coolexample.com From: Domain is invalid. Provide a valid From: IB506
31
+ # - The domain doesn't have valid MX Records, an IP address, or there were issues during
32
+ # the DNS lookup when the email was sent.
33
+ # - Verify that you're sending from a valid domain. Then verify that the domain has valid
34
+ # DNS records by checking your zone file. If the DNS isn't valid, it must be fixed
35
+ # before you resend the email.
36
+ 'IB506' => 'rejected',
37
+
38
+ # - 550 jane@coolexample.com Invalid SPF record. Inspect your SPF settings, and try again.
39
+ # IB508
40
+ # - The sending email address's domain has an SPF record that does not authorize the
41
+ # sending email server to send email from the domain.
42
+ # - Modify the SPF record to include the server you're trying to send from or remove the
43
+ # SPF record from the domain.
44
+ 'IB508' => 'authfailure',
45
+
46
+ # - 421 Temporarily rejected. Reverse DNS for this IP failed. IB108
47
+ # - The IP address attempting to send mail does not have reverse DNS setup, or the DNS
48
+ # lookup failed.
49
+ # - Verify the sending IP address has reverse DNS set up before resending the email.
50
+ # GoDaddy manages reverse DNS when using our email services. We do not support custom
51
+ # reverse DNS.
52
+ 'IB108' => 'requireptr',
53
+
54
+ # Content bounces
55
+ # ---------------------------------------------------------------------------------------
56
+ # - 552 This message has been rejected due to content judged to be spam by the internet
57
+ # community. IB212
58
+ # - The email message contains a link, attachment or pattern caught by our filters as spam.
59
+ 'IB212' => 'spamdetected',
60
+
61
+ # - 552 Virus infected message rejected. IB705
62
+ # - The email message containing a link, attachment or pattern caught by our filters as a
63
+ # possible virus.
64
+ 'IB705' => 'virusdetected',
65
+
66
+ # Rate limiting bounces
67
+ # ---------------------------------------------------------------------------------------
68
+ # - 452 This message contains too many recipients. Reduce the number of recipients and
69
+ # retry. IB605
70
+ # - The message has attempted to mail too many recipients.
71
+ # - Reduce the number of recipients and try again.
72
+ 'IB605' => 'toomanyconn',
73
+
74
+ # - 421 Connection refused, too many sessions from This IP. Lower the number of concurrent
75
+ # sessions. IB007
76
+ # - This IP address currently has too many sessions open.
77
+ # - Check with your email provider to reduce the number of open sessions on your IP
78
+ # address and then try again.
79
+ 'IB007' => 'toomanyconn',
80
+
81
+ # - 421 Server temporarily unavailable. Try again later. IB101
82
+ # - The email queue is experiencing higher than normal email volume.
83
+ # - Try again later.
84
+ 'IB101' => 'speeding',
85
+
86
+ # - 554 This IP has been temporarily blocked for attempting to send too many messages
87
+ # containing content judged to be spam by the Internet community. IB110
88
+ # - This IP address has attempted to send too many messages containing content judged to
89
+ # be spam and has been blocked for an hour.
90
+ # - If you're not sending spam, you'll need to contact your Internet Service Provider
91
+ # (ISP) to see why your IP address is sending so many emails. Something in your system
92
+ # is causing the issue, and you'll need to troubleshoot.
93
+ 'IB110' => 'blocked',
94
+
95
+ # - 554 This IP has been blocked for the day, for attempting to send too many messages
96
+ # containing content judged to be spam by the Internet community. IB111
97
+ # - This IP address has attempted to send too many messages containing content judged to
98
+ # be spam and has been blocked for the remainder of the day.
99
+ 'IB111' => 'blocked',
100
+
101
+ # - 554 This IP has been temporarily blocked for attempting to mail too many invalid
102
+ # recipients. IB112
103
+ # - This IP address has attempted to email too many invalid recipients and has been
104
+ # blocked for an hour.
105
+ 'IB112' => 'blocked',
106
+
107
+ # - 554 This IP has been blocked for the day, for attempting to mail too many invalid
108
+ # recipients. IB113
109
+ # - This IP address has attempted to email too many invalid recipients and has been
110
+ # blocked for the remainder of the day.
111
+ 'IB113' => 'blocked',
112
+
113
+ # - 550 This IP has sent too many messages this hour. IB504
114
+ # - This IP address has reached the maximum allowed messages for that hour.
115
+ 'IB504' => 'speeding',
116
+
117
+ # - 550 This message has exceeded the max number of messages per session. Open a new
118
+ # session and try again. IB510
119
+ # - This IP address has reached the maximum allowed messages for that session.
120
+ 'IB510' => 'speeding',
121
+
122
+ # - 550 This IP has sent too many to too many recipients this hour. IB607
123
+ # - This IP address has reached the maximum allowed recipients for that hour.
124
+ 'IB607' => 'speeding',
125
+
126
+ # Remote block list (RBL) bounces
127
+ # ---------------------------------------------------------------------------------------
128
+ # - 554 Connection refused. This IP has a poor reputation on Cloudmark Sender Intelligence
129
+ # (CSI). IB103
130
+ # - This IP address has a poor reputation on Cloudmark Sender Intelligence (CSI).
131
+ 'IB103' => 'badreputation',
132
+
133
+ # - 554 Connection refused. This IP address is listed on the Spamhaus Block List (SBL). IB104
134
+ # - This IP address is listed on the Spamhaus Block List.
135
+ 'IB104' => 'blocked',
136
+
137
+ # - 554 Connection refused. This IP address is listed on the Exploits Block List (XBL). IB105
138
+ # - This IP address is listed on the Spamhaus Exploits Block List.
139
+ 'IB105' => 'blocked',
140
+
141
+ # - 554 Connection refused. This IP address is listed on the Policy Block List (PBL). IB106
142
+ # - This IP address is listed on the Spamhaus Policy Block List.
143
+ 'IB106' => 'blocked',
31
144
  }.freeze
32
145
  MessagesOf = {
33
- 'blocked' => ['www.spamhaus.org/query/bl?ip=', '554 RBL Reject.'],
34
- 'expired' => ['Delivery timeout', "451 Sorry, I wasn't able to establish an SMTP connection."],
35
- 'suspend' => ['Account disabled'],
36
- 'mailboxfull' => ['Account storage limit'],
37
- 'userunknown' => ['Account does not exist', '550 Recipient not found.'],
146
+ 'blocked' => [
147
+ # - 554 RBL Reject.
148
+ # - This IP address was blocked from our internal RBL.
149
+ # - Use the link provided in the bounceback to submit a request to remove this IP address.
150
+ 'rbl reject',
151
+ 'www.spamhaus.org/query/bl?ip='
152
+ ],
153
+ 'expired' => [
154
+ # - 451 Sorry, I wasn't able to establish an SMTP connection.
155
+ # I'm not going to try again; this message has been in the queue too long.
156
+ # - The recipient's email address has been misspelled or the recipient's email provider
157
+ # has blocked sending from your address.
158
+ 'has been in the queue too long',
159
+
160
+ # - Delivery timeout
161
+ # - This could happen for several reasons.
162
+ 'delivery timeout',
163
+ ],
164
+ 'mailboxfull' => [
165
+ # - Account storage limit
166
+ # - The recipient's account has reached its storage limit and can't receive email right
167
+ # now.
168
+ # - The recipient needs to delete messages from their inbox or the receiving folder to
169
+ # make space for more email.
170
+ 'account storage limit',
171
+ ],
172
+ 'spamdetected' => [
173
+ # - 552 Message rejected for spam or virus content
174
+ # - The email message contains a link, attachment, or pattern caught by our filters as spam.
175
+ 'message rejected for spam or virus content',
176
+ ],
177
+ 'suspend' => [
178
+ # - Account disabled
179
+ # - The recipient account exists but its ability to receive mail was disabled.
180
+ # - Typically, these accounts remain permanently disabled, but you can try sending the
181
+ # email again later.
182
+ 'account disabled',
183
+ ],
184
+ 'systemerror' => [
185
+ # - This message is looping: it already has my Delivered-To line. (#5.4.6)
186
+ # - The recipient account is forwarding the message in a loop.
187
+ # - This is oftentimes because the receiver has two addresses that forward to each
188
+ # other. They need to correct their forwarding settings.
189
+ 'message is looping',
190
+ ],
191
+ 'userunknown' => [
192
+ # - 550 Recipient not found
193
+ # - The recipient is not a valid email address.
194
+ # - Remove the invalid recipient from your email.
195
+ 'recipient not found',
196
+
197
+ # - Account does not exist
198
+ # - The email address that you sent to does not exist.
199
+ # - Verify that the recipient email address was entered correctly.
200
+ 'account does not exist'
201
+ ],
38
202
  }.freeze
39
203
 
40
204
  # Detect bounce reason from GoDaddy
41
- # @param [Sisimai::Fact] argvs Parsed email object
205
+ # @param [Sisimai::Fact] argvs Decoded email object
42
206
  # @return [String] The bounce reason for GoDaddy
43
- # @see https://www.godaddy.com/help/what-does-my-email-bounceback-mean-3568
207
+ # @see https://ca.godaddy.com/help/fix-rejected-email-with-a-bounce-error-40685
208
+ # @since v4.22.2
44
209
  def get(argvs)
45
- return argvs['reason'] unless argvs['reason'].empty?
46
-
47
- statusmesg = argvs['diagnosticcode']
48
- positionib = statusmesg.index(' IB') || -1
210
+ issuedcode = argvs['diagnosticcode']
211
+ positionib = issuedcode.index(' IB') || -1
49
212
  reasontext = ''
50
213
 
51
- # 192.0.2.22 has sent to too many recipients this hour. IB607 ...
52
- reasontext = ErrorCodes[statusmesg[positionib + 1, 5]] || '' if positionib > 1
53
- if reasontext.empty?
54
- # 553 http://www.spamhaus.org/query/bl?ip=192.0.0.222
55
- MessagesOf.each_key do |e|
56
- MessagesOf[e].each do |f|
57
- next unless statusmesg.include?(f)
58
- reasontext = e
59
- break
60
- end
61
- break unless reasontext.empty?
214
+ reasontext = ErrorCodes[issuedcode[positionib + 1, 5]] || '' if positionib > 1
215
+ return reasontext if reasontext.size > 0
216
+
217
+ issuedcode = issuedcode.downcase
218
+ MessagesOf.each_key do |e|
219
+ MessagesOf[e].each do |f|
220
+ next unless issuedcode.include?(f)
221
+ reasontext = e
222
+ break
62
223
  end
224
+ break if reasontext.size > 0
63
225
  end
64
226
 
65
227
  return reasontext
@@ -509,25 +509,23 @@ module Sisimai
509
509
  }.freeze
510
510
 
511
511
  # Detect bounce reason from Google Workspace
512
- # @param [Sisimai::Fact] argvs Parsed email object
512
+ # @param [Sisimai::Fact] argvs Decoded email object
513
513
  # @return [String] The bounce reason for Google Workspace
514
514
  # @see https://support.google.com/a/answer/3726730?hl=en
515
515
  def get(argvs)
516
- return argvs['reason'] unless argvs['reason'].empty?
517
- return '' if argvs['diagnosticcode'].empty?
518
516
  return '' unless Sisimai::SMTP::Reply.test(argvs['replycode'])
519
517
  return '' unless Sisimai::SMTP::Status.test(argvs['deliverystatus'])
520
518
 
521
519
  statuscode = argvs['deliverystatus'][2,6]
522
520
  esmtpreply = argvs['replycode'][1,2]
523
- esmtperror = argvs['diagnosticcode'].downcase
521
+ issuedcode = argvs['diagnosticcode'].downcase
524
522
  reasontext = ''
525
523
 
526
524
  MessagesOf.each_key do |e|
527
525
  # Each key is a reason name
528
526
  MessagesOf[e].each do |f|
529
527
  # Try to match an SMTP reply code, a D.S.N, and an error message
530
- next unless esmtperror.include?(f[2])
528
+ next unless issuedcode.include?(f[2])
531
529
  next unless f[0].end_with?(esmtpreply)
532
530
  next unless f[1].end_with?(statuscode)
533
531
  reasontext = e
@@ -6,7 +6,7 @@ module Sisimai
6
6
  module IUA
7
7
  class << self
8
8
  ErrorCodes = {
9
- # http://mail.i.ua/err/$(CODE)
9
+ # https://mail.i.ua/err/$(CODE)
10
10
  '1' => 'norelaying', # The use of SMTP as mail gate is forbidden.
11
11
  '2' => 'userunknown', # User is not found.
12
12
  '3' => 'suspend', # Mailbox was not used for more than 3 months
@@ -20,7 +20,7 @@ module Sisimai
20
20
  }.freeze
21
21
 
22
22
  # Detect bounce reason from https://www.i.ua/
23
- # @param [Sisimai::Fact] argvs Parsed email object
23
+ # @param [Sisimai::Fact] argvs Decoded email object
24
24
  # @return [String] The bounce reason at https://www.i.ua/
25
25
  def get(argvs)
26
26
  return argvs['reason'] unless argvs['reason'].empty?
@@ -6,20 +6,21 @@ module Sisimai
6
6
  module KDDI
7
7
  class << self
8
8
  MessagesOf = {
9
- 'filtered' => '550 : User unknown', # The response was: 550 : User unknown
10
- 'userunknown' => '>: User unknown', # The response was: 550 <...>: User unknown
9
+ 'filtered' => '550 : user unknown', # The response was: 550 : User unknown
10
+ 'userunknown' => '>: user unknown', # The response was: 550 <...>: User unknown
11
11
  }.freeze
12
12
 
13
13
  # Detect bounce reason from au (KDDI)
14
- # @param [Sisimai::Fact] argvs Parsed email object
14
+ # @param [Sisimai::Fact] argvs Decoded email object
15
15
  # @return [String] The bounce reason for au.com or ezweb.ne.jp
16
+ # @since v4.22.6
16
17
  def get(argvs)
17
- statusmesg = argvs['diagnosticcode']
18
+ issuedcode = argvs['diagnosticcode'].downcase
18
19
  reasontext = ''
19
20
 
20
21
  MessagesOf.each_key do |e|
21
22
  # Try to match the error message with message patterns defined in $MessagesOf
22
- next unless statusmesg.include?(MessagesOf[e])
23
+ next unless issuedcode.include?(MessagesOf[e])
23
24
  reasontext = e
24
25
  break
25
26
  end
@@ -711,16 +711,15 @@ module Sisimai
711
711
  }.freeze
712
712
 
713
713
  # Detect bounce reason from Exchange Server 2019 or older and Exchange Online
714
- # @param [Sisimai::Fact] argvs Parsed email object
714
+ # @param [Sisimai::Fact] argvs Decoded email object
715
715
  # @return [String] The bounce reason for Exchange Online
716
+ # @since v4.17.2
716
717
  def get(argvs)
717
- return argvs['reason'] unless argvs['reason'].empty?
718
- return '' if argvs['diagnosticcode'].empty?
719
718
  return '' if argvs['deliverystatus'].empty?
720
719
  return '' unless Sisimai::SMTP::Status.test(argvs['deliverystatus'])
721
720
 
722
721
  statuscode = argvs['deliverystatus']
723
- esmtperror = argvs['diagnosticcode'].downcase
722
+ issuedcode = argvs['diagnosticcode'].downcase
724
723
  thirddigit = statuscode.split('.')[-1].to_i
725
724
  reasontext = ''
726
725
 
@@ -738,7 +737,7 @@ module Sisimai
738
737
  next if thirddigit > f[2]
739
738
  end
740
739
 
741
- next unless esmtperror.include?(f[3])
740
+ next unless issuedcode.include?(f[3])
742
741
  reasontext = e
743
742
  break
744
743
  end