sisimai 5.0.3 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codecovio.yml +3 -1
  3. data/.github/workflows/rake-test.yml +7 -3
  4. data/ChangeLog.md +136 -0
  5. data/Makefile +4 -2
  6. data/README-JA.md +32 -22
  7. data/README.md +31 -21
  8. data/lib/sisimai/arf.rb +124 -213
  9. data/lib/sisimai/fact/json.rb +2 -2
  10. data/lib/sisimai/fact/yaml.rb +2 -2
  11. data/lib/sisimai/fact.rb +208 -173
  12. data/lib/sisimai/lda.rb +98 -0
  13. data/lib/sisimai/lhost/activehunter.rb +5 -4
  14. data/lib/sisimai/lhost/amazonses.rb +189 -305
  15. data/lib/sisimai/lhost/apachejames.rb +52 -55
  16. data/lib/sisimai/lhost/biglobe.rb +5 -6
  17. data/lib/sisimai/lhost/courier.rb +14 -12
  18. data/lib/sisimai/lhost/domino.rb +29 -29
  19. data/lib/sisimai/lhost/dragonfly.rb +113 -0
  20. data/lib/sisimai/lhost/einsundeins.rb +7 -8
  21. data/lib/sisimai/lhost/exchange2003.rb +10 -11
  22. data/lib/sisimai/lhost/exchange2007.rb +115 -104
  23. data/lib/sisimai/lhost/exim.rb +236 -246
  24. data/lib/sisimai/lhost/ezweb.rb +47 -55
  25. data/lib/sisimai/lhost/fml.rb +6 -7
  26. data/lib/sisimai/lhost/gmail.rb +36 -32
  27. data/lib/sisimai/lhost/gmx.rb +8 -20
  28. data/lib/sisimai/lhost/googlegroups.rb +13 -12
  29. data/lib/sisimai/lhost/googleworkspace.rb +94 -0
  30. data/lib/sisimai/lhost/imailserver.rb +11 -19
  31. data/lib/sisimai/lhost/interscanmss.rb +6 -5
  32. data/lib/sisimai/lhost/kddi.rb +7 -8
  33. data/lib/sisimai/lhost/mailfoundry.rb +6 -9
  34. data/lib/sisimai/lhost/mailmarshalsmtp.rb +6 -6
  35. data/lib/sisimai/lhost/messagingserver.rb +19 -17
  36. data/lib/sisimai/lhost/mfilter.rb +8 -7
  37. data/lib/sisimai/lhost/notes.rb +6 -8
  38. data/lib/sisimai/lhost/opensmtpd.rb +11 -9
  39. data/lib/sisimai/lhost/postfix.rb +29 -31
  40. data/lib/sisimai/lhost/qmail.rb +136 -112
  41. data/lib/sisimai/lhost/sendmail.rb +23 -22
  42. data/lib/sisimai/lhost/v5sendmail.rb +93 -64
  43. data/lib/sisimai/lhost/verizon.rb +6 -6
  44. data/lib/sisimai/lhost/x1.rb +4 -4
  45. data/lib/sisimai/lhost/x2.rb +4 -5
  46. data/lib/sisimai/lhost/x3.rb +5 -5
  47. data/lib/sisimai/lhost/x6.rb +4 -4
  48. data/lib/sisimai/lhost/zoho.rb +6 -6
  49. data/lib/sisimai/lhost.rb +21 -24
  50. data/lib/sisimai/mail/maildir.rb +1 -1
  51. data/lib/sisimai/mail/stdin.rb +1 -1
  52. data/lib/sisimai/message.rb +100 -153
  53. data/lib/sisimai/order.rb +22 -77
  54. data/lib/sisimai/reason/authfailure.rb +1 -4
  55. data/lib/sisimai/reason/badreputation.rb +3 -3
  56. data/lib/sisimai/reason/blocked.rb +7 -10
  57. data/lib/sisimai/reason/contenterror.rb +7 -1
  58. data/lib/sisimai/reason/exceedlimit.rb +1 -4
  59. data/lib/sisimai/reason/failedstarttls.rb +42 -0
  60. data/lib/sisimai/reason/filtered.rb +5 -4
  61. data/lib/sisimai/reason/hasmoved.rb +1 -2
  62. data/lib/sisimai/reason/hostunknown.rb +3 -3
  63. data/lib/sisimai/reason/mailboxfull.rb +2 -4
  64. data/lib/sisimai/reason/mailererror.rb +1 -2
  65. data/lib/sisimai/reason/mesgtoobig.rb +2 -4
  66. data/lib/sisimai/reason/norelaying.rb +3 -3
  67. data/lib/sisimai/reason/notaccept.rb +2 -3
  68. data/lib/sisimai/reason/notcompliantrfc.rb +10 -4
  69. data/lib/sisimai/reason/rejected.rb +2 -1
  70. data/lib/sisimai/reason/requireptr.rb +2 -2
  71. data/lib/sisimai/reason/securityerror.rb +1 -3
  72. data/lib/sisimai/reason/spamdetected.rb +6 -8
  73. data/lib/sisimai/reason/speeding.rb +1 -2
  74. data/lib/sisimai/reason/suppressed.rb +36 -0
  75. data/lib/sisimai/reason/suspend.rb +1 -3
  76. data/lib/sisimai/reason/systemerror.rb +5 -0
  77. data/lib/sisimai/reason/toomanyconn.rb +1 -2
  78. data/lib/sisimai/reason/userunknown.rb +1 -1
  79. data/lib/sisimai/reason/virusdetected.rb +5 -6
  80. data/lib/sisimai/reason.rb +82 -78
  81. data/lib/sisimai/rfc1123.rb +152 -0
  82. data/lib/sisimai/rfc1894.rb +102 -62
  83. data/lib/sisimai/rfc2045.rb +2 -1
  84. data/lib/sisimai/rfc3464/thirdparty.rb +102 -0
  85. data/lib/sisimai/rfc3464.rb +224 -345
  86. data/lib/sisimai/rfc3834.rb +3 -3
  87. data/lib/sisimai/rfc5322.rb +7 -17
  88. data/lib/sisimai/rfc791.rb +69 -0
  89. data/lib/sisimai/rhost/aol.rb +36 -0
  90. data/lib/sisimai/rhost/apple.rb +95 -0
  91. data/lib/sisimai/rhost/cox.rb +84 -34
  92. data/lib/sisimai/rhost/facebook.rb +100 -0
  93. data/lib/sisimai/rhost/franceptt.rb +87 -83
  94. data/lib/sisimai/rhost/godaddy.rb +208 -45
  95. data/lib/sisimai/rhost/google.rb +22 -22
  96. data/lib/sisimai/rhost/gsuite.rb +42 -0
  97. data/lib/sisimai/rhost/iua.rb +5 -5
  98. data/lib/sisimai/rhost/kddi.rb +9 -7
  99. data/lib/sisimai/rhost/messagelabs.rb +37 -0
  100. data/lib/sisimai/rhost/microsoft.rb +60 -54
  101. data/lib/sisimai/rhost/mimecast.rb +44 -31
  102. data/lib/sisimai/rhost/nttdocomo.rb +5 -4
  103. data/lib/sisimai/rhost/outlook.rb +36 -0
  104. data/lib/sisimai/rhost/spectrum.rb +102 -41
  105. data/lib/sisimai/rhost/tencent.rb +48 -26
  106. data/lib/sisimai/rhost/yahooinc.rb +111 -0
  107. data/lib/sisimai/rhost.rb +65 -42
  108. data/lib/sisimai/smtp/command.rb +31 -21
  109. data/lib/sisimai/smtp/failure.rb +103 -0
  110. data/lib/sisimai/smtp/reply.rb +29 -24
  111. data/lib/sisimai/smtp/status.rb +36 -19
  112. data/lib/sisimai/smtp/transcript.rb +18 -18
  113. data/lib/sisimai/string.rb +0 -46
  114. data/lib/sisimai/version.rb +1 -1
  115. data/lib/sisimai.rb +0 -6
  116. data/set-of-emails/maildir/bsd/lhost-dragonfly-01.eml +36 -0
  117. data/set-of-emails/maildir/bsd/lhost-dragonfly-02.eml +32 -0
  118. data/set-of-emails/maildir/bsd/lhost-dragonfly-03.eml +32 -0
  119. data/set-of-emails/maildir/bsd/lhost-dragonfly-04.eml +31 -0
  120. data/set-of-emails/maildir/bsd/lhost-dragonfly-05.eml +32 -0
  121. data/set-of-emails/maildir/bsd/lhost-dragonfly-06.eml +32 -0
  122. data/set-of-emails/maildir/bsd/lhost-dragonfly-07.eml +32 -0
  123. data/set-of-emails/maildir/bsd/lhost-dragonfly-08.eml +32 -0
  124. data/set-of-emails/maildir/bsd/lhost-dragonfly-09.eml +32 -0
  125. data/set-of-emails/maildir/bsd/lhost-dragonfly-10.eml +32 -0
  126. data/set-of-emails/maildir/bsd/lhost-dragonfly-11.eml +32 -0
  127. data/set-of-emails/maildir/bsd/lhost-dragonfly-12.eml +32 -0
  128. data/set-of-emails/maildir/bsd/lhost-dragonfly-13.eml +32 -0
  129. data/set-of-emails/maildir/bsd/lhost-dragonfly-14.eml +32 -0
  130. data/set-of-emails/maildir/bsd/lhost-dragonfly-15.eml +32 -0
  131. data/set-of-emails/maildir/bsd/lhost-dragonfly-16.eml +32 -0
  132. data/set-of-emails/maildir/bsd/lhost-dragonfly-17.eml +32 -0
  133. data/set-of-emails/maildir/bsd/lhost-dragonfly-18.eml +32 -0
  134. data/set-of-emails/maildir/bsd/lhost-dragonfly-19.eml +32 -0
  135. data/set-of-emails/maildir/bsd/lhost-dragonfly-20.eml +32 -0
  136. data/set-of-emails/maildir/bsd/lhost-dragonfly-21.eml +33 -0
  137. data/set-of-emails/maildir/bsd/lhost-dragonfly-22.eml +32 -0
  138. data/set-of-emails/maildir/bsd/lhost-dragonfly-23.eml +32 -0
  139. data/set-of-emails/maildir/bsd/lhost-dragonfly-24.eml +32 -0
  140. data/set-of-emails/maildir/bsd/lhost-dragonfly-25.eml +33 -0
  141. data/set-of-emails/maildir/bsd/lhost-dragonfly-26.eml +33 -0
  142. data/set-of-emails/maildir/bsd/lhost-dragonfly-27.eml +47 -0
  143. data/set-of-emails/maildir/bsd/lhost-dragonfly-28.eml +47 -0
  144. data/set-of-emails/maildir/bsd/lhost-dragonfly-29.eml +32 -0
  145. data/set-of-emails/maildir/bsd/lhost-dragonfly-30.eml +32 -0
  146. data/set-of-emails/maildir/bsd/lhost-opensmtpd-10.eml +58 -0
  147. data/set-of-emails/maildir/bsd/lhost-opensmtpd-11.eml +58 -0
  148. data/set-of-emails/maildir/bsd/lhost-opensmtpd-12.eml +62 -0
  149. data/set-of-emails/maildir/bsd/lhost-opensmtpd-13.eml +62 -0
  150. data/set-of-emails/maildir/bsd/lhost-opensmtpd-14.eml +58 -0
  151. data/set-of-emails/maildir/bsd/lhost-opensmtpd-15.eml +63 -0
  152. data/set-of-emails/maildir/bsd/lhost-opensmtpd-16.eml +62 -0
  153. data/set-of-emails/maildir/bsd/lhost-opensmtpd-17.eml +63 -0
  154. data/set-of-emails/maildir/bsd/lhost-postfix-30.eml +81 -81
  155. data/set-of-emails/maildir/bsd/lhost-qmail-11.eml +29 -0
  156. data/set-of-emails/maildir/bsd/lhost-qmail-12.eml +29 -0
  157. data/set-of-emails/maildir/bsd/lhost-qmail-13.eml +29 -0
  158. data/set-of-emails/maildir/bsd/lhost-qmail-14.eml +34 -0
  159. data/set-of-emails/maildir/bsd/lhost-qmail-15.eml +30 -0
  160. data/set-of-emails/maildir/bsd/lhost-qmail-16.eml +31 -0
  161. data/set-of-emails/maildir/bsd/lhost-qmail-17.eml +38 -0
  162. data/set-of-emails/maildir/bsd/lhost-qmail-18.eml +31 -0
  163. data/set-of-emails/maildir/bsd/lhost-qmail-19.eml +31 -0
  164. data/set-of-emails/maildir/bsd/lhost-qmail-20.eml +46 -0
  165. data/set-of-emails/maildir/bsd/lhost-qmail-21.eml +41 -0
  166. data/set-of-emails/maildir/bsd/lhost-qmail-22.eml +42 -0
  167. data/set-of-emails/maildir/bsd/lhost-qmail-23.eml +43 -0
  168. data/set-of-emails/maildir/bsd/lhost-qmail-24.eml +43 -0
  169. data/set-of-emails/maildir/bsd/lhost-qmail-25.eml +54 -0
  170. data/set-of-emails/maildir/bsd/{lhost-aol-03.eml → rhost-aol-03.eml} +1264 -1264
  171. data/set-of-emails/maildir/bsd/{lhost-aol-04.eml → rhost-aol-04.eml} +1260 -1260
  172. data/set-of-emails/maildir/bsd/{lhost-aol-05.eml → rhost-aol-05.eml} +105 -105
  173. data/set-of-emails/maildir/bsd/{lhost-aol-06.eml → rhost-aol-06.eml} +105 -105
  174. data/set-of-emails/maildir/bsd/rhost-apple-01.eml +79 -0
  175. data/set-of-emails/maildir/bsd/rhost-apple-02.eml +81 -0
  176. data/set-of-emails/maildir/bsd/rhost-apple-03.eml +75 -0
  177. data/set-of-emails/maildir/bsd/rhost-apple-04.eml +74 -0
  178. data/set-of-emails/maildir/bsd/rhost-gsuite-01.eml +189 -0
  179. data/set-of-emails/maildir/bsd/rhost-gsuite-02.eml +180 -0
  180. data/set-of-emails/maildir/bsd/rhost-gsuite-03.eml +251 -0
  181. data/set-of-emails/maildir/bsd/rhost-gsuite-04.eml +211 -0
  182. data/set-of-emails/maildir/bsd/rhost-gsuite-05.eml +226 -0
  183. data/set-of-emails/maildir/bsd/rhost-gsuite-06.eml +257 -0
  184. data/set-of-emails/maildir/bsd/rhost-gsuite-07.eml +289 -0
  185. data/set-of-emails/maildir/bsd/rhost-gsuite-08.eml +231 -0
  186. data/set-of-emails/maildir/bsd/rhost-gsuite-09.eml +231 -0
  187. data/set-of-emails/maildir/bsd/rhost-gsuite-10.eml +254 -0
  188. data/set-of-emails/maildir/bsd/rhost-gsuite-11.eml +228 -0
  189. data/set-of-emails/maildir/bsd/rhost-gsuite-12.eml +271 -0
  190. data/set-of-emails/maildir/bsd/rhost-gsuite-13.eml +261 -0
  191. data/set-of-emails/maildir/bsd/rhost-gsuite-14.eml +273 -0
  192. data/set-of-emails/maildir/bsd/rhost-gsuite-15.eml +229 -0
  193. data/set-of-emails/maildir/bsd/{lhost-messagelabs-01.eml → rhost-messagelabs-01.eml} +93 -93
  194. data/set-of-emails/maildir/bsd/rhost-outlook-01.eml +72 -0
  195. data/set-of-emails/maildir/bsd/rhost-outlook-02.eml +72 -0
  196. data/set-of-emails/maildir/bsd/rhost-outlook-03.eml +72 -0
  197. data/set-of-emails/maildir/bsd/rhost-outlook-04.eml +79 -0
  198. data/set-of-emails/maildir/bsd/rhost-outlook-06.eml +75 -0
  199. data/set-of-emails/maildir/bsd/rhost-outlook-07.eml +70 -0
  200. data/set-of-emails/maildir/bsd/rhost-outlook-08.eml +70 -0
  201. data/set-of-emails/maildir/bsd/rhost-outlook-09.eml +56 -0
  202. data/set-of-emails/maildir/bsd/rhost-yahooinc-01.eml +80 -0
  203. data/set-of-emails/maildir/bsd/rhost-yahooinc-02.eml +83 -0
  204. data/set-of-emails/maildir/bsd/rhost-yahooinc-03.eml +125 -0
  205. data/set-of-emails/maildir/tmp/arf-22.eml +49 -0
  206. data/set-of-emails/maildir/tmp/arf-23.eml +49 -0
  207. data/set-of-emails/maildir/tmp/arf-24.eml +50 -0
  208. data/set-of-emails/maildir/tmp/lhost-exim-07.eml +28 -0
  209. metadata +136 -56
  210. data/lib/sisimai/lhost/amavis.rb +0 -163
  211. data/lib/sisimai/lhost/amazonworkmail.rb +0 -127
  212. data/lib/sisimai/lhost/aol.rb +0 -125
  213. data/lib/sisimai/lhost/barracuda.rb +0 -92
  214. data/lib/sisimai/lhost/bigfoot.rb +0 -125
  215. data/lib/sisimai/lhost/facebook.rb +0 -188
  216. data/lib/sisimai/lhost/gsuite.rb +0 -194
  217. data/lib/sisimai/lhost/mailru.rb +0 -214
  218. data/lib/sisimai/lhost/mcafee.rb +0 -109
  219. data/lib/sisimai/lhost/messagelabs.rb +0 -119
  220. data/lib/sisimai/lhost/mxlogic.rb +0 -198
  221. data/lib/sisimai/lhost/office365.rb +0 -252
  222. data/lib/sisimai/lhost/outlook.rb +0 -129
  223. data/lib/sisimai/lhost/powermta.rb +0 -118
  224. data/lib/sisimai/lhost/receivingses.rb +0 -126
  225. data/lib/sisimai/lhost/sendgrid.rb +0 -150
  226. data/lib/sisimai/lhost/surfcontrol.rb +0 -105
  227. data/lib/sisimai/lhost/x4.rb +0 -269
  228. data/lib/sisimai/lhost/x5.rb +0 -112
  229. data/lib/sisimai/lhost/yahoo.rb +0 -102
  230. data/lib/sisimai/lhost/yandex.rb +0 -118
  231. data/lib/sisimai/mda.rb +0 -121
  232. data/lib/sisimai/smtp/error.rb +0 -119
  233. /data/set-of-emails/maildir/bsd/{lhost-googlegroups-15.eml → lhost-googleworkspace-01.eml} +0 -0
  234. /data/set-of-emails/maildir/bsd/{lhost-x4-08.eml → lhost-x2-06.eml} +0 -0
  235. /data/set-of-emails/maildir/bsd/{lhost-gsuite-01.eml → rfc3464-51.eml} +0 -0
  236. /data/set-of-emails/maildir/bsd/{lhost-gsuite-03.eml → rfc3464-52.eml} +0 -0
  237. /data/set-of-emails/maildir/bsd/{lhost-gsuite-04.eml → rfc3464-53.eml} +0 -0
  238. /data/set-of-emails/maildir/bsd/{lhost-gsuite-05.eml → rfc3464-54.eml} +0 -0
  239. /data/set-of-emails/maildir/bsd/{lhost-gsuite-06.eml → rfc3464-55.eml} +0 -0
  240. /data/set-of-emails/maildir/bsd/{lhost-gsuite-07.eml → rfc3464-56.eml} +0 -0
  241. /data/set-of-emails/maildir/bsd/{lhost-gsuite-08.eml → rfc3464-57.eml} +0 -0
  242. /data/set-of-emails/maildir/bsd/{lhost-gsuite-09.eml → rfc3464-58.eml} +0 -0
  243. /data/set-of-emails/maildir/bsd/{lhost-gsuite-10.eml → rfc3464-59.eml} +0 -0
  244. /data/set-of-emails/maildir/bsd/{lhost-gsuite-11.eml → rfc3464-60.eml} +0 -0
  245. /data/set-of-emails/maildir/bsd/{lhost-gsuite-12.eml → rfc3464-61.eml} +0 -0
  246. /data/set-of-emails/maildir/bsd/{lhost-gsuite-13.eml → rfc3464-62.eml} +0 -0
  247. /data/set-of-emails/maildir/bsd/{lhost-gsuite-14.eml → rfc3464-63.eml} +0 -0
  248. /data/set-of-emails/maildir/bsd/{lhost-gsuite-15.eml → rfc3464-64.eml} +0 -0
  249. /data/set-of-emails/maildir/bsd/{lhost-gsuite-02.eml → rfc3464-65.eml} +0 -0
  250. /data/set-of-emails/maildir/bsd/{lhost-aol-01.eml → rhost-aol-01.eml} +0 -0
  251. /data/set-of-emails/maildir/bsd/{lhost-aol-02.eml → rhost-aol-02.eml} +0 -0
  252. /data/set-of-emails/maildir/bsd/{lhost-facebook-03.eml → rhost-facebook-03.eml} +0 -0
  253. /data/set-of-emails/maildir/bsd/{lhost-facebook-04.eml → rhost-facebook-04.eml} +0 -0
  254. /data/set-of-emails/maildir/bsd/{lhost-messagelabs-02.eml → rhost-messagelabs-02.eml} +0 -0
  255. /data/set-of-emails/maildir/bsd/{lhost-messagelabs-03.eml → rhost-messagelabs-03.eml} +0 -0
  256. /data/set-of-emails/maildir/{bsd → tmp}/rfc3464-37.eml +0 -0
  257. /data/set-of-emails/maildir/{bsd → tmp}/rfc3464-38.eml +0 -0
  258. /data/set-of-emails/maildir/{bsd → tmp}/rfc3464-39.eml +0 -0
@@ -0,0 +1,42 @@
1
+ module Sisimai
2
+ module Rhost
3
+ # Sisimai::Rhost detects the bounce reason from the content of Sisimai::Fact object as an argument
4
+ # of find() method when the value of "rhost" of the object is "*.googlemail.com". This class is
5
+ # called only from Sisimai::Fact class.
6
+ module GSuite
7
+ class << self
8
+ MessagesOf = {
9
+ "hostunknown" => [" responded with code NXDOMAIN", "Domain name not found"],
10
+ "networkerror" => [" had no relevant answers.", "responded with code NXDOMAIN", "Domain name not found"],
11
+ "notaccept" => ["Null MX"],
12
+ "userunknown" => ["because the address couldn't be found. Check for typos or unnecessary spaces and try again."],
13
+ }.freeze
14
+
15
+ # Detect bounce reason from Gsuite Mail: https://www.aol.com
16
+ # @param [Sisimai::Fact] argvs Decoded email object
17
+ # @return [String] The bounce reason for Gsuite
18
+ # @since v5.2.0
19
+ def find(argvs)
20
+ return "" if argvs["diagnosticcode"].empty?
21
+ statuscode = ""; statuscode = argvs["deliverystatus"][0, 1] if argvs["deliverystatus"].empty? == false
22
+ esmtpreply = ""; esmtpreply = argvs["replycode"][0, 1] if argvs["replycode"].empty? == false
23
+ reasontext = ""
24
+
25
+ MessagesOf.each_key do |e|
26
+ # Try to match the error message with message patterns defined in $MessagesOf
27
+ next unless MessagesOf[e].any? { |a| argvs["diagnosticcode"].include?(a) }
28
+ next if e == "networkerror" && (statuscode == "5" || esmtpreply == "5")
29
+ next if e == "hostunknown" && (statuscode == "4" || statuscode == "")
30
+ next if e == "hostunknown" && (esmtpreply == "4" || esmtpreply == "")
31
+ reasontext = e
32
+ break
33
+ end
34
+
35
+ return reasontext
36
+ end
37
+
38
+ end
39
+ end
40
+ end
41
+ end
42
+
@@ -1,12 +1,12 @@
1
1
  module Sisimai
2
2
  module Rhost
3
3
  # Sisimai::Rhost detects the bounce reason from the content of Sisimai::Fact object as an argument
4
- # of get() method when the value of "rhost" of the object is "*.email.ua". This class is called
4
+ # of find() method when the value of "rhost" of the object is "*.email.ua". This class is called
5
5
  # only Sisimai::Fact class.
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,10 +20,10 @@ 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
- def get(argvs)
26
- return argvs['reason'] unless argvs['reason'].empty?
25
+ def find(argvs)
26
+ return "" if argvs["diagnosticcode"].empty?
27
27
  issuedcode = argvs['diagnosticcode'].downcase
28
28
  codenumber = issuedcode.index('.i.ua/err/') > 0 ? issuedcode[issuedcode.index('/err/') + 5, 2] : 0
29
29
  codenumber = codenumber[0, 1] if codenumber.index('/') == 1
@@ -1,25 +1,27 @@
1
1
  module Sisimai
2
2
  module Rhost
3
3
  # Sisimai::Rhost detects the bounce reason from the content of Sisimai::Fact object as an argument
4
- # of get() method when the value of "rhost" of the object is "lsean.ezweb.ne.jp" or "msmx.au.com".
4
+ # of find() method when the value of "rhost" of the object is "lsean.ezweb.ne.jp" or "msmx.au.com".
5
5
  # This class is called only Sisimai::Fact class.
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
- def get(argvs)
17
- statusmesg = argvs['diagnosticcode']
16
+ # @since v4.22.6
17
+ def find(argvs)
18
+ return "" if argvs["diagnosticcode"].empty?
19
+ issuedcode = argvs['diagnosticcode'].downcase
18
20
  reasontext = ''
19
21
 
20
22
  MessagesOf.each_key do |e|
21
23
  # Try to match the error message with message patterns defined in $MessagesOf
22
- next unless statusmesg.include?(MessagesOf[e])
24
+ next unless issuedcode.include?(MessagesOf[e])
23
25
  reasontext = e
24
26
  break
25
27
  end
@@ -0,0 +1,37 @@
1
+ module Sisimai
2
+ module Rhost
3
+ # Sisimai::Rhost detects the bounce reason from the content of Sisimai::Fact object as an argument
4
+ # of find() method when the value of "rhost" of the object is "*.messagelabs.com". This class is
5
+ # called only from Sisimai::Fact class.
6
+ module MessageLabs
7
+ class << self
8
+ MessagesOf = {
9
+ "securityerror" => ["Please turn on SMTP Authentication in your mail client"],
10
+ "userunknown" => ["542 ", " Rejected", "No such user"],
11
+ }.freeze
12
+
13
+ # Detect bounce reason from Email Security (formerly MessageLabs.com)
14
+ # @param [Sisimai::Fact] argvs Decoded email object
15
+ # @return [String] The bounce reason for MessageLabs
16
+ # @see https://www.broadcom.com/products/cybersecurity/email
17
+ # @since v5.2.0
18
+ def find(argvs)
19
+ return "" if argvs["diagnosticcode"].empty?
20
+ issuedcode = argvs["diagnosticcode"]
21
+ reasontext = ""
22
+
23
+ MessagesOf.each_key do |e|
24
+ # Try to match the error message with message patterns defined in $MessagesOf
25
+ next unless MessagesOf[e].any? { |a| issuedcode.include?(a) }
26
+ reasontext = e
27
+ break
28
+ end
29
+
30
+ return reasontext
31
+ end
32
+
33
+ end
34
+ end
35
+ end
36
+ end
37
+
@@ -1,7 +1,7 @@
1
1
  module Sisimai
2
2
  module Rhost
3
3
  # Sisimai::Rhost detects the bounce reason from the content of Sisimai::Fact object as an argument
4
- # of get() method when the value of "rhost" of the object is *.protection.outlook.com. This class
4
+ # of find() method when the value of "rhost" of the object is *.protection.outlook.com. This class
5
5
  # is called only Sisimai::Fact class.
6
6
  #
7
7
  # https://technet.microsoft.com/en-us/library/bb232118
@@ -16,43 +16,10 @@ module Sisimai
16
16
  # - The sending message sent over IPv6 must pass either SPF or DKIM.
17
17
  ['4.7.26', 0, 0, 'must pass either spf or dkim validation, this message is not signed'],
18
18
 
19
- # - Records are DNSSEC authentic, but one or multiple of these scenarios occurred:
20
- # - The destination mail server's certificate doesn't match with what is expected per
21
- # the authentic TLSA record.
22
- # - Authentic TLSA record is misconfigured.
23
- # - Destination domain is being attacked.
24
- # - Any other DANE failure.
25
- # - This message usually indicates an issue on the destination email server. Check the
26
- # validity of recipient address and determine if the destination server is configured
27
- # correctly to receive messages.
28
- # - For more information about DANE, see: https://datatracker.ietf.org/doc/html/rfc7671
29
- ['4.7.323', 0, 0, 'tlsa-invalid: The domain failed dane validation'],
30
- ['5.7.323', 0, 0, 'tlsa-invalid: The domain failed dane validation'],
31
-
32
- # - The destination domain indicated it was DNSSEC-authentic, but Exchange Online was
33
- # not able to verify it as DNSSEC-authentic.
34
- ['4.7.324', 0, 0, 'dnssec-invalid: destination domain returned invalid dnssec records'],
35
- ['5.7.324', 0, 0, 'dnssec-invalid: destination domain returned invalid dnssec records'],
36
-
37
- # - This happens when the presented certificate identities (CN and SAN) of a destina-
38
- # tion SMTP target host don't match any of the domains or MX host.
39
- # - This message usually indicates an issue on the destination email server. Check the
40
- # validity of recipient address and determine if the destination server is configured
41
- # correctly to receive messages. For more information, see How SMTP DNS-based Authen-
42
- # tication of Named Entities (DANE) works to secure email communications.
43
- ['4.7.325', 0, 0, 'certificate-host-mismatch: remote certificate must have a common name or subject alternative name matching the hostname (dane)'],
44
- ['5.7.325', 0, 0, 'certificate-host-mismatch: remote certificate must have a common name or subject alternative name matching the hostname (dane)'],
45
-
46
19
  # - The destination email system uses SPF to validate inbound mail, and there's a prob-
47
20
  # lem with your SPF configuration.
48
21
  ['5.7.23', 0, 0, 'the message was rejected because of sender policy framework violation'],
49
22
 
50
- # - DNSSEC checks have passed, yet upon establishing the connection the destination
51
- # mail server provides a certificate that is expired.
52
- # - A valid X.509 certificate that isn't expired must be presented. X.509 certificates
53
- # must be renewed after their expiration, commonly annually.
54
- ['5.7.322', 0, 0, "certificate-expired: destination mail server's certificate is expired"],
55
-
56
23
  # - Access denied, sending domain [$SenderDomain] does not pass DMARC verification
57
24
  # - The sender's domain in the 5322.From address doesn't pass DMARC.
58
25
  ['5.7.509', 0, 0, 'does not pass dmarc verification'],
@@ -136,7 +103,6 @@ module Sisimai
136
103
 
137
104
  # Previous versions of Exchange Server ------------------------------------------------
138
105
  ['5.5.4', 0, 0, 'invalid domain name'],
139
- ['5.7.51', 0, 0, 'restrictdomainstoipaddresses or restrictdomainstocertificate'],
140
106
 
141
107
  # Undocumented error messages ---------------------------------------------------------
142
108
  # - 550 5.7.1 Unfortunately, messages from [10.0.2.5] weren't sent. Please contact your
@@ -216,6 +182,53 @@ module Sisimai
216
182
  # couldn't be delivered to the original sender.
217
183
  ['5.4.300', 0, 0, 'message expired'],
218
184
  ],
185
+ 'failedstarttls' => [
186
+ # Exchange Online ---------------------------------------------------------------------
187
+ # - DNSSEC checks have passed, yet upon connection, destination mail server doesn't re-
188
+ # spond to the STARTTLS command. The destination server responds to the STARTTLS com-
189
+ # mand, but the TLS handshake fails.
190
+ # - This message usually indicates an issue on the destination email server. Check the
191
+ # validity of the recipient address. Determine if the destination server is configur-
192
+ # ed correctly to receive the messages.
193
+ ['4.4.317', 0, 0, 'starttls is required to send mail'],
194
+ ['5.4.317', 0, 0, 'starttls is required to send mail'],
195
+
196
+ # - DNSSEC checks have passed, yet upon establishing the connection the destination
197
+ # mail server provides a certificate that is expired.
198
+ # - A valid X.509 certificate that isn't expired must be presented. X.509 certificates
199
+ # must be renewed after their expiration, commonly annually.
200
+ ['5.7.51', 0, 0, 'restrictdomainstoipaddresses or restrictdomainstocertificate'],
201
+ ['4.7.321', 0, 0, 'starttls-not-supported: destination mail server must support tls to receive mail'],
202
+ ['5.7.321', 0, 0, 'starttls-not-supported: destination mail server must support tls to receive mail'],
203
+ ['5.7.322', 0, 0, "certificate-expired: destination mail server's certificate is expired"],
204
+
205
+ # - Records are DNSSEC authentic, but one or multiple of these scenarios occurred:
206
+ # - The destination mail server's certificate doesn't match with what is expected per
207
+ # the authentic TLSA record.
208
+ # - Authentic TLSA record is misconfigured.
209
+ # - Destination domain is being attacked.
210
+ # - Any other DANE failure.
211
+ # - This message usually indicates an issue on the destination email server. Check the
212
+ # validity of recipient address and determine if the destination server is configured
213
+ # correctly to receive messages.
214
+ # - For more information about DANE, see: https://datatracker.ietf.org/doc/html/rfc7671
215
+ ['4.7.323', 0, 0, 'tlsa-invalid: The domain failed dane validation'],
216
+ ['5.7.323', 0, 0, 'tlsa-invalid: The domain failed dane validation'],
217
+
218
+ # - The destination domain indicated it was DNSSEC-authentic, but Exchange Online was
219
+ # not able to verify it as DNSSEC-authentic.
220
+ ['4.7.324', 0, 0, 'dnssec-invalid: destination domain returned invalid dnssec records'],
221
+ ['5.7.324', 0, 0, 'dnssec-invalid: destination domain returned invalid dnssec records'],
222
+
223
+ # - This happens when the presented certificate identities (CN and SAN) of a destina-
224
+ # tion SMTP target host don't match any of the domains or MX host.
225
+ # - This message usually indicates an issue on the destination email server. Check the
226
+ # validity of recipient address and determine if the destination server is configured
227
+ # correctly to receive messages. For more information, see How SMTP DNS-based Authen-
228
+ # tication of Named Entities (DANE) works to secure email communications.
229
+ ['4.7.325', 0, 0, 'certificate-host-mismatch: remote certificate must have a common name or subject alternative name matching the hostname (dane)'],
230
+ ['5.7.325', 0, 0, 'certificate-host-mismatch: remote certificate must have a common name or subject alternative name matching the hostname (dane)'],
231
+ ],
219
232
  'mailboxfull' => [
220
233
  # Exchange Server 2019 ----------------------------------------------------------------
221
234
  # - The recipient's mailbox has exceeded its storage quota and is no longer able to ac-
@@ -328,6 +341,7 @@ module Sisimai
328
341
  ],
329
342
  'notaccept' => [
330
343
  ['4.3.2', 0, 0, 'system not accepting network messages'],
344
+ ['4.4.4', 0, 0, 'hosted tenant which has no mail-enabled subscriptions'],
331
345
 
332
346
  # Exchange Server 2019 ----------------------------------------------------------------
333
347
  # - You're using the ABP Routing agent, and the recipient isn't a member of the global
@@ -448,19 +462,6 @@ module Sisimai
448
462
  ['5.7.3', 0, 0, 'cannot achieve exchange server authentication'],
449
463
  ['5.7.3', 0, 0, 'not authorized'],
450
464
 
451
- # Exchange Online ---------------------------------------------------------------------
452
- # - DNSSEC checks have passed, yet upon connection, destination mail server doesn't re-
453
- # spond to the STARTTLS command. The destination server responds to the STARTTLS com-
454
- # mand, but the TLS handshake fails.
455
- # - This message usually indicates an issue on the destination email server. Check the
456
- # validity of the recipient address. Determine if the destination server is configur-
457
- # ed correctly to receive the messages.
458
- ['4.4.317', 0, 0, 'starttls is required to send mail'],
459
- ['5.4.317', 0, 0, 'starttls is required to send mail'],
460
-
461
- ['4.7.321', 0, 0, 'starttls-not-supported: destination mail server must support tls to receive mail'],
462
- ['5.7.321', 0, 0, 'starttls-not-supported: destination mail server must support tls to receive mail'],
463
-
464
465
  # - The sending email system didn't authenticate with the receiving email system. The
465
466
  # receiving email system requires authentication before message submission.
466
467
  # - This error occurs when the receiving server must be authenticated before message
@@ -644,6 +645,12 @@ module Sisimai
644
645
  # envelope recipients into smaller chunks (chunking) and resend the message.
645
646
  ['4.5.3', 0, 0, 'too many recipients'],
646
647
 
648
+ # - 451 4.7.652 The mail server [192.0.2.251] has exceeded the maximum number of
649
+ # connections. (S3115) [Name=Protocol Filter Agent][AGT=PFA][MxId=11BA9B3FA168ABBF]
650
+ # [BN3PEPF0000B370.namprd21.prod.outlook.com 2025-02-20T14:30:32.425Z 08DD4D9FD5AFF45C]
651
+ # (in reply to MAIL FROM command))
652
+ ["4.7.652", 0, 0, "has exceeded the maximum number of connections"],
653
+
647
654
  # Previous versions of Exchange Server ------------------------------------------------
648
655
  ['5.2.122', 0, 0, 'the recipient has exceeded their limit for'],
649
656
  ],
@@ -711,16 +718,15 @@ module Sisimai
711
718
  }.freeze
712
719
 
713
720
  # Detect bounce reason from Exchange Server 2019 or older and Exchange Online
714
- # @param [Sisimai::Fact] argvs Parsed email object
721
+ # @param [Sisimai::Fact] argvs Decoded email object
715
722
  # @return [String] The bounce reason for Exchange Online
716
- def get(argvs)
717
- return argvs['reason'] unless argvs['reason'].empty?
718
- return '' if argvs['diagnosticcode'].empty?
723
+ # @since v4.17.2
724
+ def find(argvs)
719
725
  return '' if argvs['deliverystatus'].empty?
720
726
  return '' unless Sisimai::SMTP::Status.test(argvs['deliverystatus'])
721
727
 
722
728
  statuscode = argvs['deliverystatus']
723
- esmtperror = argvs['diagnosticcode'].downcase
729
+ issuedcode = argvs['diagnosticcode'].downcase
724
730
  thirddigit = statuscode.split('.')[-1].to_i
725
731
  reasontext = ''
726
732
 
@@ -738,7 +744,7 @@ module Sisimai
738
744
  next if thirddigit > f[2]
739
745
  end
740
746
 
741
- next unless esmtperror.include?(f[3])
747
+ next unless issuedcode.include?(f[3])
742
748
  reasontext = e
743
749
  break
744
750
  end
@@ -1,7 +1,7 @@
1
1
  module Sisimai
2
2
  module Rhost
3
3
  # Sisimai::Rhost detects the bounce reason from the content of Sisimai::Fact object as an argu-
4
- # ment of get() method when the value of "rhost" of the object is "*.mimecast.com". This class
4
+ # ment of find() method when the value of "rhost" of the object is "*.mimecast.com". This class
5
5
  # is called only Sisimai::Fact class.
6
6
  module Mimecast
7
7
  class << self
@@ -67,6 +67,41 @@ module Sisimai
67
67
  # the associated IP address from the RBL.
68
68
  #[550, '< details of RBL >'], NEED AN ACTUAL ERROR MESSAGE STRING
69
69
  ],
70
+ 'expired' => [
71
+ # - Journal messages past the expiration
72
+ # - Attempts are being made to journal mail past the set expiry threshold.
73
+ # A retry response will replace the failure because the message is marked for retry
74
+ # if rejected, causing the journal queue to grow.
75
+ # - Check to confirm there are no significant time discrepancies on the mail server.
76
+ # Discontinue journaling old messages past the expiry threshold.
77
+ [550, 'Journal messages past the expiration'],
78
+ ],
79
+ 'failedstarttls' => [
80
+ # - This email has been sent using SMTP, but TLS is required by policy.
81
+ # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS.
82
+ # Alternatively, ensure the certificates on the mail server haven't expired. If using
83
+ # a proxy server, ensure it isn't intercepting the traffic and modifying encryption
84
+ # parameters.
85
+ [553, 'this route requires encryption (tls)'],
86
+
87
+ # - A TLS connection has been attempted using a TLS version that is lower than TLS 1.2.
88
+ # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS.
89
+ # Alternatively, ensure the mail server attempting to connect is using the appropri-
90
+ # ate version of TLS.
91
+ [553, 'this route requires tls version 1.2 or greater'],
92
+
93
+ # - A secure connection was attempted using ciphers that do not meet the configured ci-
94
+ # pher strength.
95
+ # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS. Alter-
96
+ # natively, ensure the certificates on the mail server haven't expired. If using a
97
+ # proxy server, ensure it isn't intercepting the traffic and modifying encryption
98
+ # parameters.
99
+ [553, 'this route requires high-strength ciphers'],
100
+
101
+ # - Validation on your umbrella account's domain name does not conform to your DNS.
102
+ # - Check you DNS has the required umbrella accounts listed as comma-separated values.
103
+ [554, 'configuration is invalid for this certificate'],
104
+ ],
70
105
  'mesgtoobig' => [
71
106
  # - The email size either exceeds an Email Size Limit policy or is larger than the
72
107
  # Mimecast service limit. The default is 100 MB for the Legacy MTA, and 200 MB for
@@ -96,6 +131,7 @@ module Sisimai
96
131
  # - Mimecast customers should contact Mimecast Support to add the Authorized Outbound
97
132
  # address, or to take other remedial action.
98
133
  [451, 'open relay not allowed'],
134
+ [451, 'open relay is not allowed'],
99
135
  ],
100
136
  'notaccept' => [
101
137
  # - The customer account Inbound emails are disabled in the Administration Console.
@@ -133,6 +169,7 @@ module Sisimai
133
169
  # - The message has triggered a Geographical Restriction policy.
134
170
  # - Delete or amend the policy.
135
171
  [554, 'host network not allowed'],
172
+ [554, 'host network, not allowed'],
136
173
  ],
137
174
  'rejected' => [
138
175
  # - The sender's email address or domain has triggered a Blocked Senders Policy or
@@ -160,31 +197,7 @@ module Sisimai
160
197
  # sage on SMTP port 25.
161
198
  [535, 'incorrect authentication data'],
162
199
  [550, 'submitter failed to disabled'],
163
-
164
- # - This email has been sent using SMTP, but TLS is required by policy.
165
- # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS.
166
- # Alternatively, ensure the certificates on the mail server haven't expired. If using
167
- # a proxy server, ensure it isn't intercepting the traffic and modifying encryption
168
- # parameters.
169
- [553, 'this route requires encryption (tls)'],
170
-
171
- # - A TLS connection has been attempted using a TLS version that is lower than TLS 1.2.
172
- # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS.
173
- # Alternatively, ensure the mail server attempting to connect is using the appropri-
174
- # ate version of TLS.
175
- [553, 'this route requires tls version 1.2 or greater'],
176
-
177
- # - A secure connection was attempted using ciphers that do not meet the configured ci-
178
- # pher strength.
179
- # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS. Alter-
180
- # natively, ensure the certificates on the mail server haven't expired. If using a
181
- # proxy server, ensure it isn't intercepting the traffic and modifying encryption
182
- # parameters.
183
- [553, 'this route requires high-strength ciphers'],
184
-
185
- # - Validation on your umbrella account's domain name does not conform to your DNS.
186
- # - Check you DNS has the required umbrella accounts listed as comma-separated values.
187
- [554, 'configuration is invalid for this certificate'],
200
+ [550, 'submitter failed to authenticate'],
188
201
  ],
189
202
  'systemerror' => [
190
203
  # - The Mimecast server is under maximum load.
@@ -267,13 +280,13 @@ module Sisimai
267
280
  }.freeze
268
281
 
269
282
  # Detect bounce reason from Mimecast
270
- # @param [Sisimai::Fact] argvs Parsed email object
283
+ # @param [Sisimai::Fact] argvs Decoded email object
271
284
  # @return [String] The bounce reason for mimecast.com
272
- def get(argvs)
285
+ def find(argvs)
286
+ return argvs['reason'] unless argvs['reason'].empty?
273
287
  return '' unless Sisimai::SMTP::Reply.test(argvs['replycode'])
274
- return '' unless argvs['diagnosticcode']
275
288
 
276
- esmtperror = argvs['diagnosticcode'].downcase || ''
289
+ issuedcode = argvs['diagnosticcode'].downcase || ''
277
290
  esmtpreply = argvs['replycode'].to_i
278
291
  reasontext = ''
279
292
 
@@ -282,7 +295,7 @@ module Sisimai
282
295
  MessagesOf[e].each do |f|
283
296
  # Find an error reason
284
297
  next unless esmtpreply == f[0]
285
- next unless esmtperror.include?(f[1])
298
+ next unless issuedcode.include?(f[1])
286
299
  reasontext = e
287
300
  break
288
301
  end
@@ -1,7 +1,7 @@
1
1
  module Sisimai
2
2
  module Rhost
3
3
  # Sisimai::Rhost detects the bounce reason from the content of Sisimai::Fact object as an argument
4
- # of get() method when the value of "rhost" of the object is "mfsmax.docomo.ne.jp". This class
4
+ # of find() method when the value of "rhost" of the object is "mfsmax.docomo.ne.jp". This class
5
5
  # is called only Sisimai::Fact class.
6
6
  module NTTDOCOMO
7
7
  class << self
@@ -12,11 +12,12 @@ module Sisimai
12
12
  }.freeze
13
13
 
14
14
  # Detect bounce reason from NTT DOCOMO
15
- # @param [Sisimai::Fact] argvs Parsed email object
15
+ # @param [Sisimai::Fact] argvs Decoded email object
16
16
  # @return [String] The bounce reason for docomo.ne.jp
17
- def get(argvs)
17
+ def find(argvs)
18
+ return argvs['reason'] unless argvs['reason'].empty?
18
19
  statuscode = argvs['deliverystatus'] || ''
19
- thecommand = argvs['smtpcommand'] || ''
20
+ thecommand = argvs['command'] || ''
20
21
  esmtperror = argvs['diagnosticcode'].downcase || ''
21
22
  reasontext = ''
22
23
 
@@ -0,0 +1,36 @@
1
+ module Sisimai
2
+ module Rhost
3
+ # Sisimai::Rhost detects the bounce reason from the content of Sisimai::Fact object as an argument
4
+ # of find() method when the value of "rhost" of the object is "*.hotmail.com". This class is called
5
+ # only from Sisimai::Fact class.
6
+ module Outlook
7
+ class << self
8
+ MessagesOf = {
9
+ "hostunknown" => ["The mail could not be delivered to the recipient because the domain is not reachable"],
10
+ "userunknown" => ["Requested action not taken: mailbox unavailable"],
11
+ }.freeze
12
+
13
+ # Detect bounce reason from Microsoft Outlook.com: https://www.outlook.com/
14
+ # @param [Sisimai::Fact] argvs Decoded email object
15
+ # @return [String] The bounce reason for Outlook
16
+ # @since v5.2.0
17
+ def find(argvs)
18
+ return "" if argvs["diagnosticcode"].empty?
19
+ issuedcode = argvs["diagnosticcode"]
20
+ reasontext = ""
21
+
22
+ MessagesOf.each_key do |e|
23
+ # Try to match the error message with message patterns defined in $MessagesOf
24
+ next unless MessagesOf[e].any? { |a| issuedcode.include?(a) }
25
+ reasontext = e
26
+ break
27
+ end
28
+
29
+ return reasontext
30
+ end
31
+
32
+ end
33
+ end
34
+ end
35
+ end
36
+