sisimai 4.22.5 → 4.22.6

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 (140) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +20 -0
  3. data/README-JA.md +2 -2
  4. data/README.md +2 -2
  5. data/lib/sisimai/bite/email/amazonses.rb +3 -3
  6. data/lib/sisimai/bite/email/aol.rb +5 -5
  7. data/lib/sisimai/bite/email/biglobe.rb +5 -5
  8. data/lib/sisimai/bite/email/courier.rb +6 -17
  9. data/lib/sisimai/bite/email/domino.rb +10 -13
  10. data/lib/sisimai/bite/email/einsundeins.rb +3 -3
  11. data/lib/sisimai/bite/email/exim.rb +37 -42
  12. data/lib/sisimai/bite/email/gmx.rb +3 -3
  13. data/lib/sisimai/bite/email/google.rb +12 -14
  14. data/lib/sisimai/bite/email/gsuite.rb +7 -7
  15. data/lib/sisimai/bite/email/kddi.rb +6 -6
  16. data/lib/sisimai/bite/email/mailru.rb +31 -21
  17. data/lib/sisimai/bite/email/messagingserver.rb +3 -3
  18. data/lib/sisimai/bite/email/mxlogic.rb +55 -35
  19. data/lib/sisimai/bite/email/notes.rb +8 -9
  20. data/lib/sisimai/bite/email/office365.rb +13 -3
  21. data/lib/sisimai/bite/email/opensmtpd.rb +23 -21
  22. data/lib/sisimai/bite/email/outlook.rb +5 -5
  23. data/lib/sisimai/bite/email/qmail.rb +42 -51
  24. data/lib/sisimai/bite/email/receivingses.rb +7 -7
  25. data/lib/sisimai/bite/email/verizon.rb +6 -6
  26. data/lib/sisimai/bite/email/x4.rb +42 -51
  27. data/lib/sisimai/bite/email/yahoo.rb +5 -0
  28. data/lib/sisimai/bite/email/zoho.rb +3 -3
  29. data/lib/sisimai/data.rb +1 -0
  30. data/lib/sisimai/mda.rb +41 -45
  31. data/lib/sisimai/mime.rb +37 -12
  32. data/lib/sisimai/reason/filtered.rb +15 -22
  33. data/lib/sisimai/reason/notaccept.rb +2 -0
  34. data/lib/sisimai/reason/spamdetected.rb +1 -0
  35. data/lib/sisimai/rhost.rb +2 -1
  36. data/lib/sisimai/rhost/kddi.rb +40 -0
  37. data/lib/sisimai/smtp/error.rb +2 -12
  38. data/lib/sisimai/version.rb +1 -1
  39. data/set-of-emails/README.md +19 -9
  40. data/set-of-emails/logo/horizontalversions.png +0 -0
  41. data/set-of-emails/logo/icon.png +0 -0
  42. data/set-of-emails/maildir/bsd/arf-15.eml +57 -0
  43. data/set-of-emails/maildir/bsd/arf-16.eml +68 -0
  44. data/set-of-emails/maildir/bsd/{arf-05.eml → arf-17.eml} +29 -34
  45. data/set-of-emails/maildir/bsd/arf-18.eml +59 -0
  46. data/set-of-emails/maildir/bsd/arf-19.eml +67 -0
  47. data/set-of-emails/maildir/bsd/arf-20.eml +64 -0
  48. data/set-of-emails/maildir/bsd/arf-21.eml +57 -0
  49. data/set-of-emails/maildir/bsd/arf-22.eml +49 -0
  50. data/set-of-emails/maildir/bsd/{email-amazonworkmail-06.eml → email-amazonworkmail-08.eml} +4 -4
  51. data/set-of-emails/maildir/bsd/email-bigfoot-02.eml +66 -0
  52. data/set-of-emails/maildir/bsd/email-einsundeins-02.eml +45 -0
  53. data/set-of-emails/maildir/bsd/email-exchange2003-07.eml +63 -0
  54. data/set-of-emails/maildir/bsd/email-ezweb-07.eml +39 -0
  55. data/set-of-emails/maildir/bsd/{email-facebook-01.eml → email-facebook-03.eml} +7 -7
  56. data/set-of-emails/maildir/bsd/{email-facebook-02.eml → email-facebook-04.eml} +7 -7
  57. data/set-of-emails/maildir/bsd/email-fml-03.eml +69 -0
  58. data/set-of-emails/maildir/bsd/{email-google-02.eml → email-google-18.eml} +21 -20
  59. data/set-of-emails/maildir/bsd/email-gsuite-08.eml +231 -0
  60. data/set-of-emails/maildir/bsd/email-gsuite-09.eml +231 -0
  61. data/set-of-emails/maildir/bsd/email-gsuite-10.eml +254 -0
  62. data/set-of-emails/maildir/bsd/email-gsuite-11.eml +228 -0
  63. data/set-of-emails/maildir/bsd/email-mailmarshalsmtp-02.eml +43 -0
  64. data/set-of-emails/maildir/bsd/email-mailru-07.eml +82 -0
  65. data/set-of-emails/maildir/bsd/email-mailru-08.eml +82 -0
  66. data/set-of-emails/maildir/bsd/email-mailru-09.eml +80 -0
  67. data/set-of-emails/maildir/bsd/email-messagelabs-02.eml +72 -0
  68. data/set-of-emails/maildir/bsd/email-messagingserver-08.eml +150 -0
  69. data/set-of-emails/maildir/bsd/email-messagingserver-09.eml +153 -0
  70. data/set-of-emails/maildir/bsd/email-messagingserver-10.eml +145 -0
  71. data/set-of-emails/maildir/bsd/email-messagingserver-11.eml +151 -0
  72. data/set-of-emails/maildir/bsd/email-office365-04.eml +635 -0
  73. data/set-of-emails/maildir/bsd/email-office365-05.eml +561 -0
  74. data/set-of-emails/maildir/bsd/email-outlook-08.eml +69 -0
  75. data/set-of-emails/maildir/bsd/email-postfix-33.eml +71 -0
  76. data/set-of-emails/maildir/bsd/email-postfix-34.eml +54 -0
  77. data/set-of-emails/maildir/bsd/email-postfix-35.eml +70 -0
  78. data/set-of-emails/maildir/bsd/email-postfix-36.eml +73 -0
  79. data/set-of-emails/maildir/bsd/email-sendmail-49.eml +67 -0
  80. data/set-of-emails/maildir/bsd/email-sendmail-50.eml +67 -0
  81. data/set-of-emails/maildir/bsd/email-sendmail-51.eml +75 -0
  82. data/set-of-emails/maildir/bsd/email-sendmail-52.eml +68 -0
  83. data/set-of-emails/maildir/bsd/email-x3-05.eml +67 -0
  84. data/set-of-emails/maildir/bsd/email-x4-08.eml +36 -0
  85. data/set-of-emails/maildir/bsd/email-yahoo-06.eml +76 -0
  86. data/set-of-emails/maildir/bsd/email-yahoo-07.eml +76 -0
  87. data/set-of-emails/maildir/bsd/email-yahoo-08.eml +75 -0
  88. data/set-of-emails/maildir/bsd/email-yahoo-09.eml +76 -0
  89. data/set-of-emails/maildir/bsd/email-yahoo-10.eml +75 -0
  90. data/set-of-emails/maildir/bsd/email-yahoo-11.eml +80 -0
  91. data/set-of-emails/maildir/bsd/rfc3464-35.eml +43 -0
  92. data/set-of-emails/maildir/bsd/rfc3464-36.eml +40 -0
  93. data/set-of-emails/maildir/bsd/rfc3464-37.eml +50 -0
  94. data/set-of-emails/maildir/bsd/rfc3464-38.eml +17 -0
  95. data/set-of-emails/maildir/bsd/rfc3464-39.eml +23 -0
  96. data/set-of-emails/maildir/bsd/rfc3464-40.eml +115 -0
  97. data/set-of-emails/maildir/bsd/rhost-godaddy-03.eml +81 -0
  98. data/set-of-emails/maildir/bsd/rhost-kddi-01.eml +67 -0
  99. data/set-of-emails/maildir/bsd/rhost-kddi-02.eml +68 -0
  100. data/set-of-emails/maildir/dos/email-gsuite-01.eml +189 -0
  101. data/set-of-emails/maildir/dos/rfc3834-01.eml +22 -36
  102. data/set-of-emails/maildir/dos/rhost-franceptt-01.eml +102 -0
  103. data/set-of-emails/maildir/mac/email-gsuite-01.eml +1 -10
  104. data/set-of-emails/maildir/mac/rfc3834-01.eml +1 -1
  105. data/set-of-emails/maildir/mac/rhost-franceptt-01.eml +1 -4
  106. metadata +67 -41
  107. data/set-of-emails/maildir/bsd/arf-03.eml +0 -56
  108. data/set-of-emails/maildir/bsd/arf-04.eml +0 -89
  109. data/set-of-emails/maildir/bsd/arf-06.eml +0 -166
  110. data/set-of-emails/maildir/bsd/arf-07.eml +0 -59
  111. data/set-of-emails/maildir/bsd/arf-08.eml +0 -103
  112. data/set-of-emails/maildir/bsd/arf-09.eml +0 -104
  113. data/set-of-emails/maildir/bsd/arf-10.eml +0 -56
  114. data/set-of-emails/maildir/bsd/arf-13.eml +0 -76
  115. data/set-of-emails/maildir/bsd/email-amazonses-04.eml +0 -55
  116. data/set-of-emails/maildir/bsd/email-bigfoot-01.eml +0 -64
  117. data/set-of-emails/maildir/bsd/email-einsundeins-01.eml +0 -38
  118. data/set-of-emails/maildir/bsd/email-exchange2003-06.eml +0 -151
  119. data/set-of-emails/maildir/bsd/email-ezweb-06.eml +0 -33
  120. data/set-of-emails/maildir/bsd/email-fml-01.eml +0 -70
  121. data/set-of-emails/maildir/bsd/email-google-14.eml +0 -304
  122. data/set-of-emails/maildir/bsd/email-mailmarshalsmtp-01.eml +0 -43
  123. data/set-of-emails/maildir/bsd/email-messagelabs-01.eml +0 -76
  124. data/set-of-emails/maildir/bsd/email-outlook-05.eml +0 -85
  125. data/set-of-emails/maildir/bsd/email-postfix-12.eml +0 -71
  126. data/set-of-emails/maildir/bsd/email-postfix-21.eml +0 -60
  127. data/set-of-emails/maildir/bsd/email-x3-04.eml +0 -106
  128. data/set-of-emails/maildir/bsd/email-x4-07.eml +0 -153
  129. data/set-of-emails/maildir/bsd/rfc3464-02.eml +0 -43
  130. data/set-of-emails/maildir/bsd/rfc3464-03.eml +0 -40
  131. data/set-of-emails/maildir/bsd/rfc3464-22.eml +0 -105
  132. data/set-of-emails/maildir/bsd/rfc3464-23.eml +0 -21
  133. data/set-of-emails/maildir/bsd/rfc3464-25.eml +0 -33
  134. data/set-of-emails/maildir/bsd/rfc3464-27.eml +0 -180
  135. data/set-of-emails/maildir/bsd/rhost-godaddy-01.eml +0 -83
  136. data/set-of-emails/to-be-debugged-because/reason-is-onhold/onhold-0001.eml +0 -85
  137. data/set-of-emails/to-be-debugged-because/reason-is-undefined/undefined-0002.eml +0 -27
  138. data/set-of-emails/to-be-debugged-because/reason-is-undefined/undefined-0003.eml +0 -78
  139. data/set-of-emails/to-be-debugged-because/sisimai-cannot-parse-yet/cannot-parse-this-email-0002.eml +0 -25
  140. data/set-of-emails/to-be-debugged-because/something-is-wrong/no-message-id-from-pr-150.eml +0 -75
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 383458bf9c7149bd37111bb9f8c3a447e8077a6c
4
- data.tar.gz: a145574332b0193f166ac827a9f55ef1d4c21f6f
3
+ metadata.gz: 6f474a88a9ef59f779cf832e375d61550c6ab465
4
+ data.tar.gz: 4f2d1449c46743c27df6152674990b1850bfc720
5
5
  SHA512:
6
- metadata.gz: e453822ac07cf13914b0f62ad02ef664e8f020d22a5c15f5947788f5e7588b4f17b3debfbbbd23d55b3207cd8ee18367c783f7c69976225959b56a81e7cc25e1
7
- data.tar.gz: 93550044f8ee76e04dc4c8d9a53dfe0a1215d4c0f980ec60a9f7ffb4ab61dba857ce6ae511a9a51c7a56edd20de6f9aea0e0d7987009da3e989374b203053d4b
6
+ metadata.gz: 5212f8bec31ad552b1b7d58d7891dd68058b0efaaa3464816208db9e15cfb1aba06b1d3f001eda389cddf8107c0773a45ebb6e3c2726904244cfe64041eb5d22
7
+ data.tar.gz: e379acf7cf9b7a5d1afe2aa57ca69ed14605e28a5e41365c938b3fe7f8013517032b5d89ca926f58400cfd99e595f35c9f47b85a42fc471e7a7983658e17add0
@@ -3,6 +3,26 @@ RELEASE NOTES for Ruby version of Sisimai
3
3
  - releases: "https://github.com/sisimai/rb-Sisimai/releases"
4
4
  - download: "https://rubygems.org/gems/sisimai"
5
5
 
6
+ v4.22.6
7
+ --------------------------------------------------------------------------------
8
+ - release: "Wed, 23 May 2018 20:00:00 +0900 (JST)"
9
+ - version: ""
10
+ - changes:
11
+ - #115 Fix bug in Sisimai::MIME.qprintd().
12
+ - Error message patterns in Sisimai::Reason::Filtered have been replaced with
13
+ fixed strings.
14
+ - #116 Remove sample email files listed in sisimai/set-of-emails#6 to clarify
15
+ copyrights.
16
+ - The value of "softbounce" in the parsed results is always "1" when a reason
17
+ is "undefined" or "onhold".
18
+ - #117 Less regular expression in each class of Sisimai::Bite::Email.
19
+ - #118 Cool logo for "set-of-emails". Thanks to @batarian71.
20
+ - #119 Implement Sisimai::Rhost::KDDI for detecting a bounce reason of au via
21
+ msmx.au.com or lsean.ezweb.ne.jp. Thanks to @kokubumotohiro.
22
+ - Update sample emails and codes for getting error messages in bounced emails
23
+ on Oath(Yahoo!).
24
+ - Add many sample emails for "notaccept" and "rejected".
25
+
6
26
  v4.22.5
7
27
  --------------------------------------------------------------------------------
8
28
  - release: "Fri, 30 Mar 2018 12:29:36 +0900 (JST)"
@@ -240,7 +240,7 @@ Differences between Ruby version and Perl version
240
240
  | インストール方法 | gem install | cpanm, cpm |
241
241
  | 依存モジュール数(コアモジュールを除く) | 1モジュール | 2モジュール |
242
242
  | LOC:ソースコードの行数 | 12000行 | 8600行 |
243
- | テスト件数(spec/,t/,xt/ディレクトリ) | 207000件 | 224000件 |
243
+ | テスト件数(spec/,t/,xt/ディレクトリ) | 212000件 | 229000件 |
244
244
  | ライセンス | 二条項BSD | 二条項BSD |
245
245
  | 開発会社によるサポート契約 | 準備中 | 提供中 |
246
246
 
@@ -294,7 +294,7 @@ Author
294
294
 
295
295
  Copyright
296
296
  ===============================================================================
297
- Copyright (C) 2015-2017 azumakuniyuki, All Rights Reserved.
297
+ Copyright (C) 2015-2018 azumakuniyuki, All Rights Reserved.
298
298
 
299
299
  License
300
300
  ===============================================================================
data/README.md CHANGED
@@ -244,7 +244,7 @@ and bounceHammer are available at
244
244
  | How to install | gem install | cpanm, cpm |
245
245
  | Dependencies (Except core modules) | 1 module | 2 modules |
246
246
  | LOC:Source lines of code | 12000 lines | 8600 lines |
247
- | The number of tests(spec/,t/,xt/) directory | 207000 tests | 224000 tests |
247
+ | The number of tests(spec/,t/,xt/) directory | 212000 tests | 229000 tests |
248
248
  | License | BSD 2-Clause | BSD 2-Clause |
249
249
  | Support Contract provided by Developer | Coming soon | Available |
250
250
 
@@ -300,7 +300,7 @@ Author
300
300
 
301
301
  Copyright
302
302
  ===============================================================================
303
- Copyright (C) 2015-2017 azumakuniyuki, All Rights Reserved.
303
+ Copyright (C) 2015-2018 azumakuniyuki, All Rights Reserved.
304
304
 
305
305
  License
306
306
  ===============================================================================
@@ -13,7 +13,7 @@ module Sisimai::Bite::Email
13
13
  message: ['The following message to <', 'An error occurred while trying to deliver the mail'],
14
14
  rfc822: ['content-type: message/rfc822'],
15
15
  }.freeze
16
- ReFailures = { expired: %r/Delivery expired/ }.freeze
16
+ MessagesOf = { expired: ['Delivery expired'] }.freeze
17
17
 
18
18
  def description; return 'Amazon SES(Sending): http://aws.amazon.com/ses/'; end
19
19
  def smtpagent; return Sisimai::Bite.smtpagent(self); end
@@ -209,9 +209,9 @@ module Sisimai::Bite::Email
209
209
  e['status'] = pseudostatus if pseudostatus.size > 0
210
210
  end
211
211
 
212
- ReFailures.each_key do |r|
212
+ MessagesOf.each_key do |r|
213
213
  # Verify each regular expression of session errors
214
- next unless e['diagnosis'] =~ ReFailures[r]
214
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
215
215
  e['reason'] = r.to_s
216
216
  break
217
217
  end
@@ -11,9 +11,9 @@ module Sisimai::Bite::Email
11
11
  message: ['Content-Type: message/delivery-status'],
12
12
  rfc822: ['Content-Type: message/rfc822'],
13
13
  }.freeze
14
- ReFailures = {
15
- hostunknown: %r/Host or domain name not found/,
16
- notaccept: %r/type=MX: Malformed or unexpected name server reply/,
14
+ MessagesOf = {
15
+ hostunknown: ['Host or domain name not found'],
16
+ notaccept: ['type=MX: Malformed or unexpected name server reply'],
17
17
  }.freeze
18
18
 
19
19
  def description; return 'Aol Mail: http://www.aol.com'; end
@@ -177,9 +177,9 @@ module Sisimai::Bite::Email
177
177
  e['diagnosis'] = e['diagnosis'].gsub(/\\n/, ' ')
178
178
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
179
179
 
180
- ReFailures.each_key do |r|
180
+ MessagesOf.each_key do |r|
181
181
  # Verify each regular expression of session errors
182
- next unless e['diagnosis'] =~ ReFailures[r]
182
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
183
183
  e['reason'] = r.to_s
184
184
  break
185
185
  end
@@ -12,9 +12,9 @@ module Sisimai::Bite::Email
12
12
  error: [' ----- Non-delivered information -----'],
13
13
  rfc822: ['Content-Type: message/rfc822'],
14
14
  }.freeze
15
- ReFailures = {
16
- filtered: %r/Mail Delivery Failed[.]+ User unknown/,
17
- mailboxfull: %r/The number of messages in recipient's mailbox exceeded the local limit[.]/,
15
+ MessagesOf = {
16
+ filtered: ['Mail Delivery Failed... User unknown'],
17
+ mailboxfull: ["The number of messages in recipient's mailbox exceeded the local limit."],
18
18
  }.freeze
19
19
 
20
20
  def description; return 'BIGLOBE: http://www.biglobe.ne.jp'; end
@@ -121,9 +121,9 @@ module Sisimai::Bite::Email
121
121
  e['agent'] = self.smtpagent
122
122
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
123
123
 
124
- ReFailures.each_key do |r|
124
+ MessagesOf.each_key do |r|
125
125
  # Verify each regular expression of session errors
126
- next unless e['diagnosis'] =~ ReFailures[r]
126
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
127
127
  e['reason'] = r.to_s
128
128
  break
129
129
  end
@@ -14,16 +14,14 @@ module Sisimai::Bite::Email
14
14
  rfc822: ['Content-Type: message/rfc822', 'Content-Type: text/rfc822-headers'],
15
15
  }.freeze
16
16
 
17
- ReFailures = {
17
+ MessagesOf = {
18
18
  # courier/module.esmtp/esmtpclient.c:526| hard_error(del, ctf, "No such domain.");
19
- hostunknown: %r/\ANo such domain[.]\z/,
19
+ hostunknown: ['No such domain.'],
20
20
  # courier/module.esmtp/esmtpclient.c:531| hard_error(del, ctf,
21
21
  # courier/module.esmtp/esmtpclient.c:532| "This domain's DNS violates RFC 1035.");
22
- systemerror: %r/\AThis domain's DNS violates RFC 1035[.]\z/,
23
- }.freeze
24
- ReDelaying = {
22
+ systemerror: ["This domain's DNS violates RFC 1035."],
25
23
  # courier/module.esmtp/esmtpclient.c:535| soft_error(del, ctf, "DNS lookup failed.");
26
- networkerror: %r/\ADNS lookup failed[.]\z/,
24
+ networkerror: ['DNS lookup failed.'],
27
25
  }.freeze
28
26
 
29
27
  def description; return 'Courier MTA'; end
@@ -210,22 +208,13 @@ module Sisimai::Bite::Email
210
208
  connheader.each_key { |a| e[a] ||= connheader[a] || '' }
211
209
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
212
210
 
213
- ReFailures.each_key do |r|
211
+ MessagesOf.each_key do |r|
214
212
  # Verify each regular expression of session errors
215
- next unless e['diagnosis'] =~ ReFailures[r]
213
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
216
214
  e['reason'] = r.to_s
217
215
  break
218
216
  end
219
217
 
220
- unless e['reason']
221
- ReDelaying.each_key do |r|
222
- # Verify each regular expression of session errors
223
- next unless e['diagnosis'] =~ ReDelaying[r]
224
- e['reason'] = r.to_s
225
- break
226
- end
227
- end
228
-
229
218
  e['agent'] = self.smtpagent
230
219
  e['command'] ||= commandtxt || ''
231
220
  e.each_key { |a| e[a] ||= '' }
@@ -11,17 +11,14 @@ module Sisimai::Bite::Email
11
11
  message: ['Your message'],
12
12
  rfc822: ['Content-Type: message/delivery-status'],
13
13
  }.freeze
14
- ReFailures = {
15
- userunknown: %r{(?>
16
- not[ ]listed[ ]in[ ](?:
17
- Domino[ ]Directory
18
- |public[ ]Name[ ][&][ ]Address[ ]Book
19
- )
20
- |Domino[ ]ディレクトリには見つかりません
21
- )
22
- }x,
23
- filtered: %r/Cannot route mail to user/,
24
- systemerror: %r/Several matches found in Domino Directory/,
14
+ MessagesOf = {
15
+ userunknown: [
16
+ 'not listed in Domino Directory',
17
+ 'not listed in public Name & Address Book',
18
+ 'Domino ディレクトリには見つかりません',
19
+ ],
20
+ filtered: ['Cannot route mail to user'],
21
+ systemerror: ['Several matches found in Domino Directory'],
25
22
  }.freeze
26
23
 
27
24
  def description; return 'IBM Domino Server'; end
@@ -138,9 +135,9 @@ module Sisimai::Bite::Email
138
135
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
139
136
  e['recipient'] = Sisimai::Address.s3s4(e['recipient'])
140
137
 
141
- ReFailures.each_key do |r|
138
+ MessagesOf.each_key do |r|
142
139
  # Check each regular expression of Domino error messages
143
- next unless e['diagnosis'] =~ ReFailures[r]
140
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
144
141
  e['reason'] = r.to_s
145
142
  pseudostatus = Sisimai::SMTP::Status.code(r.to_s, false)
146
143
  e['status'] = pseudostatus if pseudostatus.size > 0
@@ -12,7 +12,7 @@ module Sisimai::Bite::Email
12
12
  error: ['For the following reason:'],
13
13
  rfc822: ['--- The header of the original message is following'],
14
14
  }.freeze
15
- ReFailures = { mesgtoobig: %r/Mail size limit exceeded/ }.freeze
15
+ MessagesOf = { mesgtoobig: ['Mail size limit exceeded'] }.freeze
16
16
 
17
17
  def description; return '1&1: http://www.1and1.de'; end
18
18
  def smtpagent; return Sisimai::Bite.smtpagent(self); end
@@ -111,9 +111,9 @@ module Sisimai::Bite::Email
111
111
  e['diagnosis'] = e['diagnosis'].to_s.gsub(/\A#{StartingOf[:error][0]}/, '')
112
112
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
113
113
 
114
- ReFailures.each_key do |r|
114
+ MessagesOf.each_key do |r|
115
115
  # Verify each regular expression of session errors
116
- next unless e['diagnosis'] =~ ReFailures[r]
116
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
117
117
  e['reason'] = r.to_s
118
118
  break
119
119
  end
@@ -59,54 +59,49 @@ module Sisimai::Bite::Email
59
59
  %r/LMTP error after ([A-Za-z]{4})/,
60
60
  %r/LMTP error after end of ([A-Za-z]{4})/,
61
61
  ].freeze
62
- ReFailures = {
62
+ MessagesOf = {
63
63
  # find exim/ -type f -exec grep 'message = US' {} /dev/null \;
64
64
  # route.c:1158| DEBUG(D_uid) debug_printf("getpwnam() returned NULL (user not found)\n");
65
- userunknown: %r/user not found/,
65
+ userunknown: ['user not found'],
66
66
  # transports/smtp.c:3524| addr->message = US"all host address lookups failed permanently";
67
67
  # routers/dnslookup.c:331| addr->message = US"all relevant MX records point to non-existent hosts";
68
68
  # route.c:1826| uschar *message = US"Unrouteable address";
69
- hostunknown: %r{(?>
70
- all[ ](?:
71
- host[ ]address[ ]lookups[ ]failed[ ]permanently
72
- |relevant[ ]MX[ ]records[ ]point[ ]to[ ]non[-]existent[ ]hosts
73
- )
74
- |Unrouteable[ ]address
75
- )
76
- }x,
69
+ hostunknown: [
70
+ 'all host address lookups failed permanently',
71
+ 'all relevant MX records point to non-existent hosts',
72
+ 'Unrouteable address',
73
+ ],
77
74
  # transports/appendfile.c:2567| addr->user_message = US"mailbox is full";
78
75
  # transports/appendfile.c:3049| addr->message = string_sprintf("mailbox is full "
79
76
  # transports/appendfile.c:3050| "(quota exceeded while writing to file %s)", filename);
80
- mailboxfull: %r/(?:mailbox is full:?|error: quota exceed)/,
77
+ mailboxfull: ['mailbox is full', 'error: quota exceed'],
81
78
  # routers/dnslookup.c:328| addr->message = US"an MX or SRV record indicated no SMTP service";
82
79
  # transports/smtp.c:3502| addr->message = US"no host found for existing SMTP connection";
83
- notaccept: %r{(?:
84
- an[ ]MX[ ]or[ ]SRV[ ]record[ ]indicated[ ]no[ ]SMTP[ ]service
85
- |no[ ]host[ ]found[ ]for[ ]existing[ ]SMTP[ ]connection
86
- )
87
- }x,
80
+ notaccept: [
81
+ 'an MX or SRV record indicated no SMTP service',
82
+ 'no host found for existing SMTP connection',
83
+ ],
88
84
  # parser.c:666| *errorptr = string_sprintf("%s (expected word or \"<\")", *errorptr);
89
85
  # parser.c:701| if(bracket_count++ > 5) FAILED(US"angle-brackets nested too deep");
90
86
  # parser.c:738| FAILED(US"domain missing in source-routed address");
91
87
  # parser.c:747| : string_sprintf("malformed address: %.32s may not follow %.*s",
92
- syntaxerror: %r{(?:
93
- angle-brackets[ ]nested[ ]too[ ]deep
94
- |expected[ ]word[ ]or[ ]["]<["]
95
- |domain[ ]missing[ ]in[ ]source-routed[ ]address
96
- |malformed[ ]address:
97
- )
98
- }x,
88
+ syntaxerror: [
89
+ 'angle-brackets nested too deep',
90
+ 'expected word or "<"',
91
+ 'domain missing in source-routed address',
92
+ 'malformed address:',
93
+ ],
99
94
  # deliver.c:5614| addr->message = US"delivery to file forbidden";
100
95
  # deliver.c:5624| addr->message = US"delivery to pipe forbidden";
101
96
  # transports/pipe.c:1156| addr->user_message = US"local delivery failed";
102
- systemerror: %r{(?>
103
- delivery[ ]to[ ](?:file|pipe)[ ]forbidden
104
- |local[ ]delivery[ ]failed
105
- |LMTP[ ]error[ ]after[ ]
106
- )
107
- }x,
97
+ systemerror: [
98
+ 'delivery to file forbidden',
99
+ 'delivery to pipe forbidden',
100
+ 'local delivery failed',
101
+ 'LMTP error after ',
102
+ ],
108
103
  # deliver.c:5425| new->message = US"Too many \"Received\" headers - suspected mail loop";
109
- contenterror: %r/Too many ["]Received["] headers/,
104
+ contenterror: ['Too many "Received" headers'],
110
105
  }.freeze
111
106
 
112
107
  # retry.c:902| addr->message = (addr->message == NULL)? US"retry timeout exceeded" :
@@ -118,15 +113,15 @@ module Sisimai::Bite::Email
118
113
  # deliver.c:7586| "Message %s has been frozen%s.\nThe sender is <%s>.\n", message_id,
119
114
  # receive.c:4021| moan_tell_someone(freeze_tell, NULL, US"Message frozen on arrival",
120
115
  # receive.c:4022| "Message %s was frozen on arrival by %s.\nThe sender is <%s>.\n",
121
- ReDelaying = %r{(?:
122
- retry[ ]timeout[ ]exceeded
123
- |No[ ]action[ ]is[ ]required[ ]on[ ]your[ ]part
124
- |retry[ ]time[ ]not[ ]reached[ ]for[ ]any[ ]host[ ]after[ ]a[ ]long[ ]failure[ ]period
125
- |all[ ]hosts[ ]have[ ]been[ ]failing[ ]for[ ]a[ ]long[ ]time[ ]and[ ]were[ ]last[ ]tried
126
- |Delay[ ]reason:[ ]
127
- |Message[ ].+[ ](?:has[ ]been[ ]frozen|was[ ]frozen[ ]on[ ]arrival[ ]by[ ])
128
- )
129
- }x
116
+ DelayedFor = [
117
+ 'retry timeout exceeded',
118
+ 'No action is required on your part',
119
+ 'retry time not reached for any host after a long failure period',
120
+ 'all hosts have been failing for a long time and were last tried',
121
+ 'Delay reason: ',
122
+ 'has been frozen',
123
+ 'was frozen on arrival by ',
124
+ ].freeze
130
125
 
131
126
  def description; return 'Exim'; end
132
127
  def smtpagent; return Sisimai::Bite.smtpagent(self); end
@@ -461,16 +456,16 @@ module Sisimai::Bite::Email
461
456
  e['reason'] = 'onhold'
462
457
  else
463
458
  # Verify each regular expression of session errors
464
- ReFailures.each_key do |r|
459
+ MessagesOf.each_key do |r|
465
460
  # Check each regular expression
466
- next unless e['diagnosis'] =~ ReFailures[r]
461
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
467
462
  e['reason'] = r.to_s
468
463
  break
469
464
  end
470
465
 
471
466
  unless e['reason']
472
467
  # The reason "expired"
473
- e['reason'] = 'expired' if e['diagnosis'] =~ ReDelaying
468
+ e['reason'] = 'expired' if DelayedFor.find { |a| e['diagnosis'].include?(a) }
474
469
  end
475
470
  end
476
471
  end
@@ -11,7 +11,7 @@ module Sisimai::Bite::Email
11
11
  message: ['This message was created automatically by mail delivery software'],
12
12
  rfc822: ['--- The header of the original message is following'],
13
13
  }.freeze
14
- ReFailures = { expired: %r/delivery retry timeout exceeded/ }.freeze
14
+ MessagesOf = { expired: ['delivery retry timeout exceeded'] }.freeze
15
15
 
16
16
  def description; return 'GMX: http://www.gmx.net'; end
17
17
  def smtpagent; return Sisimai::Bite.smtpagent(self); end
@@ -139,9 +139,9 @@ module Sisimai::Bite::Email
139
139
  e['diagnosis'] = e['diagnosis'].gsub(/\\n/, ' ')
140
140
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
141
141
 
142
- ReFailures.each_key do |r|
142
+ MessagesOf.each_key do |r|
143
143
  # Verify each regular expression of session errors
144
- next unless e['diagnosis'] =~ ReFailures[r]
144
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
145
145
  e['reason'] = r.to_s
146
146
  break
147
147
  end
@@ -20,18 +20,16 @@ module Sisimai::Bite::Email
20
20
  }x,
21
21
  }.freeze
22
22
 
23
- ReFailures = {
24
- expired: %r{(?:
25
- DNS[ ]Error:[ ]Could[ ]not[ ]contact[ ]DNS[ ]servers
26
- |Delivery[ ]to[ ]the[ ]following[ ]recipient[ ]has[ ]been[ ]delayed
27
- |The[ ]recipient[ ]server[ ]did[ ]not[ ]accept[ ]our[ ]requests[ ]to[ ]connect
28
- )
29
- }x,
30
- hostunknown: %r{DNS[ ]Error:[ ](?:
31
- Domain[ ]name[ ]not[ ]found
32
- |DNS[ ]server[ ]returned[ ]answer[ ]with[ ]no[ ]data
33
- )
34
- }x,
23
+ MessagesOf = {
24
+ expired: [
25
+ 'DNS Error: Could not contact DNS servers',
26
+ 'Delivery to the following recipient has been delayed',
27
+ 'The recipient server did not accept our requests to connect',
28
+ ],
29
+ hostunknown: [
30
+ 'DNS Error: Domain name not found',
31
+ 'DNS Error: DNS server returned answer with no data',
32
+ ],
35
33
  }.freeze
36
34
  StateTable = {
37
35
  # Technical details of permanent failure:
@@ -283,9 +281,9 @@ module Sisimai::Bite::Email
283
281
  e['command'] = StateTable[statecode0]['command']
284
282
  else
285
283
  # No state code
286
- ReFailures.each_key do |r|
284
+ MessagesOf.each_key do |r|
287
285
  # Verify each regular expression of session errors
288
- next unless e['diagnosis'] =~ ReFailures[r]
286
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
289
287
  e['reason'] = r.to_s
290
288
  break
291
289
  end
@@ -13,10 +13,10 @@ module Sisimai::Bite::Email
13
13
  error: %r/\AThe[ ]response([ ]from[ ]the[ ]remote[ ]server)?[ ]was:\z/,
14
14
  html: %r{\AContent-Type:[ ]*text/html;[ ]*charset=['"]?(?:UTF|utf)[-]8['"]?\z},
15
15
  }.freeze
16
- ErrorMayBe = {
17
- userunknown: %r/because the address couldn't be found/,
18
- notaccept: %r/Null MX/,
19
- networkerror: %r/DNS type .+ lookup of .+ responded with code NXDOMAIN/,
16
+ MessagesOf = {
17
+ userunknown: ["because the address couldn't be found. Check for typos or unnecessary spaces and try again."],
18
+ notaccept: ['Null MX'],
19
+ networkerror: [' responded with code NXDOMAIN'],
20
20
  }.freeze
21
21
 
22
22
  def description; return 'G Suite: https://gsuite.google.com'; end
@@ -244,10 +244,10 @@ module Sisimai::Bite::Email
244
244
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
245
245
  e['agent'] = self.smtpagent
246
246
 
247
- ErrorMayBe.each_key do |q|
247
+ MessagesOf.each_key do |r|
248
248
  # Guess an reason of the bounce
249
- next unless e['diagnosis'] =~ ErrorMayBe[q]
250
- e['reason'] = q.to_s
249
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
250
+ e['reason'] = r.to_s
251
251
  break
252
252
  end
253
253
  end