sisimai 5.5.0-java → 5.6.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +21 -0
  3. data/LICENSE +1 -1
  4. data/README-JA.md +15 -12
  5. data/README.md +16 -13
  6. data/lib/sisimai/fact.rb +17 -2
  7. data/lib/sisimai/lhost/amazonses.rb +1 -1
  8. data/lib/sisimai/lhost/einsundeins.rb +1 -1
  9. data/lib/sisimai/lhost/exchange2007.rb +2 -2
  10. data/lib/sisimai/lhost/exim.rb +6 -8
  11. data/lib/sisimai/lhost/qmail.rb +5 -5
  12. data/lib/sisimai/message.rb +2 -0
  13. data/lib/sisimai/reason/authfailure.rb +9 -13
  14. data/lib/sisimai/reason/badreputation.rb +7 -7
  15. data/lib/sisimai/reason/blocked.rb +57 -83
  16. data/lib/sisimai/reason/contenterror.rb +14 -8
  17. data/lib/sisimai/reason/{mesgtoobig.rb → emailtoolarge.rb} +22 -25
  18. data/lib/sisimai/reason/expired.rb +16 -23
  19. data/lib/sisimai/reason/filtered.rb +13 -17
  20. data/lib/sisimai/reason/hasmoved.rb +2 -1
  21. data/lib/sisimai/reason/hostunknown.rb +16 -19
  22. data/lib/sisimai/reason/mailboxfull.rb +27 -49
  23. data/lib/sisimai/reason/networkerror.rb +16 -16
  24. data/lib/sisimai/reason/norelaying.rb +19 -19
  25. data/lib/sisimai/reason/notaccept.rb +6 -8
  26. data/lib/sisimai/reason/notcompliantrfc.rb +5 -9
  27. data/lib/sisimai/reason/policyviolation.rb +11 -25
  28. data/lib/sisimai/reason/ratelimited.rb +62 -0
  29. data/lib/sisimai/reason/rejected.rb +45 -59
  30. data/lib/sisimai/reason/requireptr.rb +13 -25
  31. data/lib/sisimai/reason/securityerror.rb +13 -19
  32. data/lib/sisimai/reason/spamdetected.rb +51 -101
  33. data/lib/sisimai/reason/suspend.rb +26 -24
  34. data/lib/sisimai/reason/systemerror.rb +19 -23
  35. data/lib/sisimai/reason/systemfull.rb +1 -1
  36. data/lib/sisimai/reason/userunknown.rb +79 -112
  37. data/lib/sisimai/reason/virusdetected.rb +6 -8
  38. data/lib/sisimai/reason.rb +14 -14
  39. data/lib/sisimai/rhost/apple.rb +5 -5
  40. data/lib/sisimai/rhost/cloudflare.rb +2 -0
  41. data/lib/sisimai/rhost/cox.rb +22 -20
  42. data/lib/sisimai/rhost/facebook.rb +16 -16
  43. data/lib/sisimai/rhost/franceptt.rb +8 -3
  44. data/lib/sisimai/rhost/godaddy.rb +33 -15
  45. data/lib/sisimai/rhost/google.rb +63 -64
  46. data/lib/sisimai/rhost/iua.rb +1 -1
  47. data/lib/sisimai/rhost/messagelabs.rb +12 -12
  48. data/lib/sisimai/rhost/microsoft.rb +82 -86
  49. data/lib/sisimai/rhost/mimecast.rb +34 -34
  50. data/lib/sisimai/rhost/nttdocomo.rb +2 -2
  51. data/lib/sisimai/rhost/spectrum.rb +7 -7
  52. data/lib/sisimai/rhost/tencent.rb +9 -11
  53. data/lib/sisimai/rhost/yahooinc.rb +7 -8
  54. data/lib/sisimai/smtp/command.rb +2 -0
  55. data/lib/sisimai/smtp/status.rb +50 -90
  56. data/lib/sisimai/string.rb +0 -15
  57. data/lib/sisimai/version.rb +1 -1
  58. metadata +4 -6
  59. data/lib/sisimai/reason/exceedlimit.rb +0 -47
  60. data/lib/sisimai/reason/speeding.rb +0 -47
  61. data/lib/sisimai/reason/toomanyconn.rb +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cce493bf6db19759e2159c36d40d5278493243187083b92f35c47aea14d52ca7
4
- data.tar.gz: 75080d90011ad6813fa681dbc1f9ff02c604cc0653f03bb7b37791f7b21187fe
3
+ metadata.gz: 1f44c6b808f8cc77c1b201c98e3c62326c8d5bbd32010ed17a1665abefc02413
4
+ data.tar.gz: d3071f7eb259a1fe59a4d1b4a0cead24888ef3d5a3fe130e469dbc48e82d2117
5
5
  SHA512:
6
- metadata.gz: 0d974c494297ca7f3200b30ca630cbd9d99f3536222fbe84a86746669da335295869c0811d017d61ad813e2be154ab5562b861bc3bdbbbe798309256ded62006
7
- data.tar.gz: 85a40b4f2f0dda6e9bbdecee8027dcf71d81428b041d59a7522b5cf0defe701c4af1a343494b321d5fcf0399e155b4aa2116a50591d09b64851490a1d944fdaa
6
+ metadata.gz: 5f71bc52c7f17d6a2a506e97e52fbf30bf42b95bd85deb4349e5ffe6eec16b1336e0b14a31afa7cab2714f2842bcda1656be1589f7eab7b5dc7d430314b75f1a
7
+ data.tar.gz: 1fead139305581fcee22a5ea4bb906612fb5fcd5c214d07df34772d88f425b9dca474f48c5fb45c410110967b08249a506c615c711cf7b115b0c16a9d1e33488
data/ChangeLog.md CHANGED
@@ -2,6 +2,27 @@ RELEASE NOTES for Ruby version of Sisimai
2
2
  ===================================================================================================
3
3
  - releases: "https://github.com/sisimai/rb-sisimai/releases"
4
4
  - download: "https://rubygems.org/gems/sisimai"
5
+ - document: "https://libsisimai.org/"
6
+
7
+ v5.6.0
8
+ ---------------------------------------------------------------------------------------------------
9
+ - release: "Mon, 2 Feb 2026 18:30:22 +0900 (JST)"
10
+ - version: "5.6.0"
11
+ - changes:
12
+ - **Changes in Bounce Reason Categorization**
13
+ - Update bounce status mappings in `Sisimai::SMTP::Status`.
14
+ - #399 Consolidate four bounce reasons into two:
15
+ - Merge `TooManyConn` and `Speeding` into `RateLimited`.
16
+ - Merge `ExceedLimit` and `MesgTooBig` into `EmailTooLarge`.
17
+ - #406 Update assigned reasons in `rhost/for-*.go`.
18
+ - #408 Error message patterns improvement.
19
+ - Merge similar error message patterns and remove ambiguous ones.
20
+ - Attachment-related errors have been moved from `PolicyViolation` to `ContentError`.
21
+ - **Reorganize the internal status code** #403
22
+ - Temporary error `4.0.9**` has been changed to `4.9.***`.
23
+ - Permanent error `5.0.9**` has been changed to `5.9.***`.
24
+ - #401 `Sisimai::String.token` has been moved to `Sisimai::Fact.token()`.
25
+ - Happy Birthday to Suzu (formerly known as "Neko-dono" Michitsuna).
5
26
 
6
27
  v5.5.0
7
28
  ---------------------------------------------------------------------------------------------------
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  THIS SOFTWARE IS DISTRIBUTED UNDER THE FOLLOWING BSD 2-CLAUSE LICENSE:
2
2
 
3
- Copyright (C) 2015-2017 azumakuniyuki, All rights reserved.
3
+ Copyright (C) 2015-2026 azumakuniyuki, All rights reserved.
4
4
 
5
5
  Redistribution and use in source and binary forms, with or without modification,
6
6
  are permitted provided that the following conditions are met:
data/README-JA.md CHANGED
@@ -115,10 +115,10 @@ Install
115
115
  ### From RubyGems.org
116
116
  ```shell
117
117
  $ sudo gem install sisimai
118
- Fetching: sisimai-5.5.0.gem (100%)
119
- Successfully installed sisimai-5.5.0
120
- Parsing documentation for sisimai-5.5.0
121
- Installing ri documentation for sisimai-5.5.0
118
+ Fetching: sisimai-5.6.0.gem (100%)
119
+ Successfully installed sisimai-5.6.0
120
+ Parsing documentation for sisimai-5.6.0
121
+ Installing ri documentation for sisimai-5.6.0
122
122
  Done installing documentation for sisimai after 6 seconds
123
123
  1 gem installed
124
124
  ```
@@ -146,13 +146,13 @@ if [ -d "/usr/local/jr" ]; then \
146
146
  ...
147
147
  3 gems installed
148
148
  /opt/local/bin/rake install
149
- sisimai 5.5.0 built to pkg/sisimai-5.5.0.gem.
150
- sisimai (5.5.0) installed.
149
+ sisimai 5.6.0 built to pkg/sisimai-5.6.0.gem.
150
+ sisimai (5.6.0) installed.
151
151
  if [ -d "/usr/local/jr" ]; then \
152
152
  PATH="/usr/local/jr/bin:$PATH" /usr/local/jr/bin/rake install; \
153
153
  fi
154
- sisimai 5.5.0 built to pkg/sisimai-5.5.0-java.gem.
155
- sisimai (5.5.0) installed.
154
+ sisimai 5.6.0 built to pkg/sisimai-5.6.0-java.gem.
155
+ sisimai (5.6.0) installed.
156
156
  ```
157
157
 
158
158
  Usage
@@ -358,9 +358,9 @@ Sisimai 5.5.0から**Ruby 2.5以上**が必要になります。
358
358
  | 動作環境(JRuby) | 9.0.4.0 - 9.1.17.0 | **9.2** or later |
359
359
  | 元メールファイルを操作可能なコールバック機能 | なし | あり[^3] |
360
360
  | 解析エンジン(MTA/ESPモジュール)の数 | 68 | 60 |
361
- | 検出可能なバウンス理由の数 | 29 | 36 |
361
+ | 検出可能なバウンス理由の数 | 29 | 34 |
362
362
  | 依存Gem数(Ruby Standard Gemsを除く) | 1 Gem | 1 Gem |
363
- | ソースコードの行数 | 10,800 行 | 9,970 行 |
363
+ | ソースコードの行数 | 10,800 行 | 9,700 行 |
364
364
  | テストフレームワーク | rspec | minitest |
365
365
  | テスト件数(spec/またはtest/ディレクトリ) | 311,000 件 | 240,000 件 |
366
366
  | 1秒間に解析できるバウンスメール数[^4] | 620 通 | 620 通 |
@@ -417,8 +417,11 @@ Sisimai 5では新たに5個のバウンス理由が増えました。検出可
417
417
  | 送信者のドメイン・IPアドレスの低いレピュテーション | `Blocked` | `BadReputation` |
418
418
  | PTRレコードが未設定または無効なPTRレコード | `Blocked` | `RequirePTR` |
419
419
  | RFCに準拠していないメール[^7] | `SecurityError` | `NotCompliantRFC` |
420
- | 単位時間の流量制限・送信速度が速すぎる | `SecurityError` | `Speeding` |
421
420
  | STARTTLS関連のエラー (added at v5.2.0) | `SecurityError` | `FailedSTARTTLS` |
421
+ | 単位時間の流量制限・送信速度が速すぎる | `SecurityError` | `RateLimited` |
422
+ | セッションあたりの受信者数制限や接続数を超過 | `TooManyConn` | `RateLimited` |
423
+ | メールが大きすぎる(ExceedLimit) | `ExceedLimit` | `EmailTooLarge` |
424
+ | メールが大きすぎる(MesgTooBig) | `MesgTooBig` | `EmailTooLarge` |
422
425
  | 宛先がサプレッションリストに一致 (added at v5.2.0) | `OnHold` | `Suppressed` |
423
426
 
424
427
  [^7]: RFC5322など
@@ -463,7 +466,7 @@ Author
463
466
 
464
467
  Copyright
465
468
  ===================================================================================================
466
- Copyright (C) 2015-2025 azumakuniyuki, All Rights Reserved.
469
+ Copyright (C) 2015-2026 azumakuniyuki, All Rights Reserved.
467
470
 
468
471
  License
469
472
  ===================================================================================================
data/README.md CHANGED
@@ -87,7 +87,7 @@ The key features of Sisimai
87
87
  * __High Precision of Analysis__
88
88
  * Support [60 MTAs/MDAs/ESPs](https://libsisimai.org/en/engine/)
89
89
  * Support Feedback Loop Message(ARF)
90
- * Can detect [36 bounce reasons](https://libsisimai.org/en/reason/)
90
+ * Can detect [34 bounce reasons](https://libsisimai.org/en/reason/)
91
91
 
92
92
  [^2]: The callback function allows you to add your own data under the `catch` accessor.
93
93
 
@@ -114,10 +114,10 @@ Install
114
114
  ### From RubyGems
115
115
  ```shell
116
116
  $ sudo gem install sisimai
117
- Fetching: sisimai-5.5.0.gem (100%)
118
- Successfully installed sisimai-5.5.0
119
- Parsing documentation for sisimai-5.5.0
120
- Installing ri documentation for sisimai-5.5.0
117
+ Fetching: sisimai-5.6.0.gem (100%)
118
+ Successfully installed sisimai-5.6.0
119
+ Parsing documentation for sisimai-5.6.0
120
+ Installing ri documentation for sisimai-5.6.0
121
121
  Done installing documentation for sisimai after 6 seconds
122
122
  1 gem installed
123
123
  ```
@@ -145,13 +145,13 @@ if [ -d "/usr/local/jr" ]; then \
145
145
  ...
146
146
  3 gems installed
147
147
  /opt/local/bin/rake install
148
- sisimai 5.5.0 built to pkg/sisimai-5.5.0.gem.
149
- sisimai (5.5.0) installed.
148
+ sisimai 5.6.0 built to pkg/sisimai-5.6.0.gem.
149
+ sisimai (5.6.0) installed.
150
150
  if [ -d "/usr/local/jr" ]; then \
151
151
  PATH="/usr/local/jr/bin:$PATH" /usr/local/jr/bin/rake install; \
152
152
  fi
153
- sisimai 5.5.0 built to pkg/sisimai-5.5.0-java.gem.
154
- sisimai (5.5.0) installed.
153
+ sisimai 5.6.0 built to pkg/sisimai-5.6.0-java.gem.
154
+ sisimai (5.6.0) installed.
155
155
  ```
156
156
 
157
157
  Usage
@@ -357,9 +357,9 @@ Beginning with v5.5.0, Sisimai requires **Ruby 2.5.0 or later.**
357
357
  | System requirements (JRuby) | 9.0.4.0 - 9.1.17.0 | **9.2** or later |
358
358
  | Callback feature for the original email file | N/A | Available[^3] |
359
359
  | The number of MTA/ESP modules | 68 | 60 |
360
- | The number of detectable bounce reasons | 29 | 36 |
360
+ | The number of detectable bounce reasons | 29 | 34 |
361
361
  | Dependencies (Except Ruby Standard Gems) | 1 gem | 1 gem |
362
- | Source lines of code | 10,300 lines | 9,970 lines |
362
+ | Source lines of code | 10,300 lines | 9,700 lines |
363
363
  | Test frameworks | rspec | minitest |
364
364
  | The number of tests in spec/ or test/ directory | 311,000 tests | 240,000 tests |
365
365
  | The number of bounce emails decoded/sec (CRuby)[^4] | 620 emails | 620 emails |
@@ -418,8 +418,11 @@ detect is available at [LIBSISIMAI.ORG/EN/REASON](https://libsisimai.org/en/reas
418
418
  | low/bad reputation of the sender hostname/IP addr. | `Blocked` | `BadReputation` |
419
419
  | missing PTR/having invalid PTR | `Blocked` | `RequirePTR` |
420
420
  | non-compliance with RFC[^7] | `SecurityError` | `NotCompliantRFC` |
421
- | exceeding a rate limit or sending too fast | `SecurityError` | `Speeding` |
422
421
  | STARTTLS-related errors (added at v5.2.0) | `SecurityError` | `FailedSTARTTLS` |
422
+ | exceeding a rate limit or sending too fast | `SecurityError` | `RateLimited` |
423
+ | too many concurrency connections or recipients | `TooManyConn` | `RateLimited` |
424
+ | Email size is too large for the remote host | `ExceedLimit` | `EmailTooLarge` |
425
+ | Email size is too large for the remote host | `MesgTooBig` | `EmailTooLarge` |
423
426
  | Recipient in the suppression list (added at v5.2.0) | `OnHold` | `Suppressed` |
424
427
 
425
428
  [^7]: RFC5322 and related RFCs
@@ -466,7 +469,7 @@ Author
466
469
 
467
470
  Copyright
468
471
  ===================================================================================================
469
- Copyright (C) 2015-2025 azumakuniyuki, All Rights Reserved.
472
+ Copyright (C) 2015-2026 azumakuniyuki, All Rights Reserved.
470
473
 
471
474
  License
472
475
  ===================================================================================================
data/lib/sisimai/fact.rb CHANGED
@@ -374,7 +374,7 @@ module Sisimai
374
374
  'senderdomain' => as.host,
375
375
  'destination' => ar.host,
376
376
  'alias' => piece['alias'] || ar.alias,
377
- 'token' => Sisimai::String.token(as.address, ar.address, piece['timestamp']),
377
+ 'token' => Sisimai::Fact.token(as.address, ar.address, piece['timestamp']),
378
378
  }
379
379
  ea.each { |q| thing[q] = piece[q] if thing[q].nil? || thing[q].empty? }
380
380
 
@@ -506,7 +506,7 @@ module Sisimai
506
506
  # 2. Several softbounces: MailboxFull, Filtered, NoRelaying
507
507
  # 2-1. The SMTP command is "RCPT" except "MailboxFull".
508
508
  # 2-2. The SMTP reply code begins with "5" such as "550".
509
- # 2-3. The SMTP status code is explicit code (not empty, not 5.0.9XX).
509
+ # 2-3. The SMTP status code is explicit code (not empty, not 5.9.***).
510
510
  # 2-4. The SMTP status code begins with "5." such as "5.1.1".
511
511
  return true if cr != 'mailboxfull' && thing['command'] == "RCPT"
512
512
  return true if cv.start_with?('5')
@@ -521,6 +521,21 @@ module Sisimai
521
521
  return false
522
522
  end
523
523
 
524
+ # Create message token from addresser and recipient
525
+ # @param [String] addr1 Sender address
526
+ # @param [String] addr2 Recipient address
527
+ # @param [Integer] epoch Machine time of the email bounce
528
+ # @return [String] Message token(MD5 hex digest) or blank(failed to create token)
529
+ # @see http://en.wikipedia.org/wiki/ASCII
530
+ def self.token(addr1, addr2, epoch)
531
+ return "" if addr1.is_a?(::String) == false || addr2.is_a?(::String) == false
532
+ return "" if addr1.empty? || addr2.empty? || epoch.is_a?(Integer) == false
533
+
534
+ # Format: STX(0x02) Sender-Address RS(0x1e) Recipient-Address ETX(0x03)
535
+ require 'digest/sha1'
536
+ return Digest::SHA1.hexdigest(sprintf("\x02%s\x1e%s\x1e%d\x03", addr1.downcase, addr2.downcase, epoch))
537
+ end
538
+
524
539
  # Convert from Sisimai::Fact object to a Hash
525
540
  # @return [Hash] Hashed data
526
541
  def damn
@@ -49,7 +49,7 @@ module Sisimai::Lhost
49
49
  "OnAccountSuppressionList" => "suppressed",
50
50
  "General" => "onhold",
51
51
  "MailboxFull" => "mailboxfull",
52
- "MessageTooLarge" => "mesgtoobig",
52
+ "MessageTooLarge" => "emailtoolarge",
53
53
  "ContentRejected" => "contenterror",
54
54
  "AttachmentRejected" => "securityerror",
55
55
  }.freeze
@@ -11,7 +11,7 @@ module Sisimai::Lhost
11
11
  message: ['This message was created automatically by mail delivery software'],
12
12
  error: ['For the following reason:'],
13
13
  }.freeze
14
- MessagesOf = {'mesgtoobig' => ['Mail size limit exceeded']}.freeze
14
+ MessagesOf = {'emailtoolarge' => ['Mail size limit exceeded']}.freeze
15
15
 
16
16
  # @abstract Decode the bounce message from 1&1
17
17
  # @param [Hash] mhead Message headers of a bounce email
@@ -38,12 +38,12 @@ module Sisimai::Lhost
38
38
  "RESOLVER.ADR.RecipNotFound" => "userunknown", # 550 5.1.1 RESOLVER.ADR.RecipNotFound
39
39
  "RESOLVER.ADR.RecipientNotFound" => "userunknown", # 550 5.1.1 RESOLVER.ADR.RecipientNotFound
40
40
  "RESOLVER.ADR.ExRecipNotFound" => "userunknown", # 550 5.1.1 RESOLVER.ADR.ExRecipNotFound
41
- "RESOLVER.ADR.RecipLimit" => "toomanyconn", # 550 5.5.3 RESOLVER.ADR.RecipLimit
41
+ "RESOLVER.ADR.RecipLimit" => "ratelimited", # 550 5.5.3 RESOLVER.ADR.RecipLimit
42
42
  "RESOLVER.ADR.InvalidInSmtp" => "systemerror", # 550 5.1.0 RESOLVER.ADR.InvalidInSmtp
43
43
  "RESOLVER.ADR.Ambiguous" => "systemerror", # 550 5.1.4 RESOLVER.ADR.Ambiguous, 420 4.2.0 RESOLVER.ADR.Ambiguous
44
44
  "RESOLVER.RST.AuthRequired" => "securityerror", # 550 5.7.1 RESOLVER.RST.AuthRequired
45
45
  "RESOLVER.RST.NotAuthorized" => "rejected", # 550 5.7.1 RESOLVER.RST.NotAuthorized
46
- "RESOLVER.RST.RecipSizeLimit" => "exceedlimit", # 550 5.2.3 RESOLVER.RST.RecipSizeLimit
46
+ "RESOLVER.RST.RecipSizeLimit" => "emailtoolarge", # 550 5.2.3 RESOLVER.RST.RecipSizeLimit
47
47
  "QUEUE.Expired" => "expired", # 550 4.4.7 QUEUE.Expired
48
48
  }.freeze
49
49
  MailSender = ["postmaster@outlook.com", ".onmicrosoft.com"].freeze
@@ -164,9 +164,11 @@ module Sisimai::Lhost
164
164
  end
165
165
  return nil if proceedsto < 2 && thirdparty == false
166
166
 
167
+ require "sisimai/reason"
167
168
  require "sisimai/address"
168
169
  require "sisimai/rfc2045"
169
170
  require "sisimai/smtp/command"
171
+ require "sisimai/smtp/failure"
170
172
 
171
173
  dscontents = [Sisimai::Lhost.DELIVERYSTATUS]; v = nil
172
174
  emailparts = Sisimai::RFC5322.part(mbody, Boundaries)
@@ -461,21 +463,17 @@ module Sisimai::Lhost
461
463
  #
462
464
  # The value of "Status:" indicates permanent error but the value of SMTP reply code in
463
465
  # Diagnostic-Code: field is "TEMPERROR"!!!!
464
- re = e["reason"]
465
466
  cr = Sisimai::SMTP::Reply.find(e["diagnosis"], e["status"])
466
467
  cs = Sisimai::SMTP::Status.find(e["diagnosis"], cr)
468
+ re = e["reason"]
467
469
  cv = ""
468
470
 
469
- if cr[0,1] == "4" || re == "expired" || re == "mailboxfull"
471
+ if Sisimai::SMTP::Failure.is_temporary(cr) || re == "expired" || re == "mailboxfull"
470
472
  # Set the pseudo status code as a temporary error
471
- cv = Sisimai::SMTP::Status.code(re, true)
472
-
473
- else
474
- # Set the pseudo status code as a permanent error
475
- cv = Sisimai::SMTP::Status.code(re, false)
473
+ cv = Sisimai::SMTP::Status.code(re, true) if Sisimai::Reason.is_explicit(re)
476
474
  end
477
475
  e["replycode"] = cr if e["replycode"].empty?
478
- e["status"] = Sisimai::SMTP::Status.prefer(cs, cv, cr) if e["status"].empty?
476
+ e["status"] = Sisimai::SMTP::Status.prefer(cv, cs, cr) if e["status"].empty?
479
477
  end
480
478
 
481
479
  return { "ds" => dscontents, "rfc822" => emailparts[1] }
@@ -72,9 +72,9 @@ module Sisimai::Lhost
72
72
  OnHoldPair = [" does not like recipient.", "this message has been in the queue too long."].freeze
73
73
  FailOnLDAP = {
74
74
  # qmail-ldap-1.03-20040101.patch:19817 - 19866
75
- "exceedlimit" => ["The message exeeded the maximum size the user accepts"], # 5.2.3
76
- "userunknown" => ["Sorry, no mailbox here by that name"], # 5.1.1
77
- "suspend" => [ # 5.2.1
75
+ "emailtoolarge" => ["The message exeeded the maximum size the user accepts"], # 5.2.3
76
+ "userunknown" => ["Sorry, no mailbox here by that name"], # 5.1.1
77
+ "suspend" => [ # 5.2.1
78
78
  "Mailaddress is administrativly disabled",
79
79
  "Mailaddress is administrativley disabled",
80
80
  "Mailaddress is administratively disabled",
@@ -102,8 +102,8 @@ module Sisimai::Lhost
102
102
  "mailboxfull" => ["disk quota exceeded"],
103
103
  # qmail-qmtpd.c:233| ... result = "Dsorry, that message size exceeds my databytes limit (#5.3.4)";
104
104
  # qmail-smtpd.c:391| ... out("552 sorry, that message size exceeds my databytes limit (#5.3.4)\r\n"); return;
105
- "mesgtoobig" => ["Message size exceeds fixed maximum message size:"],
106
- "networkerror"=> [
105
+ "emailtoolarge" => ["Message size exceeds fixed maximum message size:"],
106
+ "networkerror" => [
107
107
  "Sorry, I wasn't able to establish an SMTP connection",
108
108
  "Sorry. Although I'm listed as a best-preference MX or A for that host",
109
109
  ],
@@ -297,6 +297,8 @@ module Sisimai
297
297
  email += sprintf("%s: %s\n", fn, bf)
298
298
  end
299
299
 
300
+ # 5. Convert the lower-cased SMTP command to the upper-cased.
301
+ email = email.gsub("after end of data:", "after end of DATA:")
300
302
  email += "\n" if email.end_with?("\n\n") == false
301
303
  return email
302
304
  end
@@ -12,23 +12,19 @@ module Sisimai
12
12
  # Diagnostic-Code: smtp; 550 5.7.1 Email rejected per DMARC policy for example.org
13
13
  module AuthFailure
14
14
  class << self
15
- require 'sisimai/string'
16
-
17
15
  Index = [
18
- '//spf.pobox.com',
19
- 'bad spf records for',
20
- 'dmarc policy',
16
+ "//spf.pobox.com",
17
+ "5322.From address doesn't meet the authentication requirements",
18
+ "bad spf records for",
19
+ "dmarc policy",
21
20
  "doesn't meet the required authentication level",
22
- 'please inspect your spf settings',
23
- 'sender policy framework (spf) fail',
24
- 'sender policy framework violation',
25
- 'spf (sender policy framework) domain authentication fail',
26
- 'spf check: fail',
27
- "the 5322.From address doesn't meet the authentication requirements defined for the sender",
21
+ "please inspect your spf settings",
22
+ "sender policy framework",
23
+ "spf check: fail",
28
24
  ].freeze
29
25
  Pairs = [
30
- [' is not allowed to send mail.', '_401'],
31
- ['is not allowed to send from <', " per it's spf record"],
26
+ [" is not allowed to send mail.", "_401"],
27
+ ["is not allowed to send from <", " per it's spf record"],
32
28
  ].freeze
33
29
 
34
30
  def text; return 'authfailure'; end
@@ -15,13 +15,13 @@ module Sisimai
15
15
  module BadReputation
16
16
  class << self
17
17
  Index = [
18
- 'a poor email reputation score',
19
- 'has been temporarily rate limited due to ip reputation',
20
- 'ip/domain reputation problems',
21
- 'likely suspicious due to the very low reputation',
22
- 'none/bad reputation', # t-online.de
23
- 'temporarily deferred due to unexpected volume or user complaints', # Yahoo Inc.
24
- "the sending mta's poor reputation",
18
+ "has been temporarily rate limited due to ip reputation",
19
+ "ip/domain reputation problems",
20
+ "likely suspicious due to the very low reputation",
21
+ "none/bad reputation", # t-online.de
22
+ "poor email reputation score",
23
+ "sending mta's poor reputation",
24
+ "temporarily deferred due to unexpected volume or user complaints", # Yahoo Inc.
25
25
  ].freeze
26
26
  def text; return 'badreputation'; end
27
27
  def description; return 'Email rejected due to an IP address reputation'; end
@@ -7,93 +7,67 @@ module Sisimai
7
7
  # or the parameter of "HELO/EHLO" command. This reason has added in Sisimai 4.0.0.
8
8
  module Blocked
9
9
  class << self
10
- require 'sisimai/string'
11
-
12
10
  Index = [
13
- ' said: 550 blocked',
14
- '//www.spamcop.net/bl.',
15
- 'bad sender ip address',
16
- 'banned sending ip', # Office365
17
- 'blacklisted by',
18
- 'blocked using ',
19
- 'blocked - see http',
20
- 'dnsbl:attrbl',
21
- 'client host rejected: abus detecte gu_eib_02', # SFR
22
- 'client host rejected: abus detecte gu_eib_04', # SFR
23
- 'client host rejected: may not be mail exchanger',
24
- 'client host rejected: was not authenticated', # Microsoft
25
- 'confirm this mail server',
26
- 'connection dropped',
27
- 'connection refused by',
28
- 'connection reset by peer',
29
- 'connection was dropped by remote host',
30
- 'connections not accepted from ip addresses on spamhaus xbl',
31
- 'currently sending spam see: ',
32
- 'domain does not exist:',
33
- 'dynamic/zombied/spam ips blocked',
34
- 'error: no valid recipients from ',
35
- 'esmtp not accepting connections', # icloud.com
36
- 'extreme bad ip profile',
37
- 'go away',
38
- 'helo command rejected:',
39
- 'host network not allowed',
40
- 'hosts with dynamic ip',
41
- 'invalid ip for sending mail of domain',
42
- 'is in a black list',
43
- 'is not allowed to send mail from',
44
- 'mailfrom domain is listed in spamhaus',
45
- 'no access from mail server',
46
- 'no matches to nameserver query',
47
- 'not currently accepting mail from your ip', # Microsoft
48
- 'part of their network is on our block list',
49
- 'please use the smtp server of your isp',
50
- 'refused - see http',
51
- 'rejected - multi-blacklist', # junkemailfilter.com
52
- 'rejected because the sending mta or the sender has not passed validation',
53
- 'rejecting open proxy', # Sendmail(srvrsmtp.c)
54
- 'sender ip address rejected',
55
- 'server access forbidden by your ip ',
56
- 'service not available, closing transmission channel',
57
- 'smtp error from remote mail server after initial connection:', # Exim
58
- "sorry, that domain isn't in my list of allowed rcpthosts",
59
- 'sorry, your remotehost looks suspiciously like spammer',
60
- 'temporarily deferred due to unexpected volume or user complaints',
61
- 'to submit messages to this e-mail system has been rejected',
62
- 'too many spams from your ip', # free.fr
63
- 'too many unwanted messages have been sent from the following ip address above',
64
- 'was blocked by ',
65
- 'we do not accept mail from dynamic ips', # @mail.ru
66
- 'you are not allowed to connect',
67
- 'you are sending spam',
68
- 'your ip address is listed in the rbl',
69
- 'your network is temporary blacklisted',
70
- 'your server requires confirmation',
11
+ "bad sender ip address",
12
+ "banned sending ip", # Office365
13
+ "blacklisted by",
14
+ "dnsbl:attrbl",
15
+ "client host rejected: abus detecte gu_eib_02", # SFR
16
+ "client host rejected: abus detecte gu_eib_04", # SFR
17
+ "client host rejected: may not be mail exchanger",
18
+ "connection refused by",
19
+ "currently sending spam see: ",
20
+ "domain does not exist:",
21
+ "domain isn't in my list of allowed rcpthosts",
22
+ "error: no valid recipients from ",
23
+ "esmtp not accepting connections", # icloud.com
24
+ "extreme bad ip profile",
25
+ "helo command rejected:",
26
+ "host network not allowed",
27
+ "invalid ip for sending mail of domain",
28
+ "is in a black list",
29
+ "is not allowed to send mail from",
30
+ "no access from mail server",
31
+ "part of their network is on our block list",
32
+ "please use the smtp server of your isp",
33
+ "rejected because the sending mta or the sender has not passed validation",
34
+ "rejecting open proxy", # Sendmail(srvrsmtp.c)
35
+ "sender ip address rejected",
36
+ "server access forbidden by your ip ",
37
+ "smtp error from remote mail server after initial connection:", # Exim
38
+ "you are not allowed to connect",
39
+ "your ip address is listed in the rbl",
40
+ "your network is temporary blacklisted",
41
+ "your remotehost looks suspiciously like spammer",
42
+ "your server requires confirmation",
71
43
  ].freeze
72
44
  Pairs = [
73
- ['(', '@', ':blocked)'],
74
- ['access from ip address ', ' blocked'],
75
- ['client host ', ' blocked using'],
76
- ['connections will not be accepted from ', " because the ip is in spamhaus's list"],
77
- ['dnsbl:rbl ', '>_is_blocked'],
78
- ['email blocked by ', '.barracudacentral.org'],
79
- ['email blocked by ', 'spamhaus'],
80
- ['host ', ' refused to talk to me: ', ' blocked'],
81
- ['ip ', ' is blocked by earthlink'], # Earthlink
82
- ['is in an ', 'rbl on '],
83
- ['mail server at ', ' is blocked'],
84
- ['mail from ',' refused:'],
85
- ["mail from "," refused, see ", "orbs"],
86
- ['message from ', ' rejected based on blacklist'],
87
- ['messages from ', ' temporarily deferred due to user complaints'], # Yahoo!
88
- ['server ip ', ' listed as abusive'],
89
- ['sorry! your ip address', ' is blocked by rbl'], # junkemailfilter.com
90
- ['the domain ', ' is blacklisted'],
91
- ['the email ', ' is blacklisted'],
92
- ['the ip', ' is blacklisted'],
93
- ['veuillez essayer plus tard. service refused, please try later. ', '103'],
94
- ['veuillez essayer plus tard. service refused, please try later. ', '510'],
45
+ ["(", "@", ":blocked)"],
46
+ ["access from ip address ", " blocked"],
47
+ ["blocked by ", " dnsbl"],
48
+ ["client ", " blocked using"],
49
+ ["connection ", "dropped"],
50
+ ["client host ", " blocked using"],
51
+ ["connections will not be accepted from ", " because the ip is in spamhaus's list"],
52
+ ["dynamic", " ip"],
53
+ ["email blocked by ", ".barracudacentral.org"],
54
+ ["email blocked by ", "spamhaus"],
55
+ ["from ", " ip address"],
56
+ ["host ", " said: ", "550 blocked"],
57
+ ["host ", " refused to talk to me: ", " blocked"],
58
+ ["ip ", " is blocked by earthlink"], # Earthlink
59
+ ["is in an ", "rbl on "],
60
+ ["mail server at ", " is blocked"],
61
+ ["mail from "," refused"],
62
+ ["message from ", " rejected based on blacklist"],
63
+ ["messages from ", " temporarily deferred due to user complaints"], # Yahoo!
64
+ ["server ip ", " listed as abusive"],
65
+ ["sorry! your ip address", " is blocked by rbl"], # junkemailfilter.com
66
+ ["the ", " is blacklisted"], # the email, the domain, the ip
67
+ ["veuillez essayer plus tard. service refused, please try later. ", "103"],
68
+ ["veuillez essayer plus tard. service refused, please try later. ", "510"],
95
69
  ["your access ip", " has been rejected"],
96
- ["your sender's ip address is listed at ", '.abuseat.org'],
70
+ ["your sender's ip address is listed at ", ".abuseat.org"],
97
71
  ].freeze
98
72
 
99
73
  def text; return 'blocked'; end
@@ -9,14 +9,20 @@ module Sisimai
9
9
  module ContentError
10
10
  class << self
11
11
  Index = [
12
- 'header size exceeds maximum permitted',
13
- 'improper use of 8-bit data in message header',
14
- 'message header size, or recipient list, exceeds policy limit',
15
- 'message mime complexity exceeds the policy maximum',
16
- 'routing loop detected -- too many received: headers',
17
- 'this message contain invalid mime headers',
18
- 'this message contain improperly-formatted binary content',
19
- 'this message contain text that uses unnecessary base64 encoding',
12
+ "executable files are not allowed in compressed files",
13
+ "header error",
14
+ "header size exceeds maximum permitted",
15
+ "illegal attachment on your message",
16
+ "improper use of 8-bit data in message header",
17
+ "it has a potentially executable attachment",
18
+ "message contain invalid mime headers",
19
+ "message contain improperly-formatted binary content",
20
+ "message contain text that uses unnecessary base64 encoding",
21
+ "message header size, or recipient list, exceeds policy limit",
22
+ "message mime complexity exceeds the policy maximum",
23
+ "message was blocked because its content presents a potential", # https://support.google.com/mail/answer/6590
24
+ "routing loop detected -- too many received: headers",
25
+ "we do not accept messages containing images or other attachments",
20
26
  ].freeze
21
27
 
22
28
  def text; return 'contenterror'; end