sisimai 4.16.0-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sisimai might be problematic. Click here for more details.

Files changed (574) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +182 -0
  5. data/.travis.yml +18 -0
  6. data/ANALYTICAL-PRECISION +56 -0
  7. data/Changes +36 -0
  8. data/Developers.mk +129 -0
  9. data/Gemfile +15 -0
  10. data/LICENSE +25 -0
  11. data/Makefile +70 -0
  12. data/README.md +361 -0
  13. data/Rakefile +12 -0
  14. data/Repository.mk +69 -0
  15. data/appveyor.yml +23 -0
  16. data/bin/console +14 -0
  17. data/bin/setup +7 -0
  18. data/lib/sisimai.rb +95 -0
  19. data/lib/sisimai/address.rb +224 -0
  20. data/lib/sisimai/arf.rb +338 -0
  21. data/lib/sisimai/data.rb +409 -0
  22. data/lib/sisimai/data/json.rb +40 -0
  23. data/lib/sisimai/data/yaml.rb +32 -0
  24. data/lib/sisimai/datetime.rb +511 -0
  25. data/lib/sisimai/mail.rb +82 -0
  26. data/lib/sisimai/mail/maildir.rb +82 -0
  27. data/lib/sisimai/mail/mbox.rb +69 -0
  28. data/lib/sisimai/mail/stdin.rb +53 -0
  29. data/lib/sisimai/mda.rb +152 -0
  30. data/lib/sisimai/message.rb +525 -0
  31. data/lib/sisimai/mime.rb +127 -0
  32. data/lib/sisimai/msp.rb +54 -0
  33. data/lib/sisimai/msp/de/einsundeins.rb +174 -0
  34. data/lib/sisimai/msp/de/gmx.rb +197 -0
  35. data/lib/sisimai/msp/jp/biglobe.rb +179 -0
  36. data/lib/sisimai/msp/jp/ezweb.rb +292 -0
  37. data/lib/sisimai/msp/jp/kddi.rb +195 -0
  38. data/lib/sisimai/msp/ru/mailru.rb +306 -0
  39. data/lib/sisimai/msp/ru/yandex.rb +241 -0
  40. data/lib/sisimai/msp/uk/messagelabs.rb +250 -0
  41. data/lib/sisimai/msp/us/amazonses.rb +248 -0
  42. data/lib/sisimai/msp/us/amazonworkmail.rb +224 -0
  43. data/lib/sisimai/msp/us/aol.rb +234 -0
  44. data/lib/sisimai/msp/us/bigfoot.rb +243 -0
  45. data/lib/sisimai/msp/us/facebook.rb +306 -0
  46. data/lib/sisimai/msp/us/google.rb +357 -0
  47. data/lib/sisimai/msp/us/office365.rb +273 -0
  48. data/lib/sisimai/msp/us/outlook.rb +242 -0
  49. data/lib/sisimai/msp/us/receivingses.rb +247 -0
  50. data/lib/sisimai/msp/us/sendgrid.rb +257 -0
  51. data/lib/sisimai/msp/us/verizon.rb +311 -0
  52. data/lib/sisimai/msp/us/yahoo.rb +178 -0
  53. data/lib/sisimai/msp/us/zoho.rb +198 -0
  54. data/lib/sisimai/mta.rb +54 -0
  55. data/lib/sisimai/mta/activehunter.rb +155 -0
  56. data/lib/sisimai/mta/apachejames.rb +194 -0
  57. data/lib/sisimai/mta/courier.rb +307 -0
  58. data/lib/sisimai/mta/domino.rb +209 -0
  59. data/lib/sisimai/mta/exchange.rb +314 -0
  60. data/lib/sisimai/mta/exim.rb +549 -0
  61. data/lib/sisimai/mta/imailserver.rb +227 -0
  62. data/lib/sisimai/mta/interscanmss.rb +167 -0
  63. data/lib/sisimai/mta/mailfoundry.rb +173 -0
  64. data/lib/sisimai/mta/mailmarshalsmtp.rb +206 -0
  65. data/lib/sisimai/mta/mcafee.rb +201 -0
  66. data/lib/sisimai/mta/messagingserver.rb +241 -0
  67. data/lib/sisimai/mta/mfilter.rb +190 -0
  68. data/lib/sisimai/mta/mxlogic.rb +283 -0
  69. data/lib/sisimai/mta/notes.rb +206 -0
  70. data/lib/sisimai/mta/opensmtpd.rb +225 -0
  71. data/lib/sisimai/mta/postfix.rb +306 -0
  72. data/lib/sisimai/mta/qmail.rb +335 -0
  73. data/lib/sisimai/mta/sendmail.rb +317 -0
  74. data/lib/sisimai/mta/surfcontrol.rb +193 -0
  75. data/lib/sisimai/mta/userdefined.rb +148 -0
  76. data/lib/sisimai/mta/v5sendmail.rb +232 -0
  77. data/lib/sisimai/mta/x1.rb +156 -0
  78. data/lib/sisimai/mta/x2.rb +157 -0
  79. data/lib/sisimai/mta/x3.rb +171 -0
  80. data/lib/sisimai/mta/x4.rb +365 -0
  81. data/lib/sisimai/mta/x5.rb +208 -0
  82. data/lib/sisimai/order.rb +220 -0
  83. data/lib/sisimai/reason.rb +234 -0
  84. data/lib/sisimai/reason/blocked.rb +105 -0
  85. data/lib/sisimai/reason/contenterror.rb +53 -0
  86. data/lib/sisimai/reason/exceedlimit.rb +60 -0
  87. data/lib/sisimai/reason/expired.rb +53 -0
  88. data/lib/sisimai/reason/filtered.rb +98 -0
  89. data/lib/sisimai/reason/hasmoved.rb +45 -0
  90. data/lib/sisimai/reason/hostunknown.rb +79 -0
  91. data/lib/sisimai/reason/mailboxfull.rb +118 -0
  92. data/lib/sisimai/reason/mailererror.rb +55 -0
  93. data/lib/sisimai/reason/mesgtoobig.rb +82 -0
  94. data/lib/sisimai/reason/networkerror.rb +58 -0
  95. data/lib/sisimai/reason/norelaying.rb +71 -0
  96. data/lib/sisimai/reason/notaccept.rb +63 -0
  97. data/lib/sisimai/reason/onhold.rb +45 -0
  98. data/lib/sisimai/reason/rejected.rb +101 -0
  99. data/lib/sisimai/reason/securityerror.rb +72 -0
  100. data/lib/sisimai/reason/spamdetected.rb +172 -0
  101. data/lib/sisimai/reason/suspend.rb +58 -0
  102. data/lib/sisimai/reason/systemerror.rb +69 -0
  103. data/lib/sisimai/reason/systemfull.rb +45 -0
  104. data/lib/sisimai/reason/toomanyconn.rb +73 -0
  105. data/lib/sisimai/reason/userunknown.rb +194 -0
  106. data/lib/sisimai/rfc2606.rb +24 -0
  107. data/lib/sisimai/rfc3464.rb +497 -0
  108. data/lib/sisimai/rfc3834.rb +150 -0
  109. data/lib/sisimai/rfc5322.rb +204 -0
  110. data/lib/sisimai/rhost.rb +47 -0
  111. data/lib/sisimai/rhost/googleapps.rb +237 -0
  112. data/lib/sisimai/smtp.rb +58 -0
  113. data/lib/sisimai/smtp/reply.rb +84 -0
  114. data/lib/sisimai/smtp/status.rb +758 -0
  115. data/lib/sisimai/string.rb +65 -0
  116. data/lib/sisimai/time.rb +11 -0
  117. data/lib/sisimai/version.rb +4 -0
  118. data/set-of-emails/README.md +35 -0
  119. data/set-of-emails/mailbox/mbox-0 +2467 -0
  120. data/set-of-emails/mailbox/mbox-1 +71 -0
  121. data/set-of-emails/maildir/bsd/README.md +261 -0
  122. data/set-of-emails/maildir/bsd/activehunter-01.eml +54 -0
  123. data/set-of-emails/maildir/bsd/activehunter-02.eml +53 -0
  124. data/set-of-emails/maildir/bsd/apachejames-01.eml +46 -0
  125. data/set-of-emails/maildir/bsd/arf-01.eml +66 -0
  126. data/set-of-emails/maildir/bsd/arf-02.eml +68 -0
  127. data/set-of-emails/maildir/bsd/arf-03.eml +56 -0
  128. data/set-of-emails/maildir/bsd/arf-04.eml +89 -0
  129. data/set-of-emails/maildir/bsd/arf-05.eml +82 -0
  130. data/set-of-emails/maildir/bsd/arf-06.eml +166 -0
  131. data/set-of-emails/maildir/bsd/arf-07.eml +59 -0
  132. data/set-of-emails/maildir/bsd/arf-08.eml +103 -0
  133. data/set-of-emails/maildir/bsd/arf-09.eml +104 -0
  134. data/set-of-emails/maildir/bsd/arf-10.eml +56 -0
  135. data/set-of-emails/maildir/bsd/arf-11.eml +37 -0
  136. data/set-of-emails/maildir/bsd/arf-12.eml +40 -0
  137. data/set-of-emails/maildir/bsd/arf-13.eml +76 -0
  138. data/set-of-emails/maildir/bsd/arf-14.eml +333 -0
  139. data/set-of-emails/maildir/bsd/arf-15.eml +66 -0
  140. data/set-of-emails/maildir/bsd/courier-01.eml +79 -0
  141. data/set-of-emails/maildir/bsd/courier-02.eml +83 -0
  142. data/set-of-emails/maildir/bsd/courier-03.eml +85 -0
  143. data/set-of-emails/maildir/bsd/courier-04.eml +87 -0
  144. data/set-of-emails/maildir/bsd/de-einsundeins-01.eml +38 -0
  145. data/set-of-emails/maildir/bsd/de-gmx-01.eml +52 -0
  146. data/set-of-emails/maildir/bsd/de-gmx-02.eml +51 -0
  147. data/set-of-emails/maildir/bsd/de-gmx-03.eml +56 -0
  148. data/set-of-emails/maildir/bsd/de-gmx-04.eml +51 -0
  149. data/set-of-emails/maildir/bsd/domino-01.eml +33 -0
  150. data/set-of-emails/maildir/bsd/domino-02.eml +83 -0
  151. data/set-of-emails/maildir/bsd/exchange-01.eml +31 -0
  152. data/set-of-emails/maildir/bsd/exchange-02.eml +67 -0
  153. data/set-of-emails/maildir/bsd/exchange-03.eml +52 -0
  154. data/set-of-emails/maildir/bsd/exchange-04.eml +28 -0
  155. data/set-of-emails/maildir/bsd/exchange-05.eml +56 -0
  156. data/set-of-emails/maildir/bsd/exchange-06.eml +151 -0
  157. data/set-of-emails/maildir/bsd/exim-01.eml +46 -0
  158. data/set-of-emails/maildir/bsd/exim-02.eml +41 -0
  159. data/set-of-emails/maildir/bsd/exim-03.eml +42 -0
  160. data/set-of-emails/maildir/bsd/exim-04.eml +46 -0
  161. data/set-of-emails/maildir/bsd/exim-05.eml +49 -0
  162. data/set-of-emails/maildir/bsd/exim-06.eml +44 -0
  163. data/set-of-emails/maildir/bsd/exim-07.eml +28 -0
  164. data/set-of-emails/maildir/bsd/exim-08.eml +42 -0
  165. data/set-of-emails/maildir/bsd/exim-09.eml +169 -0
  166. data/set-of-emails/maildir/bsd/exim-10.eml +718 -0
  167. data/set-of-emails/maildir/bsd/exim-11.eml +718 -0
  168. data/set-of-emails/maildir/bsd/exim-12.eml +75 -0
  169. data/set-of-emails/maildir/bsd/exim-13.eml +145 -0
  170. data/set-of-emails/maildir/bsd/exim-14.eml +32 -0
  171. data/set-of-emails/maildir/bsd/exim-15.eml +49 -0
  172. data/set-of-emails/maildir/bsd/exim-16.eml +98 -0
  173. data/set-of-emails/maildir/bsd/exim-17.eml +50 -0
  174. data/set-of-emails/maildir/bsd/exim-18.eml +96 -0
  175. data/set-of-emails/maildir/bsd/exim-19.eml +52 -0
  176. data/set-of-emails/maildir/bsd/exim-20.eml +159 -0
  177. data/set-of-emails/maildir/bsd/exim-21.eml +150 -0
  178. data/set-of-emails/maildir/bsd/exim-22.eml +50 -0
  179. data/set-of-emails/maildir/bsd/exim-23.eml +57 -0
  180. data/set-of-emails/maildir/bsd/exim-24.eml +107 -0
  181. data/set-of-emails/maildir/bsd/exim-25.eml +18 -0
  182. data/set-of-emails/maildir/bsd/exim-26.eml +111 -0
  183. data/set-of-emails/maildir/bsd/exim-27.eml +120 -0
  184. data/set-of-emails/maildir/bsd/exim-28.eml +148 -0
  185. data/set-of-emails/maildir/bsd/google-apps-01.eml +66 -0
  186. data/set-of-emails/maildir/bsd/imailserver-01.eml +27 -0
  187. data/set-of-emails/maildir/bsd/imailserver-02.eml +36 -0
  188. data/set-of-emails/maildir/bsd/imailserver-03.eml +28 -0
  189. data/set-of-emails/maildir/bsd/imailserver-04.eml +15 -0
  190. data/set-of-emails/maildir/bsd/imailserver-05.eml +92 -0
  191. data/set-of-emails/maildir/bsd/imailserver-06.eml +29 -0
  192. data/set-of-emails/maildir/bsd/interscanmss-01.eml +49 -0
  193. data/set-of-emails/maildir/bsd/interscanmss-02.eml +259 -0
  194. data/set-of-emails/maildir/bsd/jp-biglobe-01.eml +43 -0
  195. data/set-of-emails/maildir/bsd/jp-ezweb-01.eml +36 -0
  196. data/set-of-emails/maildir/bsd/jp-ezweb-02.eml +65 -0
  197. data/set-of-emails/maildir/bsd/jp-ezweb-03.eml +35 -0
  198. data/set-of-emails/maildir/bsd/jp-ezweb-04.eml +38 -0
  199. data/set-of-emails/maildir/bsd/jp-ezweb-05.eml +38 -0
  200. data/set-of-emails/maildir/bsd/jp-ezweb-06.eml +33 -0
  201. data/set-of-emails/maildir/bsd/jp-kddi-01.eml +49 -0
  202. data/set-of-emails/maildir/bsd/jp-kddi-02.eml +54 -0
  203. data/set-of-emails/maildir/bsd/jp-kddi-03.eml +54 -0
  204. data/set-of-emails/maildir/bsd/mailfoundry-01.eml +50 -0
  205. data/set-of-emails/maildir/bsd/mailfoundry-02.eml +49 -0
  206. data/set-of-emails/maildir/bsd/mailmarshalsmtp-01.eml +43 -0
  207. data/set-of-emails/maildir/bsd/mcafee-01.eml +63 -0
  208. data/set-of-emails/maildir/bsd/mcafee-02.eml +65 -0
  209. data/set-of-emails/maildir/bsd/mcafee-03.eml +59 -0
  210. data/set-of-emails/maildir/bsd/messagingserver-01.eml +102 -0
  211. data/set-of-emails/maildir/bsd/messagingserver-02.eml +72 -0
  212. data/set-of-emails/maildir/bsd/messagingserver-03.eml +70 -0
  213. data/set-of-emails/maildir/bsd/messagingserver-04.eml +102 -0
  214. data/set-of-emails/maildir/bsd/messagingserver-05.eml +98 -0
  215. data/set-of-emails/maildir/bsd/messagingserver-06.eml +101 -0
  216. data/set-of-emails/maildir/bsd/messagingserver-07.eml +129 -0
  217. data/set-of-emails/maildir/bsd/mfilter-01.eml +49 -0
  218. data/set-of-emails/maildir/bsd/mfilter-02.eml +48 -0
  219. data/set-of-emails/maildir/bsd/mfilter-03.eml +43 -0
  220. data/set-of-emails/maildir/bsd/mxlogic-01.eml +47 -0
  221. data/set-of-emails/maildir/bsd/mxlogic-02.eml +44 -0
  222. data/set-of-emails/maildir/bsd/mxlogic-03.eml +46 -0
  223. data/set-of-emails/maildir/bsd/notes-01.eml +42 -0
  224. data/set-of-emails/maildir/bsd/notes-02.eml +42 -0
  225. data/set-of-emails/maildir/bsd/notes-03.eml +38 -0
  226. data/set-of-emails/maildir/bsd/notes-04.eml +181 -0
  227. data/set-of-emails/maildir/bsd/opensmtpd-01.eml +33 -0
  228. data/set-of-emails/maildir/bsd/opensmtpd-02.eml +33 -0
  229. data/set-of-emails/maildir/bsd/opensmtpd-03.eml +36 -0
  230. data/set-of-emails/maildir/bsd/opensmtpd-04.eml +40 -0
  231. data/set-of-emails/maildir/bsd/opensmtpd-05.eml +36 -0
  232. data/set-of-emails/maildir/bsd/postfix-01.eml +60 -0
  233. data/set-of-emails/maildir/bsd/postfix-02.eml +78 -0
  234. data/set-of-emails/maildir/bsd/postfix-03.eml +71 -0
  235. data/set-of-emails/maildir/bsd/postfix-04.eml +89 -0
  236. data/set-of-emails/maildir/bsd/postfix-05.eml +78 -0
  237. data/set-of-emails/maildir/bsd/postfix-06.eml +72 -0
  238. data/set-of-emails/maildir/bsd/postfix-07.eml +74 -0
  239. data/set-of-emails/maildir/bsd/postfix-08.eml +78 -0
  240. data/set-of-emails/maildir/bsd/postfix-09.eml +76 -0
  241. data/set-of-emails/maildir/bsd/postfix-10.eml +73 -0
  242. data/set-of-emails/maildir/bsd/postfix-11.eml +86 -0
  243. data/set-of-emails/maildir/bsd/postfix-12.eml +71 -0
  244. data/set-of-emails/maildir/bsd/postfix-13.eml +81 -0
  245. data/set-of-emails/maildir/bsd/postfix-14.eml +68 -0
  246. data/set-of-emails/maildir/bsd/postfix-15.eml +69 -0
  247. data/set-of-emails/maildir/bsd/postfix-16.eml +73 -0
  248. data/set-of-emails/maildir/bsd/postfix-17.eml +68 -0
  249. data/set-of-emails/maildir/bsd/postfix-18.eml +121 -0
  250. data/set-of-emails/maildir/bsd/postfix-19.eml +105 -0
  251. data/set-of-emails/maildir/bsd/postfix-20.eml +231 -0
  252. data/set-of-emails/maildir/bsd/postfix-21.eml +60 -0
  253. data/set-of-emails/maildir/bsd/qmail-01.eml +40 -0
  254. data/set-of-emails/maildir/bsd/qmail-02.eml +35 -0
  255. data/set-of-emails/maildir/bsd/qmail-03.eml +22 -0
  256. data/set-of-emails/maildir/bsd/qmail-04.eml +31 -0
  257. data/set-of-emails/maildir/bsd/qmail-05.eml +31 -0
  258. data/set-of-emails/maildir/bsd/qmail-06.eml +39 -0
  259. data/set-of-emails/maildir/bsd/qmail-07.eml +22 -0
  260. data/set-of-emails/maildir/bsd/qmail-08.eml +23 -0
  261. data/set-of-emails/maildir/bsd/qmail-09.eml +103 -0
  262. data/set-of-emails/maildir/bsd/rfc3464-01.eml +60 -0
  263. data/set-of-emails/maildir/bsd/rfc3464-02.eml +43 -0
  264. data/set-of-emails/maildir/bsd/rfc3464-03.eml +40 -0
  265. data/set-of-emails/maildir/bsd/rfc3464-04.eml +50 -0
  266. data/set-of-emails/maildir/bsd/rfc3464-05.eml +63 -0
  267. data/set-of-emails/maildir/bsd/rfc3464-06.eml +48 -0
  268. data/set-of-emails/maildir/bsd/rfc3464-07.eml +88 -0
  269. data/set-of-emails/maildir/bsd/rfc3464-08.eml +70 -0
  270. data/set-of-emails/maildir/bsd/rfc3464-09.eml +93 -0
  271. data/set-of-emails/maildir/bsd/rfc3464-10.eml +467 -0
  272. data/set-of-emails/maildir/bsd/rfc3464-11.eml +1171 -0
  273. data/set-of-emails/maildir/bsd/rfc3464-12.eml +101 -0
  274. data/set-of-emails/maildir/bsd/rfc3464-13.eml +131 -0
  275. data/set-of-emails/maildir/bsd/rfc3464-14.eml +121 -0
  276. data/set-of-emails/maildir/bsd/rfc3464-15.eml +144 -0
  277. data/set-of-emails/maildir/bsd/rfc3464-16.eml +36 -0
  278. data/set-of-emails/maildir/bsd/rfc3464-17.eml +109 -0
  279. data/set-of-emails/maildir/bsd/rfc3464-18.eml +149 -0
  280. data/set-of-emails/maildir/bsd/rfc3464-19.eml +65 -0
  281. data/set-of-emails/maildir/bsd/rfc3464-20.eml +145 -0
  282. data/set-of-emails/maildir/bsd/rfc3464-21.eml +146 -0
  283. data/set-of-emails/maildir/bsd/rfc3464-22.eml +105 -0
  284. data/set-of-emails/maildir/bsd/rfc3464-23.eml +21 -0
  285. data/set-of-emails/maildir/bsd/rfc3464-24.eml +27 -0
  286. data/set-of-emails/maildir/bsd/rfc3464-25.eml +33 -0
  287. data/set-of-emails/maildir/bsd/rfc3464-26.eml +98 -0
  288. data/set-of-emails/maildir/bsd/rfc3464-27.eml +180 -0
  289. data/set-of-emails/maildir/bsd/rfc3464-28.eml +122 -0
  290. data/set-of-emails/maildir/bsd/rfc3834-01.eml +37 -0
  291. data/set-of-emails/maildir/bsd/rfc3834-02.eml +51 -0
  292. data/set-of-emails/maildir/bsd/rfc3834-03.eml +33 -0
  293. data/set-of-emails/maildir/bsd/ru-mailru-01.eml +54 -0
  294. data/set-of-emails/maildir/bsd/ru-mailru-02.eml +54 -0
  295. data/set-of-emails/maildir/bsd/ru-mailru-03.eml +62 -0
  296. data/set-of-emails/maildir/bsd/ru-mailru-04.eml +54 -0
  297. data/set-of-emails/maildir/bsd/ru-yandex-01.eml +102 -0
  298. data/set-of-emails/maildir/bsd/ru-yandex-02.eml +113 -0
  299. data/set-of-emails/maildir/bsd/ru-yandex-03.eml +101 -0
  300. data/set-of-emails/maildir/bsd/sendmail-01.eml +70 -0
  301. data/set-of-emails/maildir/bsd/sendmail-02.eml +82 -0
  302. data/set-of-emails/maildir/bsd/sendmail-03.eml +76 -0
  303. data/set-of-emails/maildir/bsd/sendmail-04.eml +63 -0
  304. data/set-of-emails/maildir/bsd/sendmail-05.eml +64 -0
  305. data/set-of-emails/maildir/bsd/sendmail-06.eml +67 -0
  306. data/set-of-emails/maildir/bsd/sendmail-07.eml +65 -0
  307. data/set-of-emails/maildir/bsd/sendmail-08.eml +62 -0
  308. data/set-of-emails/maildir/bsd/sendmail-09.eml +60 -0
  309. data/set-of-emails/maildir/bsd/sendmail-10.eml +82 -0
  310. data/set-of-emails/maildir/bsd/sendmail-11.eml +60 -0
  311. data/set-of-emails/maildir/bsd/sendmail-12.eml +62 -0
  312. data/set-of-emails/maildir/bsd/sendmail-13.eml +66 -0
  313. data/set-of-emails/maildir/bsd/sendmail-14.eml +64 -0
  314. data/set-of-emails/maildir/bsd/sendmail-15.eml +60 -0
  315. data/set-of-emails/maildir/bsd/sendmail-16.eml +69 -0
  316. data/set-of-emails/maildir/bsd/sendmail-17.eml +68 -0
  317. data/set-of-emails/maildir/bsd/sendmail-18.eml +64 -0
  318. data/set-of-emails/maildir/bsd/sendmail-19.eml +71 -0
  319. data/set-of-emails/maildir/bsd/sendmail-20.eml +120 -0
  320. data/set-of-emails/maildir/bsd/sendmail-21.eml +69 -0
  321. data/set-of-emails/maildir/bsd/sendmail-22.eml +73 -0
  322. data/set-of-emails/maildir/bsd/sendmail-23.eml +137 -0
  323. data/set-of-emails/maildir/bsd/sendmail-24.eml +66 -0
  324. data/set-of-emails/maildir/bsd/sendmail-25.eml +70 -0
  325. data/set-of-emails/maildir/bsd/sendmail-26.eml +71 -0
  326. data/set-of-emails/maildir/bsd/sendmail-27.eml +69 -0
  327. data/set-of-emails/maildir/bsd/sendmail-28.eml +69 -0
  328. data/set-of-emails/maildir/bsd/sendmail-29.eml +70 -0
  329. data/set-of-emails/maildir/bsd/sendmail-30.eml +68 -0
  330. data/set-of-emails/maildir/bsd/sendmail-31.eml +80 -0
  331. data/set-of-emails/maildir/bsd/sendmail-32.eml +71 -0
  332. data/set-of-emails/maildir/bsd/sendmail-33.eml +71 -0
  333. data/set-of-emails/maildir/bsd/sendmail-34.eml +75 -0
  334. data/set-of-emails/maildir/bsd/sendmail-35.eml +70 -0
  335. data/set-of-emails/maildir/bsd/sendmail-36.eml +71 -0
  336. data/set-of-emails/maildir/bsd/sendmail-37.eml +71 -0
  337. data/set-of-emails/maildir/bsd/sendmail-38.eml +167 -0
  338. data/set-of-emails/maildir/bsd/surfcontrol-01.eml +79 -0
  339. data/set-of-emails/maildir/bsd/surfcontrol-02.eml +70 -0
  340. data/set-of-emails/maildir/bsd/surfcontrol-03.eml +70 -0
  341. data/set-of-emails/maildir/bsd/uk-messagelabs-01.eml +76 -0
  342. data/set-of-emails/maildir/bsd/us-amazonses-01.eml +59 -0
  343. data/set-of-emails/maildir/bsd/us-amazonses-02.eml +177 -0
  344. data/set-of-emails/maildir/bsd/us-amazonses-03.eml +55 -0
  345. data/set-of-emails/maildir/bsd/us-amazonses-04.eml +55 -0
  346. data/set-of-emails/maildir/bsd/us-amazonworkmail-01.eml +156 -0
  347. data/set-of-emails/maildir/bsd/us-amazonworkmail-02.eml +160 -0
  348. data/set-of-emails/maildir/bsd/us-amazonworkmail-03.eml +161 -0
  349. data/set-of-emails/maildir/bsd/us-amazonworkmail-04.eml +156 -0
  350. data/set-of-emails/maildir/bsd/us-amazonworkmail-05.eml +157 -0
  351. data/set-of-emails/maildir/bsd/us-aol-01.eml +1258 -0
  352. data/set-of-emails/maildir/bsd/us-aol-02.eml +1257 -0
  353. data/set-of-emails/maildir/bsd/us-aol-03.eml +1264 -0
  354. data/set-of-emails/maildir/bsd/us-aol-04.eml +1260 -0
  355. data/set-of-emails/maildir/bsd/us-bigfoot-01.eml +64 -0
  356. data/set-of-emails/maildir/bsd/us-facebook-01.eml +40 -0
  357. data/set-of-emails/maildir/bsd/us-facebook-02.eml +42 -0
  358. data/set-of-emails/maildir/bsd/us-google-01.eml +70 -0
  359. data/set-of-emails/maildir/bsd/us-google-02.eml +50 -0
  360. data/set-of-emails/maildir/bsd/us-google-03.eml +51 -0
  361. data/set-of-emails/maildir/bsd/us-google-04.eml +82 -0
  362. data/set-of-emails/maildir/bsd/us-google-05.eml +50 -0
  363. data/set-of-emails/maildir/bsd/us-google-06.eml +56 -0
  364. data/set-of-emails/maildir/bsd/us-google-07.eml +42 -0
  365. data/set-of-emails/maildir/bsd/us-google-08.eml +59 -0
  366. data/set-of-emails/maildir/bsd/us-google-09.eml +76 -0
  367. data/set-of-emails/maildir/bsd/us-google-10.eml +69 -0
  368. data/set-of-emails/maildir/bsd/us-google-11.eml +68 -0
  369. data/set-of-emails/maildir/bsd/us-google-12.eml +76 -0
  370. data/set-of-emails/maildir/bsd/us-google-13.eml +79 -0
  371. data/set-of-emails/maildir/bsd/us-google-14.eml +304 -0
  372. data/set-of-emails/maildir/bsd/us-office365-01.eml +102 -0
  373. data/set-of-emails/maildir/bsd/us-outlook-01.eml +72 -0
  374. data/set-of-emails/maildir/bsd/us-outlook-02.eml +72 -0
  375. data/set-of-emails/maildir/bsd/us-outlook-03.eml +72 -0
  376. data/set-of-emails/maildir/bsd/us-outlook-04.eml +79 -0
  377. data/set-of-emails/maildir/bsd/us-outlook-05.eml +85 -0
  378. data/set-of-emails/maildir/bsd/us-outlook-06.eml +75 -0
  379. data/set-of-emails/maildir/bsd/us-outlook-07.eml +70 -0
  380. data/set-of-emails/maildir/bsd/us-receivingses-01.eml +74 -0
  381. data/set-of-emails/maildir/bsd/us-receivingses-02.eml +74 -0
  382. data/set-of-emails/maildir/bsd/us-receivingses-03.eml +74 -0
  383. data/set-of-emails/maildir/bsd/us-receivingses-04.eml +74 -0
  384. data/set-of-emails/maildir/bsd/us-receivingses-05.eml +74 -0
  385. data/set-of-emails/maildir/bsd/us-receivingses-06.eml +74 -0
  386. data/set-of-emails/maildir/bsd/us-receivingses-07.eml +74 -0
  387. data/set-of-emails/maildir/bsd/us-sendgrid-01.eml +95 -0
  388. data/set-of-emails/maildir/bsd/us-sendgrid-02.eml +98 -0
  389. data/set-of-emails/maildir/bsd/us-sendgrid-03.eml +100 -0
  390. data/set-of-emails/maildir/bsd/us-verizon-01.eml +31 -0
  391. data/set-of-emails/maildir/bsd/us-yahoo-01.eml +78 -0
  392. data/set-of-emails/maildir/bsd/us-yahoo-02.eml +79 -0
  393. data/set-of-emails/maildir/bsd/us-yahoo-03.eml +93 -0
  394. data/set-of-emails/maildir/bsd/us-yahoo-04.eml +94 -0
  395. data/set-of-emails/maildir/bsd/us-yahoo-05.eml +94 -0
  396. data/set-of-emails/maildir/bsd/us-zoho-01.eml +40 -0
  397. data/set-of-emails/maildir/bsd/us-zoho-02.eml +38 -0
  398. data/set-of-emails/maildir/bsd/us-zoho-03.eml +37 -0
  399. data/set-of-emails/maildir/bsd/us-zoho-04.eml +47 -0
  400. data/set-of-emails/maildir/bsd/us-zoho-05.eml +37 -0
  401. data/set-of-emails/maildir/bsd/v5sendmail-01.eml +24 -0
  402. data/set-of-emails/maildir/bsd/v5sendmail-02.eml +26 -0
  403. data/set-of-emails/maildir/bsd/v5sendmail-03.eml +29 -0
  404. data/set-of-emails/maildir/bsd/v5sendmail-04.eml +29 -0
  405. data/set-of-emails/maildir/bsd/v5sendmail-05.eml +42 -0
  406. data/set-of-emails/maildir/bsd/v5sendmail-06.eml +28 -0
  407. data/set-of-emails/maildir/bsd/v5sendmail-07.eml +35 -0
  408. data/set-of-emails/maildir/bsd/x1-01.eml +61 -0
  409. data/set-of-emails/maildir/bsd/x1-02.eml +62 -0
  410. data/set-of-emails/maildir/bsd/x2-01.eml +41 -0
  411. data/set-of-emails/maildir/bsd/x2-02.eml +46 -0
  412. data/set-of-emails/maildir/bsd/x2-03.eml +34 -0
  413. data/set-of-emails/maildir/bsd/x2-04.eml +0 -0
  414. data/set-of-emails/maildir/bsd/x2-05.eml +98 -0
  415. data/set-of-emails/maildir/bsd/x3-01.eml +61 -0
  416. data/set-of-emails/maildir/bsd/x3-02.eml +64 -0
  417. data/set-of-emails/maildir/bsd/x3-03.eml +59 -0
  418. data/set-of-emails/maildir/bsd/x3-04.eml +106 -0
  419. data/set-of-emails/maildir/bsd/x4-01.eml +92 -0
  420. data/set-of-emails/maildir/bsd/x4-02.eml +112 -0
  421. data/set-of-emails/maildir/bsd/x4-03.eml +245 -0
  422. data/set-of-emails/maildir/bsd/x4-04.eml +81 -0
  423. data/set-of-emails/maildir/bsd/x4-05.eml +121 -0
  424. data/set-of-emails/maildir/bsd/x4-06.eml +32 -0
  425. data/set-of-emails/maildir/bsd/x4-07.eml +153 -0
  426. data/set-of-emails/maildir/bsd/x5-01.eml +155 -0
  427. data/set-of-emails/maildir/dos/activehunter-01.eml +54 -0
  428. data/set-of-emails/maildir/dos/apachejames-01.eml +46 -0
  429. data/set-of-emails/maildir/dos/arf-01.eml +66 -0
  430. data/set-of-emails/maildir/dos/courier-01.eml +79 -0
  431. data/set-of-emails/maildir/dos/de-einsundeins-01.eml +38 -0
  432. data/set-of-emails/maildir/dos/de-gmx-01.eml +52 -0
  433. data/set-of-emails/maildir/dos/domino-01.eml +33 -0
  434. data/set-of-emails/maildir/dos/exchange-01.eml +31 -0
  435. data/set-of-emails/maildir/dos/exim-01.eml +46 -0
  436. data/set-of-emails/maildir/dos/google-apps-01.eml +66 -0
  437. data/set-of-emails/maildir/dos/imailserver-01.eml +27 -0
  438. data/set-of-emails/maildir/dos/interscanmss-01.eml +49 -0
  439. data/set-of-emails/maildir/dos/jp-biglobe-01.eml +43 -0
  440. data/set-of-emails/maildir/dos/jp-ezweb-01.eml +36 -0
  441. data/set-of-emails/maildir/dos/jp-kddi-01.eml +49 -0
  442. data/set-of-emails/maildir/dos/mailfoundry-01.eml +50 -0
  443. data/set-of-emails/maildir/dos/mailmarshalsmtp-01.eml +43 -0
  444. data/set-of-emails/maildir/dos/mcafee-01.eml +63 -0
  445. data/set-of-emails/maildir/dos/messagingserver-01.eml +102 -0
  446. data/set-of-emails/maildir/dos/mfilter-01.eml +49 -0
  447. data/set-of-emails/maildir/dos/mxlogic-01.eml +47 -0
  448. data/set-of-emails/maildir/dos/notes-01.eml +42 -0
  449. data/set-of-emails/maildir/dos/opensmtpd-01.eml +33 -0
  450. data/set-of-emails/maildir/dos/postfix-01.eml +60 -0
  451. data/set-of-emails/maildir/dos/qmail-01.eml +40 -0
  452. data/set-of-emails/maildir/dos/rfc3464-01.eml +59 -0
  453. data/set-of-emails/maildir/dos/rfc3834-01.eml +37 -0
  454. data/set-of-emails/maildir/dos/ru-mailru-01.eml +54 -0
  455. data/set-of-emails/maildir/dos/ru-yandex-01.eml +102 -0
  456. data/set-of-emails/maildir/dos/sendmail-01.eml +69 -0
  457. data/set-of-emails/maildir/dos/surfcontrol-01.eml +79 -0
  458. data/set-of-emails/maildir/dos/uk-messagelabs-01.eml +76 -0
  459. data/set-of-emails/maildir/dos/us-amazonses-01.eml +59 -0
  460. data/set-of-emails/maildir/dos/us-aol-01.eml +1258 -0
  461. data/set-of-emails/maildir/dos/us-bigfoot-01.eml +64 -0
  462. data/set-of-emails/maildir/dos/us-facebook-01.eml +40 -0
  463. data/set-of-emails/maildir/dos/us-google-01.eml +70 -0
  464. data/set-of-emails/maildir/dos/us-outlook-01.eml +72 -0
  465. data/set-of-emails/maildir/dos/us-receivingses-01.eml +74 -0
  466. data/set-of-emails/maildir/dos/us-sendgrid-01.eml +95 -0
  467. data/set-of-emails/maildir/dos/us-verizon-01.eml +31 -0
  468. data/set-of-emails/maildir/dos/us-yahoo-01.eml +78 -0
  469. data/set-of-emails/maildir/dos/us-zoho-01.eml +40 -0
  470. data/set-of-emails/maildir/dos/v5sendmail-01.eml +24 -0
  471. data/set-of-emails/maildir/dos/x1-01.eml +61 -0
  472. data/set-of-emails/maildir/dos/x2-01.eml +41 -0
  473. data/set-of-emails/maildir/dos/x3-01.eml +61 -0
  474. data/set-of-emails/maildir/dos/x4-01.eml +90 -0
  475. data/set-of-emails/maildir/dos/x5-01.eml +155 -0
  476. data/set-of-emails/maildir/err/make-test-01.eml +70 -0
  477. data/set-of-emails/maildir/err/make-test-02.eml +70 -0
  478. data/set-of-emails/maildir/err/make-test-03.eml +64 -0
  479. data/set-of-emails/maildir/err/make-test-04.eml +64 -0
  480. data/set-of-emails/maildir/err/make-test-05.eml +66 -0
  481. data/set-of-emails/maildir/err/make-test-06.eml +118 -0
  482. data/set-of-emails/maildir/err/make-test-07.eml +26 -0
  483. data/set-of-emails/maildir/err/make-test-08.eml +67 -0
  484. data/set-of-emails/maildir/err/make-test-09.eml +55 -0
  485. data/set-of-emails/maildir/err/make-test-10.eml +69 -0
  486. data/set-of-emails/maildir/err/make-test-11.eml +64 -0
  487. data/set-of-emails/maildir/err/make-test-12.eml +66 -0
  488. data/set-of-emails/maildir/err/make-test-13.eml +67 -0
  489. data/set-of-emails/maildir/err/make-test-14.eml +66 -0
  490. data/set-of-emails/maildir/err/make-test-15.eml +70 -0
  491. data/set-of-emails/maildir/err/make-test-16.eml +68 -0
  492. data/set-of-emails/maildir/err/make-test-17.eml +68 -0
  493. data/set-of-emails/maildir/err/make-test-18.eml +68 -0
  494. data/set-of-emails/maildir/err/make-test-19.eml +69 -0
  495. data/set-of-emails/maildir/err/make-test-20.eml +67 -0
  496. data/set-of-emails/maildir/err/make-test-21.eml +69 -0
  497. data/set-of-emails/maildir/err/make-test-22.eml +66 -0
  498. data/set-of-emails/maildir/err/make-test-23.eml +70 -0
  499. data/set-of-emails/maildir/err/make-test-24.eml +69 -0
  500. data/set-of-emails/maildir/err/make-test-25.eml +67 -0
  501. data/set-of-emails/maildir/err/make-test-26.eml +69 -0
  502. data/set-of-emails/maildir/err/make-test-27.eml +69 -0
  503. data/set-of-emails/maildir/err/make-test-28.eml +66 -0
  504. data/set-of-emails/maildir/err/make-test-29.eml +68 -0
  505. data/set-of-emails/maildir/err/make-test-30.eml +68 -0
  506. data/set-of-emails/maildir/err/make-test-31.eml +80 -0
  507. data/set-of-emails/maildir/err/make-test-32.eml +66 -0
  508. data/set-of-emails/maildir/err/make-test-33.eml +68 -0
  509. data/set-of-emails/maildir/err/make-test-34.eml +56 -0
  510. data/set-of-emails/maildir/err/make-test-35.eml +59 -0
  511. data/set-of-emails/maildir/err/make-test-36.eml +53 -0
  512. data/set-of-emails/maildir/err/make-test-37.eml +62 -0
  513. data/set-of-emails/maildir/mac/activehunter-01.eml +1 -2
  514. data/set-of-emails/maildir/mac/apachejames-01.eml +1 -4
  515. data/set-of-emails/maildir/mac/arf-01.eml +1 -3
  516. data/set-of-emails/maildir/mac/courier-01.eml +1 -6
  517. data/set-of-emails/maildir/mac/de-einsundeins-01.eml +1 -1
  518. data/set-of-emails/maildir/mac/de-gmx-01.eml +1 -1
  519. data/set-of-emails/maildir/mac/domino-01.eml +1 -0
  520. data/set-of-emails/maildir/mac/exchange-01.eml +1 -0
  521. data/set-of-emails/maildir/mac/exim-01.eml +1 -1
  522. data/set-of-emails/maildir/mac/google-apps-01.eml +1 -4
  523. data/set-of-emails/maildir/mac/imailserver-01.eml +1 -0
  524. data/set-of-emails/maildir/mac/interscanmss-01.eml +1 -2
  525. data/set-of-emails/maildir/mac/jp-biglobe-01.eml +1 -2
  526. data/set-of-emails/maildir/mac/jp-ezweb-01.eml +1 -1
  527. data/set-of-emails/maildir/mac/jp-kddi-01.eml +1 -2
  528. data/set-of-emails/maildir/mac/mailfoundry-01.eml +1 -2
  529. data/set-of-emails/maildir/mac/mailmarshalsmtp-01.eml +1 -2
  530. data/set-of-emails/maildir/mac/mcafee-01.eml +1 -4
  531. data/set-of-emails/maildir/mac/messagingserver-01.eml +1 -4
  532. data/set-of-emails/maildir/mac/mfilter-01.eml +1 -3
  533. data/set-of-emails/maildir/mac/mxlogic-01.eml +1 -1
  534. data/set-of-emails/maildir/mac/notes-01.eml +1 -2
  535. data/set-of-emails/maildir/mac/opensmtpd-01.eml +1 -0
  536. data/set-of-emails/maildir/mac/postfix-01.eml +1 -3
  537. data/set-of-emails/maildir/mac/qmail-01.eml +1 -1
  538. data/set-of-emails/maildir/mac/rfc3464-01.eml +1 -4
  539. data/set-of-emails/maildir/mac/rfc3834-01.eml +1 -0
  540. data/set-of-emails/maildir/mac/ru-mailru-01.eml +1 -1
  541. data/set-of-emails/maildir/mac/ru-yandex-01.eml +1 -4
  542. data/set-of-emails/maildir/mac/sendmail-01.eml +1 -4
  543. data/set-of-emails/maildir/mac/surfcontrol-01.eml +1 -5
  544. data/set-of-emails/maildir/mac/uk-messagelabs-01.eml +1 -4
  545. data/set-of-emails/maildir/mac/us-amazonses-01.eml +1 -4
  546. data/set-of-emails/maildir/mac/us-aol-01.eml +1 -15
  547. data/set-of-emails/maildir/mac/us-bigfoot-01.eml +1 -4
  548. data/set-of-emails/maildir/mac/us-facebook-01.eml +1 -4
  549. data/set-of-emails/maildir/mac/us-google-01.eml +1 -1
  550. data/set-of-emails/maildir/mac/us-outlook-01.eml +1 -4
  551. data/set-of-emails/maildir/mac/us-receivingses-01.eml +1 -4
  552. data/set-of-emails/maildir/mac/us-sendgrid-01.eml +1 -3
  553. data/set-of-emails/maildir/mac/us-verizon-01.eml +1 -2
  554. data/set-of-emails/maildir/mac/us-yahoo-01.eml +1 -1
  555. data/set-of-emails/maildir/mac/us-zoho-01.eml +1 -2
  556. data/set-of-emails/maildir/mac/v5sendmail-01.eml +1 -0
  557. data/set-of-emails/maildir/mac/x1-01.eml +1 -4
  558. data/set-of-emails/maildir/mac/x2-01.eml +1 -1
  559. data/set-of-emails/maildir/mac/x3-01.eml +1 -3
  560. data/set-of-emails/maildir/mac/x4-01.eml +1 -2
  561. data/set-of-emails/maildir/mac/x5-01.eml +1 -8
  562. data/set-of-emails/maildir/not/is-not-bounce-01.eml +25 -0
  563. data/set-of-emails/to-be-debugged-because/reason-is-onhold/onhold-0001.eml +85 -0
  564. data/set-of-emails/to-be-debugged-because/reason-is-undefined/undefined-0002.eml +27 -0
  565. data/set-of-emails/to-be-debugged-because/reason-is-undefined/undefined-0003.eml +78 -0
  566. data/set-of-emails/to-be-debugged-because/sisimai-cannot-parse-yet/cannot-parse-this-email-0002.eml +25 -0
  567. data/set-of-emails/to-be-debugged-because/something-is-wrong/issue-106-01.eml +79 -0
  568. data/set-of-emails/to-be-debugged-because/something-is-wrong/issue-106-02.eml +72 -0
  569. data/set-of-emails/to-be-debugged-because/something-is-wrong/issue-106-03.eml +68 -0
  570. data/set-of-emails/to-be-debugged-because/something-is-wrong/no-message-id-from-pr-150.eml +75 -0
  571. data/set-of-emails/to-be-parsed-for-test/README.md +20 -0
  572. data/sisimai-java.gemspec +29 -0
  573. data/sisimai.gemspec +28 -0
  574. metadata +680 -0
@@ -0,0 +1,58 @@
1
+ module Sisimai
2
+ # Sisimai::SMTP is a parent class of Sisimai::SMTP::Status and Sisimai::SMTP::Reply.
3
+ module SMTP
4
+ class << self
5
+ # Imported from p5-Sisimail/lib/Sisimai/SMTP.pm
6
+
7
+ # Check softbounce or not
8
+ # @param [String] argv1 String including SMTP Status code
9
+ # @return [True,False,Nil] true: Soft bounce
10
+ # false: Hard bounce
11
+ # nil: May not be bounce ?
12
+ def is_softbounce(argv1 = '')
13
+ return nil unless argv1
14
+ return nil unless argv1.size > 0
15
+
16
+ mesgstring = argv1.to_s
17
+ classvalue = nil
18
+ softbounce = -1
19
+
20
+ if cv = mesgstring.match(/\b([245])\d\d\b/)
21
+ # Valid SMTP reply code such as 550, 421
22
+ classvalue = cv[1].to_i
23
+
24
+ elsif cv = mesgstring.match(/\b([245])[.][0-9][.]\d+\b/)
25
+ # DSN value such as 5.1.1, 4.4.7
26
+ classvalue = cv[1].to_i
27
+ end
28
+
29
+ if classvalue == 4
30
+ # Soft bounce, Persistent transient error
31
+ softbounce = true
32
+
33
+ elsif classvalue == 5
34
+ # Hard bounce, Permanent error
35
+ softbounce = false
36
+ else
37
+ # Check with regular expression
38
+ if mesgstring =~ /(?:temporar|persistent)/i
39
+ # Temporary failure
40
+ softbounce = true
41
+
42
+ elsif mesgstring =~ /permanent/i
43
+ # Permanently failure
44
+ softbounce = false
45
+
46
+ else
47
+ # did not find information to decide that it is a soft bounce
48
+ # or a hard bounce.
49
+ softbounce = nil
50
+ end
51
+ end
52
+
53
+ return softbounce
54
+ end
55
+ end
56
+ end
57
+ end
58
+
@@ -0,0 +1,84 @@
1
+ # http://www.ietf.org/rfc/rfc5321.txt
2
+ # 4.2.1. Reply Code Severities and Theory
3
+ # 2yz Positive Completion reply
4
+ # 3yz Positive Intermediate reply
5
+ # 4yz Transient Negative Completion reply
6
+ # 5yz Permanent Negative Completion reply
7
+ #
8
+ # x0z Syntax: These replies refer to syntax errors, syntactically
9
+ # correct commands that do not fit any functional category, and
10
+ # unimplemented or superfluous commands.
11
+ # x1z Information: These are replies to requests for information, such
12
+ # as status or help.
13
+ # x2z Connections: These are replies referring to the transmission
14
+ # channel.
15
+ # x3z Unspecified.
16
+ # x4z Unspecified.
17
+ # x5z Mail system: These replies indicate the status of the receiver
18
+ # mail system vis-a-vis the requested transfer or other mail system
19
+ # action.
20
+ #
21
+ # 4.2.3. Reply Codes in Numeric Order
22
+ # 211 System status, or system help reply
23
+ # 214 Help message (Information on how to use the receiver or the
24
+ # meaning of a particular non-standard command; this reply is useful
25
+ # only to the human user)
26
+ # 220 <domain> Service ready
27
+ # 221 <domain> Service closing transmission channel
28
+ # 250 Requested mail action okay, completed
29
+ # 251 User not local; will forward to <forward-path> (See Section 3.4)
30
+ # 252 Cannot VRFY user, but will accept message and attempt delivery
31
+ # (See Section 3.5.3)
32
+ # 354 Start mail input; end with <CRLF>.<CRLF>
33
+ # 421 <domain> Service not available, closing transmission channel
34
+ # (This may be a reply to any command if the service knows it must
35
+ # shut down)
36
+ # 450 Requested mail action not taken: mailbox unavailable (e.g.,
37
+ # mailbox busy or temporarily blocked for policy reasons)
38
+ # 451 Requested action aborted: local error in processing
39
+ # 452 Requested action not taken: insufficient system storage
40
+ # 455 Server unable to accommodate parameters
41
+ # 500 Syntax error, command unrecognized (This may include errors such
42
+ # as command line too long)
43
+ # 501 Syntax error in parameters or arguments
44
+ # 502 Command not implemented (see Section 4.2.4)
45
+ # 503 Bad sequence of commands
46
+ # 504 Command parameter not implemented
47
+ # 550 Requested action not taken: mailbox unavailable (e.g., mailbox
48
+ # not found, no access, or command rejected for policy reasons)
49
+ # 551 User not local; please try <forward-path> (See Section 3.4)
50
+ # 552 Requested mail action aborted: exceeded storage allocation
51
+ # 553 Requested action not taken: mailbox name not allowed (e.g.,
52
+ # mailbox syntax incorrect)
53
+ # 554 Transaction failed (Or, in the case of a connection-opening
54
+ # response, "No SMTP service here")
55
+ # 555 MAIL FROM/RCPT TO parameters not recognized or not implemented
56
+ #
57
+ module Sisimai
58
+ module SMTP
59
+ # Sisimai::SMTP::Reply is utilities for getting SMTP Reply Code value from
60
+ # error message text.
61
+ module Reply
62
+ # Imported from p5-Sisimail/lib/Sisimai/SMTP/Reply.pm
63
+ class << self
64
+ # Get SMTP Reply Code from the given string
65
+ # @param [String] argv1 String including SMTP Reply Code like 550
66
+ # @return [String] SMTP Reply Code or empty if the first argument
67
+ # did not include SMTP Reply Code value
68
+ def find(argv1 = '')
69
+ return '' unless argv1
70
+ return '' unless argv1.size > 0
71
+ return '' if argv1 =~ /X-Unix;/i
72
+
73
+ if cv = argv1.match(/\b([45][0-5][0-9])\b/) || cv = argv1.match(/\b(25[0-3])\b/)
74
+ # 550, 447, or 250
75
+ return cv[1]
76
+ else
77
+ return ''
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
84
+
@@ -0,0 +1,758 @@
1
+ # http://www.iana.org/assignments/smtp-enhanced-status-codes/smtp-enhanced-status-codes.xhtml
2
+ #
3
+ # ------------------------------------------------------------------------------
4
+ # [Class Sub-Codes]
5
+ # 2.X.Y Success
6
+ # 4.X.Y Persistent Transient Failure
7
+ # 5.X.Y Permanent Failure
8
+ #
9
+ # ------------------------------------------------------------------------------
10
+ # [Subject Sub-Codes]
11
+ #
12
+ # X.0.X --- Other or Undefined Status
13
+ # There is no additional subject information available.
14
+ #
15
+ # X.1.X --- Addressing Status
16
+ # The address status reports on the originator or destination address.
17
+ # It may include address syntax or validity.
18
+ # These errors can generally be corrected by the sender and retried.
19
+ #
20
+ # X.2.X --- Mailbox Status
21
+ # Mailbox status indicates that something having to do with the mailbox
22
+ # has caused this DSN. Mailbox issues are assumed to be under the general
23
+ # control of the recipient.
24
+ #
25
+ # X.3.X --- Mail System Status
26
+ # Mail system status indicates that something having to do with the
27
+ # destination system has caused this DSN. System issues are assumed to
28
+ # be under the general control of the destination system administrator.
29
+ #
30
+ # X.4.X --- Network and Routing Status
31
+ # The networking or routing codes report status about the delivery
32
+ # system itself. These system components include any necessary
33
+ # infrastructure such as directory and routing services. Network issues
34
+ # are assumed to be under the control of the destination or intermediate
35
+ # system administrator.
36
+ #
37
+ # X.5.X --- Mail Delivery Protocol Status
38
+ # The mail delivery protocol status codes report failures involving
39
+ # the message delivery protocol. These failures include the full range
40
+ # of problems resulting from implementation errors or an unreliable
41
+ # connection.
42
+ #
43
+ # X.6.X --- Message Content or Media Status
44
+ # The message content or media status codes report failures involving
45
+ # the content of the message. These codes report failures due to
46
+ # translation, transcoding, or otherwise unsupported message media.
47
+ # Message content or media issues are under the control of both the
48
+ # sender and the receiver, both of which must support a common set of
49
+ # supported content-types.
50
+ #
51
+ # X.7.X --- Security or Policy Status
52
+ # The security or policy status codes report failures involving policies
53
+ # such as per-recipient or per-host filtering and cryptographic operations.
54
+ # Security and policy status issues are assumed to be under the control
55
+ # of either or both the sender and recipient.
56
+ # Both the sender and recipient must permit the exchange of messages
57
+ # and arrange the exchange of necessary keys and certificates for
58
+ # cryptographic operations.
59
+ #
60
+ # ------------------------------------------------------------------------------
61
+ # [Enumerated Status Codes]
62
+ #
63
+ # X.0.0 Any Other undefined Status:(RFC 3463)
64
+ # Other undefined status is the only undefined error code. It
65
+ # should be used for all errors for which only the class of the
66
+ # error is known.
67
+ #
68
+ # X.1.0 --- Other address status:(RFC 3463)
69
+ # Something about the address specified in the message caused
70
+ # this DSN.
71
+ #
72
+ # X.1.1 451 Bad destination mailbox address:(RFC3463)
73
+ # 550 The mailbox specified in the address does not exist.
74
+ # For Internet mail names, this means the address portion to the
75
+ # the left of the "@" sign is invalid.
76
+ # This code is only useful for permanent failures.
77
+ #
78
+ # X.1.2 --- Bad destination system addres:
79
+ # The destination system specified in the address does not exist
80
+ # or is incapable of accepting mail. For Internet mail names,
81
+ # this means the address portion to the right of the "@" is
82
+ # invalid for mail.
83
+ # This code is only useful for permanent failures.
84
+ #
85
+ # X.1.3 501 Bad destination mailbox address syntax:
86
+ # The destination address was syntactically invalid. This can
87
+ # apply to any field in the address. This code is only useful
88
+ # for permanent failures.
89
+ #
90
+ # X.1.4 --- Destination mailbox address ambiguous:(RFC 3463)
91
+ # The mailbox address as specified matches one or more recipients
92
+ # on the destination system.
93
+ # This may result if a heuristic address mapping algorithm is
94
+ # used to map the specified address to a local mailbox name.
95
+ #
96
+ # X.1.5 250 Destination address valid:(RFC 3463)
97
+ # This mailbox address as specified was valid. This status code
98
+ # should be used for positive delivery reports.
99
+ #
100
+ # X.1.6 --- Destination mailbox has moved, No forwarding address:(RFC 3463)
101
+ # The mailbox address provided was at one time valid, but mail
102
+ # is no longer being accepted for that address.
103
+ # This code is only useful for permanent failures.
104
+ #
105
+ # X.1.7 --- Bad sender's mailbox address syntax:(RFC 3463)
106
+ # The sender's address was syntactically invalid. This can apply
107
+ # to any field in the address.
108
+ #
109
+ # X.1.8 451 Bad sender's system address:(RFC 3463)
110
+ # 501 The sender's system specified in the address does not exist or
111
+ # is incapable of accepting return mail. For domain names, this
112
+ # means the address portion to the right of the "@" is invalid
113
+ # for mail.
114
+ #
115
+ # X.1.9 --- Message relayed to non-compliant mailer:(RFC 5248, 3886)
116
+ # The mailbox address specified was valid, but the message has
117
+ # been relayed to a system that does not speak this protocol;
118
+ # no further information can be provided.
119
+ #
120
+ # X.1.10 --- Recipient address has null MX:(RFC 7505)
121
+ # This status code is returned when the associated address is
122
+ # marked as invalid using a null MX.
123
+ # ------------------------------------------------------------------------------
124
+ # X.2.0 --- Other or undefined mailbox status:(RFC 3463)
125
+ # The mailbox exists, but something about the destination mailbox
126
+ # has caused the sending of this DSN.
127
+ #
128
+ # X.2.1 --- Mailbox disabled, not accepting messages:(RFC 3463)
129
+ # The mailbox exists, but is not accepting messages. This may be
130
+ # a permanent error if the mailbox will never be re-enabled or a
131
+ # transient error if the mailbox is only temporarily disabled.
132
+ #
133
+ # X.2.2 552 Mailbox full:(RFC 3463)
134
+ # The mailbox is full because the user has exceeded a per-mailbox
135
+ # administrative quota or physical capacity. The general semantics
136
+ # implies that the recipient can delete messages to make more
137
+ # space available.
138
+ # This code should be used as a persistent transient failure.
139
+ #
140
+ # X.2.3 552 Message length exceeds administrative limit:(RFC 3463)
141
+ # A per-mailbox administrative message length limit has been
142
+ # exceeded. This status code should be used when the per-mailbox
143
+ # message length limit is less than the general system limit.
144
+ # This code should be used as a permanent failure.
145
+ #
146
+ # X.2.4 450 Mailing list expansion problem:(RFC 3463)
147
+ # 452 The mailbox is a mailing list address and the mailing list was
148
+ # unable to be expanded. This code may represent a permanent
149
+ # failure or a persistent transient failure.
150
+ # ------------------------------------------------------------------------------
151
+ # X.3.0 221 Other or undefined mail system status:(RFC 3463)
152
+ # 250 The destination system exists and normally accepts mail, but
153
+ # 421,451 something about the system has caused the generation of this
154
+ # 550,554 DSN.
155
+ #
156
+ # X.3.1 452 Mail system full:(RFC 3463)
157
+ # Mail system storage has been exceeded. The general semantics
158
+ # imply that the individual recipient may not be able to delete
159
+ # material to make room for additional messages. This is useful
160
+ # only as a persistent transient error.
161
+ #
162
+ # X.3.2 453 System not accepting network messages:(RFC 3463)
163
+ # 521 The host on which the mailbox is resident is not accepting messages.
164
+ # Examples of such conditions include an imminent shutdown, excessive
165
+ # load, or system maintenance. This is useful for both permanent
166
+ # and persistent transient errors.
167
+ #
168
+ # X.3.3 --- System not capable of selected features:(RFC 3463)
169
+ # Selected features specified for the message are not supported
170
+ # by the destination system. This can occur in gateways when
171
+ # features from one domain cannot be mapped onto the supported
172
+ # feature in another.
173
+ #
174
+ # X.3.4 552 Message too big for system:(RFC 3463)
175
+ # 554 The message is larger than per-message size limit. This limit
176
+ # may either be for physical or administrative reasons. This is
177
+ # useful only as a permanent error.
178
+ #
179
+ # X.3.5 --- System incorrectly configured:(RFC 3463)
180
+ # The system is not configured in a manner that will permit it
181
+ # to accept this message.
182
+ # ------------------------------------------------------------------------------
183
+ # X.4.0 --- Other or undefined network or routing status:(RFC 3463)
184
+ # Something went wrong with the networking, but it is not clear
185
+ # what the problem is, or the problem cannot be well expressed
186
+ # with any of the other provided detail codes.
187
+ #
188
+ # X.4.1 451 No answer from host:(RFC 3463)
189
+ # The outbound connection attempt was not answered, because either
190
+ # the remote system was busy, or was unable to take a call.
191
+ # This is useful only as a persistent transient error.
192
+ #
193
+ # X.4.2 421 Bad connection:(RFC 3463)
194
+ # The outbound connection was established, but was unable to
195
+ # complete the message transaction, either because of time-out,
196
+ # or inadequate connection quality. This is useful only as a
197
+ # persistent transient error.
198
+ #
199
+ # X.4.3 451 Directory server failure:(RFC 3463)
200
+ # 550 The network system was unable to forward the message, because
201
+ # a directory server was unavailable. This is useful only as a
202
+ # persistent transient error. The inability to connect to an
203
+ # Internet DNS server is one example of the directory server
204
+ # failure error.
205
+ #
206
+ # X.4.4 --- Unable to route:(RFC 3463)
207
+ # The mail system was unable to determine the next hop for the
208
+ # message because the necessary routing information was unavailable
209
+ # from the directory server. This is useful for both permanent
210
+ # and persistent transient errors. A DNS lookup returning only
211
+ # an SOA (Start of Administration) record for a domain name is
212
+ # one example of the unable to route error.
213
+ #
214
+ # X.4.5 451 Mail system congestion:(RFC 3463)
215
+ # The mail system was unable to deliver the message because the
216
+ # mail system was congested. This is useful only as a persistent
217
+ # transient error.
218
+ #
219
+ # X.4.6 --- Routing loop detected:(RFC 3463)
220
+ # A routing loop caused the message to be forwarded too many times,
221
+ # either because of incorrect routing tables or a user-forwarding
222
+ # loop. This is useful only as a persistent transient error.
223
+ #
224
+ # X.4.7 --- Delivery time expired:(RFC 3463)
225
+ # The message was considered too old by the rejecting system,
226
+ # either because it remained on that host too long or because
227
+ # the time-to-live value specified by the sender of the message
228
+ # was exceeded. If possible, the code for the actual problem
229
+ # found when delivery was attempted should be returned rather
230
+ # than this code.
231
+ # ------------------------------------------------------------------------------
232
+ # X.5.0 220 Other or undefined protocol status:(RFC 3463)
233
+ # 250-253 Something was wrong with the protocol necessary to deliver the
234
+ # 451,452 message to the next hop and the problem cannot be well expressed
235
+ # 454,458 with any of the other provided detail codes.
236
+ # 459,554
237
+ # 501-503
238
+ #
239
+ # X.5.1 430 Invalid command:(RFC 3463)
240
+ # 500,501 A mail transaction protocol command was issued which was either
241
+ # 503,530 out of sequence or unsupported.
242
+ # 550,554 This is useful only as a permanent error.
243
+ # 555
244
+ #
245
+ # X.5.2 500 Syntax error:(RFC 3463)
246
+ # 500,501 A mail transaction protocol command was issued which could not
247
+ # 502,550 be interpreted, either because the syntax was wrong or the
248
+ # 555 command is unrecognized.
249
+ # This is useful only as a permanent error.
250
+ #
251
+ # X.5.3 451 Too many recipients:(RFC 3463)
252
+ # More recipients were specified for the message than could have
253
+ # been delivered by the protocol. This error should normally result
254
+ # in the segmentation of the message into two, the remainder of
255
+ # the recipients to be delivered on a subsequent delivery attempt.
256
+ # It is included in this list in the event that such segmentation
257
+ # is not possible.
258
+ #
259
+ # X.5.4 451 Invalid command arguments:(RFC 3463)
260
+ # 501-504 A valid mail transaction protocol command was issued with
261
+ # 550 invalid arguments, either because the arguments were out of
262
+ # 555 range or represented unrecognized features.
263
+ # This is useful only as a permanent error.
264
+ #
265
+ # X.5.5 --- Wrong protocol version:(RFC 3463)
266
+ # A protocol version mis-match existed which could not be
267
+ # automatically resolved by the communicating parties.
268
+ #
269
+ # X.5.6 550 Authentication Exchange line is too long (RFC 4954)
270
+ # This enhanced status code SHOULD be returned when the server
271
+ # fails the AUTH command due to the client sending a [BASE64]
272
+ # response which is longer than the maximum buffer size available
273
+ # for the currently selected SASL mechanism. This is useful for
274
+ # both permanent and persistent transient errors.
275
+ # ------------------------------------------------------------------------------
276
+ # X.6.0 --- Other or undefined media error:(RFC 3463)
277
+ # Something about the content of a message caused it to be considered
278
+ # undeliverable and the problem cannot be well expressed with
279
+ # any of the other provided detail codes.
280
+ #
281
+ # X.6.1 --- Media not supported:(RFC 3463)
282
+ # The media of the message is not supported by either the delivery
283
+ # protocol or the next system in the forwarding path. This is
284
+ # useful only as a permanent error.
285
+ #
286
+ # X.6.2 --- Conversion required and prohibited:(RFC 3463)
287
+ # The content of the message must be converted before it can be
288
+ # delivered and such conversion is not permitted. Such prohibitions
289
+ # may be the expression of the sender in the message itself or
290
+ # the policy of the sending host.
291
+ #
292
+ # X.6.3 554 Conversion required but not supported:(RFC 3463)
293
+ # The message content must be converted in order to be forwarded
294
+ # but such conversion is not possible or is not practical by a
295
+ # host in the forwarding path. This condition may result when
296
+ # an ESMTP gateway supports 8bit transport but is not able to
297
+ # downgrade the message to 7 bit as required for the next hop.
298
+ #
299
+ # X.6.4 250 Conversion with loss performed:(RFC 3463)
300
+ # This is a warning sent to the sender when message delivery was
301
+ # successfully but when the delivery required a conversion in
302
+ # which some data was lost. This may also be a permanent error
303
+ # if the sender has indicated that conversion with loss is
304
+ # prohibited for the message.
305
+ #
306
+ # X.6.5 --- Conversion Failed:(RFC 3463)
307
+ # A conversion was required but was unsuccessful. This may be
308
+ # useful as a permanent or persistent temporary notification.
309
+ #
310
+ # X.6.6 554 Message content not available (RFC 4468)
311
+ # The message content could not be fetched from a remote system.
312
+ # This may be useful as a permanent or persistent temporary
313
+ # notification.
314
+ #
315
+ # X.6.7 553 The ALT-ADDRESS is required but not specified:(RFC 6531)
316
+ # 550 This indicates the reception of a MAIL or RCPT command that
317
+ # non-ASCII addresses are not permitted
318
+ #
319
+ # X.6.8 252 UTF-8 string reply is required, but not permitted by the client:(RFC 6531)
320
+ # 553 This indicates that a reply containing a UTF-8 string is required
321
+ # 550 to show the mailbox name, but that form of response is not permitted
322
+ # by the SMTP client.
323
+ #
324
+ # X.6.9 550 UTF8SMTP downgrade failed:(RFC 6531)
325
+ # This indicates that transaction failed after the final "." of
326
+ # the DATA command.
327
+ #
328
+ # X.6.10 This is a duplicate of X.6.8 and is thus deprecated.
329
+ # ------------------------------------------------------------------------------
330
+ # X.7.0 220 Other or undefined security status:(RFC 3463)
331
+ # 235 Something related to security caused the message to be returned,
332
+ # 450,454 and the problem cannot be well expressed with any of the other
333
+ # 500,501 provided detail codes. This status code may also be used when
334
+ # 503,504 the condition cannot be further described because of security
335
+ # 530,535 policies in force.
336
+ # 550
337
+ #
338
+ # X.7.1 451 Delivery not authorized, message refused:(RFC 3463)
339
+ # 454,502 The sender is not authorized to send to the destination. This
340
+ # 503,533 can be the result of per-host or per-recipient filtering. This
341
+ # 550,551 memo does not discuss the merits of any such filtering, but
342
+ # provides a mechanism to report such. This is useful only as
343
+ # a permanent error.
344
+ #
345
+ # X.7.2 550 Mailing list expansion prohibited:(RFC 3463)
346
+ # The sender is not authorized to send a message to the intended
347
+ # mailing list. This is useful only as a permanent error.
348
+ #
349
+ # X.7.3 --- Security conversion required but not possible:(RFC 3463)
350
+ # A conversion from one secure messaging protocol to another was
351
+ # required for delivery and such conversion was not possible.
352
+ # This is useful only as a permanent error.
353
+ #
354
+ # X.7.4 504 Security features not supported:(RFC 3463)
355
+ # A message contained security features such as secure authentication
356
+ # that could not be supported on the delivery protocol. This is
357
+ # useful only as a permanent error.
358
+ #
359
+ # X.7.5 --- Cryptographic failure:(RFC 3463)
360
+ # A transport system otherwise authorized to validate or decrypt
361
+ # a message in transport was unable to do so because necessary
362
+ # information such as key was not available or such information
363
+ # was invalid.
364
+ #
365
+ # X.7.6 --- Cryptographic algorithm not supported:(RFC 3463)
366
+ # A transport system otherwise authorized to validate or decrypt
367
+ # a message was unable to do so because the necessary algorithm
368
+ # was not supported.
369
+
370
+ # X.7.7 --- Message integrity failure:(RFC 3463)
371
+ # A transport system otherwise authorized to validate a message
372
+ # was unable to do so because the message was corrupted or altered.
373
+ # This may be useful as a permanent, transient persistent, or
374
+ # successful delivery code.
375
+ #
376
+ # X.7.8 535 Trust relationship required:(RFC 4954)
377
+ # 554 This response to the AUTH command indicates that the authentication
378
+ # failed due to invalid or insufficient authentication credentials.
379
+ # In this case, the client SHOULD ask the user to supply new credentials
380
+ # (such as by presenting a password dialog box).
381
+ #
382
+ # X.7.9 534 Authentication mechanism is too weak:(RFC 4954)
383
+ # This response to the AUTH command indicates that the selected
384
+ # authentication mechanism is weaker than server policy permits
385
+ # for that user. The client SHOULD retry with a new authentication
386
+ # mechanism.
387
+ #
388
+ # X.7.10 523 Encryption Needed:(RFC 5248)
389
+ # This indicates that external strong privacy layer is needed in
390
+ # order to use the requested authentication mechanism. This is
391
+ # primarily intended for use with clear text authentication mechanisms.
392
+ # A client which receives this may activate a security layer such
393
+ # as TLS prior to authenticating, or attempt to use a stronger
394
+ # mechanism.
395
+ #
396
+ # X.7.11 524 Encryption required for requested authentication mechanism:(RFC 4954)
397
+ # 538 This response to the AUTH command indicates that the selected
398
+ # authentication mechanism may only be used when the underlying
399
+ # SMTP connection is encrypted. Note that this response code is
400
+ # documented here for historical purposes only. Modern implementations
401
+ # SHOULD NOT advertise mechanisms that are not permitted due to
402
+ # lack of encryption, unless an encryption layer of sufficient
403
+ # strength is currently being employed.
404
+ #
405
+ # X.7.12 422 A password transition is needed:(RFC 4954)
406
+ # 432 This response to the AUTH command indicates that the user needs
407
+ # to transition to the selected authentication mechanism. This
408
+ # is typically done by authenticating once using the [PLAIN]
409
+ # authentication mechanism. The selected mechanism SHOULD then
410
+ # work for authentications in subsequent sessions.
411
+ #
412
+ # X.7.13 525 User Account Disabled:(RFC 5248)
413
+ # Sometimes a system administrator will have to disable a user's
414
+ # account (e.g., due to lack of payment, abuse, evidence of a
415
+ # break-in attempt, etc).
416
+ # This error code occurs after a successful authentication to a
417
+ # disabled account. This informs the client that the failure is
418
+ # permanent until the user contacts their system administrator
419
+ # to get the account re-enabled.
420
+ # It differs from a generic authentication failure where the
421
+ # client's best option is to present the passphrase entry dialog
422
+ # in case the user simply mistyped their passphrase.
423
+ #
424
+ # X.7.14 535 Trust relationship required:(RFC 5248)
425
+ # 554 The submission server requires a configured trust relationship
426
+ # with a third-party server in order to access the message content.
427
+ # This value replaces the prior use of X.7.8 for this error condition.
428
+ # thereby updating [RFC4468].
429
+ #
430
+ # X.7.15 450 Priority Level is too low:(RFC6710)
431
+ # 550 The specified priority level is below the lowest priority acceptable
432
+ # 4xx for the receiving SMTP server. This condition might be temporary,
433
+ # 5xx for example the server is operating in a mode where only higher
434
+ # priority messages are accepted for transfer and delivery, while
435
+ # lower priority messages are rejected.
436
+ #
437
+ # X.7.16 552 Message is too big for the specified priority:(RFC 6710)
438
+ # 4xx The message is too big for the specified priority.
439
+ # 5xx This condition might be temporary, for example the server is
440
+ # operating in a mode where only higher priority messages below
441
+ # certain size are accepted for transfer and delivery.
442
+ #
443
+ # X.7.17 5xx Mailbox owner has changed:(RFC 6710)
444
+ # This status code is returned when a message is received with
445
+ # a Require-Recipient-Valid-Since field or RRVS extension and
446
+ # the receiving system is able to determine that the intended
447
+ # recipient mailbox has not been under continuous ownership since
448
+ # the specified date-time.
449
+ #
450
+ # X.7.18 5xx Domain owner has changed:(RFC 7293)
451
+ # This status code is returned when a message is received with
452
+ # a Require-Recipient-Valid-Since field or RRVS extension and
453
+ # the receiving system wishes to disclose that the owner of the
454
+ # domain name of the recipient has changed since the specified
455
+ # date-time.
456
+ #
457
+ # X.7.19 5xx RRVS test cannot be completed:(RFC 7293)
458
+ # This status code is returned when a message is received with
459
+ # a Require-Recipient-Valid-Since field or RRVS extension and
460
+ # the receiving system cannot complete the requested evaluation
461
+ # because the required timestamp was not recorded.
462
+ # The message originator needs to decide whether to reissue the
463
+ # message without RRVS protection.
464
+ #
465
+ # X.7.20 550 No passing DKIM signature found:(RFC 7372)
466
+ # This status code is returned when a message did not contain
467
+ # any passing DKIM signatures. (This violates the advice of
468
+ # Section 6.1 of [RFC6376].)
469
+ #
470
+ # X.7.21 550 No acceptable DKIM signature found:(RFC 7372, 6476)
471
+ # This status code is returned when a message contains one or
472
+ # more passing DKIM signatures, but none are acceptable.
473
+ # (This violates the advice of Section 6.1 of [RFC6376].)
474
+ #
475
+ # X.7.22 550 No valid author-matched DKIM signature found:(RFC 7372)
476
+ # This status code is returned when a message contains one or
477
+ # more passing DKIM signatures, but none are acceptable because
478
+ # none have an identifier(s) that matches the author address(es)
479
+ # found in the From header field.
480
+ # This is a special case of X.7.21. (This violates the advice of
481
+ # Section 6.1 of [RFC6376].)
482
+ #
483
+ # X.7.23 550 SPF validation failed:(RFC 7273, 7208)
484
+ # This status code is returned when a message completed an SPF
485
+ # check that produced a "fail" result, contrary to local policy
486
+ # requirements. Used in place of 5.7.1 as described in Section
487
+ # 8.4 of [RFC7208].
488
+ #
489
+ # X.7.24 451 SPF validation error:(RFC 7372, 7208)
490
+ # 550 This status code is returned when evaluation of SPF relative
491
+ # to an arriving message resulted in an error. Used in place of
492
+ # 4.4.3 or 5.5.2 as described in Sections 8.6 and 8.7 of [RFC7208].
493
+ #
494
+ # X.7.25 550 Reverse DNS validation failed:(RFC 7372, 7601)
495
+ # This status code is returned when an SMTP client's IP address
496
+ # failed a reverse DNS validation check, contrary to local policy
497
+ # requirements.
498
+ #
499
+ # X.7.26 550 Multiple authentication checks failed:(RFC 7372)
500
+ # This status code is returned when a message failed more than
501
+ # one message authentication check, contrary to local policy
502
+ # requirements. The particular mechanisms that failed are not
503
+ # specified.
504
+ #
505
+ # X.7.27 550 Sender address has null MX:(RFC 7505)
506
+ # This status code is returned when the associated sender address
507
+ # has a null MX, and the SMTP receiver is configured to reject
508
+ # mail from such sender (e.g., because it could not return a DSN).
509
+ # ------------------------------------------------------------------------------
510
+ # SAMPLES
511
+ #
512
+ # 554 5.5.0 No recipients have been specified
513
+ # 503 5.5.0 Valid RCPT TO required before BURL
514
+ # 554 5.6.3 Conversion required but not supported
515
+ # 554 5.3.4 Message too big for system
516
+ # 554 5.7.8 URL resolution requires trust relationship
517
+ # 552 5.2.2 Mailbox full
518
+ # 554 5.6.6 IMAP URL resolution failed
519
+ # 250 2.5.0 Waiting for additional BURL or BDAT commands
520
+ # 451 4.4.1 IMAP server unavailable
521
+ # 250 2.5.0 Ok.
522
+ # 250 2.6.4 MIME header conversion with loss performed
523
+ # 235 2.7.0 Authentication Succeeded
524
+ # 432 4.7.12 A password transition is needed
525
+ # 454 4.7.0 Temporary authentication failure
526
+ # 534 5.7.9 Authentication mechanism is too weak
527
+ # 535 5.7.8 Authentication credentials invalid
528
+ # 500 5.5.6 Authentication Exchange line is too long
529
+ # 530 5.7.0 Authentication required
530
+ # 538 5.7.11 Encryption required for requested authentication
531
+ # 5.7.8 Authentication credentials invalid
532
+ # 5.7.9 Authentication mechanism is too weak
533
+ # 5.7.11 Encryption required for requested authentication mechanism
534
+ # ------------------------------------------------------------------------------
535
+ module Sisimai
536
+ module SMTP
537
+ # Sisimai::RFC3463 is utilities for getting D.S.N. value from error reason text,
538
+ # getting the reason from D.S.N. value, and getting D.S.N. from the text including
539
+ # D.S.N.
540
+ module Status
541
+ # Imported from p5-Sisimail/lib/Sisimai/SMTP/Status.pm
542
+ class << self
543
+ StandardCode = {
544
+ '2.1.5' => 'delivered', # Successfully delivered
545
+ # ------------------------------------------------------------------------------
546
+ '4.1.6' => 'hasmoved', # Destination mailbox has moved, No forwarding address
547
+ '4.1.7' => 'rejected', # Bad sender's mailbox address syntax
548
+ '4.1.8' => 'rejected', # Bad sender's system address
549
+ '4.1.9' => 'systemerror', # Message relayed to non-compliant mailer
550
+ '4.2.1' => 'suspend', # Mailbox disabled, not accepting messages
551
+ '4.2.2' => 'mailboxfull', # Mailbox full
552
+ '4.2.3' => 'exceedlimit', # Message length exceeds administrative limit
553
+ '4.2.4' => 'filtered', # Mailing list expansion problem
554
+ #'4.3.0' => 'systemerror', # Other or undefined mail system status
555
+ '4.3.1' => 'systemfull', # Mail system full
556
+ '4.3.2' => 'notaccept', # System not accepting network messages
557
+ '4.3.3' => 'systemerror', # System not capable of selected features
558
+ '4.3.5' => 'systemerror', # System incorrectly configured
559
+ #'4.4.0' => 'networkerror', # Other or undefined network or routing status
560
+ '4.4.1' => 'expired', # No answer from host
561
+ '4.4.2' => 'networkerror', # Bad connection
562
+ #'4.4.3' => 'systemerror', # Directory server failure
563
+ '4.4.4' => 'networkerror', # Unable to route
564
+ '4.4.5' => 'toomanyconn', # Mail system congestion
565
+ '4.4.6' => 'networkerror', # Routing loop detected
566
+ '4.4.7' => 'expired', # Delivery time expired
567
+ #'4.5.0' => 'networkerror', # Other or undefined protocol status
568
+ '4.5.3' => 'systemerror', # Too many recipients
569
+ '4.5.5' => 'systemerror', # Wrong protocol version
570
+ '4.6.0' => 'contenterror', # Other or undefined media error
571
+ '4.6.2' => 'contenterror', # Conversion required and prohibited
572
+ '4.6.5' => 'contenterror', # Conversion Failed
573
+ #'4.7.0' => 'securityerror', # Other or undefined security status
574
+ '4.7.1' => 'blocked', # Delivery not authorized, message refused
575
+ '4.7.2' => 'blocked', # Mailing list expansion prohibited
576
+ '4.7.5' => 'securityerror', # Cryptographic failure
577
+ '4.7.6' => 'securityerror', # Cryptographic algorithm not supported
578
+ '4.7.7' => 'securityerror', # Message integrity failure
579
+ '4.7.12' => 'securityerror', # A password transition is needed
580
+ '4.7.15' => 'securityerror', # Priority Level is too low
581
+ '4.7.16' => 'mesgtoobig', # Message is too big for the specified priority
582
+ '4.7.24' => 'securityerror', # SPF validation error
583
+ # ------------------------------------------------------------------------------
584
+ '5.1.0' => 'userunknown', # Other address status
585
+ '5.1.1' => 'userunknown', # Bad destination mailbox address
586
+ '5.1.2' => 'hostunknown', # Bad destination system address
587
+ '5.1.3' => 'userunknown', # Bad destination mailbox address syntax
588
+ '5.1.4' => 'filtered', # Destination mailbox address ambiguous
589
+ '5.1.6' => 'hasmoved', # Destination mailbox has moved, No forwarding address
590
+ '5.1.7' => 'rejected', # Bad sender's mailbox address syntax
591
+ '5.1.8' => 'rejected', # Bad sender's system address
592
+ '5.1.9' => 'systemerror', # Message relayed to non-compliant mailer
593
+ '5.1.10' => 'notaccept', # Recipient address has null MX
594
+ '5.2.0' => 'filtered', # Other or undefined mailbox status
595
+ '5.2.1' => 'filtered', # Mailbox disabled, not accepting messages
596
+ '5.2.2' => 'mailboxfull', # Mailbox full
597
+ '5.2.3' => 'exceedlimit', # Message length exceeds administrative limit
598
+ '5.2.4' => 'filtered', # Mailing list expansion problem
599
+ '5.3.0' => 'systemerror', # Other or undefined mail system status
600
+ '5.3.1' => 'systemfull', # Mail system full
601
+ '5.3.2' => 'notaccept', # System not accepting network messages
602
+ '5.3.3' => 'systemerror', # System not capable of selected features
603
+ '5.3.4' => 'mesgtoobig', # Message too big for system
604
+ '5.3.5' => 'systemerror', # System incorrectly configured
605
+ '5.4.0' => 'networkerror', # Other or undefined network or routing status
606
+ '5.4.3' => 'systemerror', # Directory server failure
607
+ '5.5.3' => 'toomanyconn', # Too many recipients
608
+ '5.5.4' => 'systemerror', # Invalid command arguments
609
+ '5.5.5' => 'systemerror', # Wrong protocol version
610
+ '5.5.6' => 'securityerror', # Authentication Exchange line is too long
611
+ '5.6.0' => 'contenterror', # Other or undefined media error
612
+ '5.6.1' => 'contenterror', # Media not supported
613
+ '5.6.2' => 'contenterror', # Conversion required and prohibited
614
+ '5.6.3' => 'contenterror', # Conversion required but not supported
615
+ '5.6.5' => 'contenterror', # Conversion Failed
616
+ '5.6.6' => 'contenterror', # Message content not available
617
+ '5.6.7' => 'contenterror', # Non-ASCII addresses not permitted for that sender/recipient
618
+ '5.6.8' => 'contenterror', # UTF-8 string reply is required, but not permitted by the SMTP client
619
+ '5.6.9' => 'contenterror', # UTF-8 header message cannot be transferred to one or more recipients
620
+ '5.7.0' => 'securityerror', # Other or undefined security status
621
+ '5.7.1' => 'blocked', # Delivery not authorized, message refused
622
+ '5.7.2' => 'blocked', # Mailing list expansion prohibited
623
+ '5.7.3' => 'securityerror', # Security conversion required but not possible
624
+ '5.7.4' => 'securityerror', # Security features not supported
625
+ '5.7.5' => 'securityerror', # Cryptographic failure
626
+ '5.7.6' => 'securityerror', # Cryptographic algorithm not supported
627
+ '5.7.7' => 'securityerror', # Message integrity failure
628
+ '5.7.8' => 'securityerror', # Authentication credentials invalid
629
+ '5.7.9' => 'securityerror', # Authentication mechanism is too weak
630
+ '5.7.10' => 'securityerror', # Encryption Needed
631
+ '5.7.11' => 'securityerror', # Encryption required for requested authentication mechanism
632
+ '5.7.13' => 'suspend', # User Account Disabled
633
+ '5.7.14' => 'securityerror', # Trust relationship required
634
+ '5.7.15' => 'securityerror', # Priority Level is too low
635
+ '5.7.16' => 'mesgtoobig', # Message is too big for the specified priority
636
+ '5.7.17' => 'hasmoved', # Mailbox owner has changed
637
+ '5.7.18' => 'hasmoved', # Domain owner has changed
638
+ '5.7.19' => 'securityerror', # RRVS test cannot be completed
639
+ '5.7.20' => 'securityerror', # No passing DKIM signature found
640
+ '5.7.21' => 'securityerror', # No acceptable DKIM signature found
641
+ '5.7.22' => 'securityerror', # No valid author-matched DKIM signature found
642
+ '5.7.23' => 'securityerror', # SPF validation failed
643
+ '5.7.24' => 'securityerror', # SPF validation error
644
+ '5.7.25' => 'blocked', # Reverse DNS validation failed
645
+ '5.7.26' => 'securityerror', # Multiple authentication checks failed
646
+ '5.7.27' => 'rejected', # Sender address has null MX
647
+ }
648
+
649
+ InternalCode = {
650
+ 'temporary' => {
651
+ 'blocked' => '4.0.971',
652
+ 'contenterror' => '4.0.960',
653
+ # 'exceedlimit' => '4.0.923',
654
+ 'expired' => '4.0.947',
655
+ 'filtered' => '4.0.924',
656
+ # 'hasmoved' => '4.0.916',
657
+ # 'hostunknown' => '4.0.912',
658
+ 'mailboxfull' => '4.0.922',
659
+ # 'mailererror' => '4.0.939',
660
+ # 'mesgtoobig' => '4.0.934',
661
+ 'networkerror' => '4.0.944',
662
+ # 'norelaying' => '4.0.909',
663
+ 'notaccept' => '4.0.932',
664
+ 'onhold' => '4.0.901',
665
+ 'rejected' => '4.0.918',
666
+ 'securityerror' => '4.0.970',
667
+ 'spamdetected' => '4.0.980',
668
+ # 'suspend' => '4.0.921',
669
+ 'systemerror' => '4.0.930',
670
+ 'systemfull' => '4.0.931',
671
+ 'toomanyconn' => '4.0.945',
672
+ # 'userunknown' => '4.0.911',
673
+ 'undefined' => '4.0.900',
674
+ },
675
+ 'permanent' => {
676
+ 'blocked' => '5.0.971',
677
+ 'contenterror' => '5.0.960',
678
+ 'exceedlimit' => '5.0.923',
679
+ 'expired' => '5.0.947',
680
+ 'filtered' => '5.0.910',
681
+ 'hasmoved' => '5.0.916',
682
+ 'hostunknown' => '5.0.912',
683
+ 'mailboxfull' => '5.0.922',
684
+ 'mailererror' => '5.0.939',
685
+ 'mesgtoobig' => '5.0.934',
686
+ 'networkerror' => '5.0.944',
687
+ 'norelaying' => '5.0.909',
688
+ 'notaccept' => '5.0.932',
689
+ 'onhold' => '5.0.901',
690
+ 'rejected' => '5.0.918',
691
+ 'securityerror' => '5.0.970',
692
+ 'spamdetected' => '5.0.980',
693
+ 'suspend' => '5.0.921',
694
+ 'systemerror' => '5.0.930',
695
+ 'systemfull' => '5.0.931',
696
+ 'toomanyconn' => '5.0.945',
697
+ 'userunknown' => '5.0.911',
698
+ 'undefined' => '5.0.900',
699
+ },
700
+ }
701
+
702
+ # Convert from the reason string to the internal status code
703
+ # @param [String] argv1 Reason name
704
+ # @param [True,False] argv2 false: Permanent error
705
+ # true: Temporary error
706
+ # @return [String] DSN or empty if the 1st argument is missing
707
+ # @see name
708
+ def code(argv1 = '', argv2 = false)
709
+ return '' unless argv1
710
+ return '' unless argv1.size > 0
711
+
712
+ table = argv2 ? InternalCode['temporary'] : InternalCode['permanent']
713
+ code0 = table[argv1] || InternalCode['permanent'][argv1] || ''
714
+ return code0
715
+ end
716
+
717
+ # Convert from the status code to the reason string
718
+ # @param [String] argv1 Status code(DSN)
719
+ # @return [String] Reason name or empty if the first argument did
720
+ # not match with values in Sisimai's reason list
721
+ # @see code
722
+ def name(argv1 = '')
723
+ return '' unless argv1
724
+ return '' unless argv1.size > 0
725
+ return '' unless argv1 =~ /\A[245][.]\d[.]\d+\z/
726
+ return StandardCode[argv1] || ''
727
+ end
728
+
729
+ # Get a DSN code value from given string including DSN
730
+ # @param [String] argv1 String including DSN
731
+ # @return [String] DSN or empty string if the first agument did
732
+ # not include DSN
733
+ def find(argv1 = '')
734
+ return '' unless argv1
735
+ return '' unless argv1.size > 0
736
+
737
+ foundvalue = ''
738
+ regularexp = [
739
+ %r/[ ]?[(][#]([45][.]\d[.]\d+)[)]?[ ]?/, # #5.5.1
740
+ %r/\b\d{3}[- ][#]?([45][.]\d[.]\d+)\b/, # 550-5.1.1 OR 550 5.5.1
741
+ %r/\b([45][.]\d[.]\d+)\b/, # 5.5.1
742
+ %r/\b(2[.][0-7][.][0-7])\b/, # 2.1.5
743
+ ]
744
+
745
+ regularexp.each do |e|
746
+ # Get the value of D.S.N. in the text
747
+ next unless r = argv1.match(e)
748
+ foundvalue = r[1]
749
+ break
750
+ end
751
+
752
+ return foundvalue
753
+ end
754
+ end
755
+ end
756
+ end
757
+ end
758
+