haraka-plugin-karma 2.1.0 → 2.1.1

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 (3) hide show
  1. package/Changes.md +6 -0
  2. package/index.js +5 -5
  3. package/package.json +2 -2
package/Changes.md CHANGED
@@ -2,6 +2,11 @@
2
2
  #### N.N.N - YYYY-MM-DD
3
3
 
4
4
 
5
+ ### [2.1.1] - 2023-08-22
6
+
7
+ - fix: check_result unexpected return #50
8
+
9
+
5
10
  ### [2.1.0] - 2022-11-29
6
11
 
7
12
  - fix: in disconnect, call redis_unsub after skip check
@@ -105,3 +110,4 @@
105
110
 
106
111
  - use redis.merge_redis_ini()
107
112
  [2.1.0]: https://github.com/haraka/haraka-plugin-karma/releases/tag/2.1.0
113
+ [2.1.1]: https://github.com/haraka/haraka-plugin-karma/releases/tag/2.1.1
package/index.js CHANGED
@@ -155,18 +155,18 @@ exports.check_result = function (connection, message) {
155
155
  if (!this.result_awards[m.plugin]) return // no awards for plugin
156
156
 
157
157
  for (const r of Object.keys(m.result)) { // each result in mess
158
- if (r === 'emit') return // r: pass, fail, skip, err, ...
158
+ if (r === 'emit') continue // r: pass, fail, skip, err, ...
159
159
 
160
160
  const pi_prop = this.result_awards[m.plugin][r]
161
- if (!pi_prop) return // no award for this plugin property
161
+ if (!pi_prop) continue // no award for this plugin property
162
162
 
163
163
  const thisResult = m.result[r]
164
164
  // ignore empty arrays, objects, and strings
165
- if (Array.isArray(thisResult) && thisResult.length === 0) return
165
+ if (Array.isArray(thisResult) && thisResult.length === 0) continue
166
166
  if (typeof thisResult === 'object' && !Object.keys(thisResult).length) {
167
- return
167
+ continue
168
168
  }
169
- if (typeof thisResult === 'string' && !thisResult) return // empty
169
+ if (typeof thisResult === 'string' && !thisResult) continue // empty
170
170
 
171
171
  // do any award conditions match this result?
172
172
  for (let i=0; i < pi_prop.length; i++) { // each award...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haraka-plugin-karma",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "A heuristics scoring and reputation engine for SMTP connections",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@
27
27
  "haraka-constants": ">=1.0.2",
28
28
  "haraka-utils": "*",
29
29
  "haraka-plugin-redis": "2.0.5",
30
- "redis": "4.1"
30
+ "redis": "4.6.7"
31
31
  },
32
32
  "devDependencies": {
33
33
  "eslint": "8",