haraka-plugin-karma
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -0,4 +1,8 @@ | ||
## 1.0.12 - 2019-03-08 | ||
- don't interfere with STARTLS and AUTH when karmi is listed above those plugins in config/plugins | ||
## 1.0.11 - 2017-10-25 | ||
- private addresses and flagged connections exemption | ||
- private addresses and flagged connections exemption | ||
@@ -30,3 +34,3 @@ ## 1.0.10 - 2017-08-30 | ||
- move merge_redis_ini into load_karma_ini, so it also gets applied | ||
after a karma.ini change | ||
after a karma.ini change | ||
- skip redis operations when no connection exists | ||
@@ -33,0 +37,0 @@ |
98
index.js
@@ -144,3 +144,3 @@ 'use strict'; | ||
}); | ||
}; | ||
} | ||
@@ -199,3 +199,3 @@ exports.check_result = function (connection, message) { | ||
}); | ||
}; | ||
} | ||
@@ -217,3 +217,3 @@ exports.result_as_array = function (result) { | ||
return result; | ||
}; | ||
} | ||
@@ -227,3 +227,3 @@ exports.check_result_asn = function (asn, conn) { | ||
conn.results.push(plugin, {fail: 'asn_awards'}); | ||
}; | ||
} | ||
@@ -241,3 +241,3 @@ exports.check_result_lt = function (thisResult, thisAward, conn) { | ||
} | ||
}; | ||
} | ||
@@ -255,3 +255,3 @@ exports.check_result_gt = function (thisResult, thisAward, conn) { | ||
} | ||
}; | ||
} | ||
@@ -276,3 +276,3 @@ exports.check_result_equal = function (thisResult, thisAward, conn) { | ||
} | ||
}; | ||
} | ||
@@ -290,3 +290,3 @@ exports.check_result_match = function (thisResult, thisAward, conn) { | ||
} | ||
}; | ||
} | ||
@@ -322,3 +322,3 @@ exports.check_result_length = function (thisResult, thisAward, conn) { | ||
} | ||
}; | ||
} | ||
@@ -347,3 +347,3 @@ exports.apply_tarpit = function (connection, hook, score, next) { | ||
}, delay * 1000); | ||
}; | ||
} | ||
@@ -373,3 +373,3 @@ exports.tarpit_delay = function (score, connection, hook, k) { | ||
return delay; | ||
}; | ||
} | ||
@@ -404,3 +404,3 @@ exports.tarpit_delay_msa = function (connection, delay, k) { | ||
return delay; | ||
}; | ||
} | ||
@@ -411,3 +411,3 @@ exports.should_we_skip = function (connection) { | ||
return false; | ||
}; | ||
} | ||
@@ -454,3 +454,3 @@ exports.should_we_deny = function (next, connection, hook) { | ||
}); | ||
}; | ||
} | ||
@@ -487,3 +487,3 @@ exports.hook_deny = function (next, connection, params) { | ||
next(constants.OK); // resume the connection | ||
}; | ||
} | ||
@@ -500,3 +500,3 @@ exports.hook_connect = function (next, connection) { | ||
plugin.should_we_deny(next, connection, 'connect'); | ||
}; | ||
} | ||
@@ -509,3 +509,3 @@ exports.hook_helo = function (next, connection) { | ||
plugin.should_we_deny(next, connection, 'helo'); | ||
}; | ||
} | ||
@@ -518,3 +518,3 @@ exports.hook_ehlo = function (next, connection) { | ||
plugin.should_we_deny(next, connection, 'ehlo'); | ||
}; | ||
} | ||
@@ -527,3 +527,3 @@ exports.hook_vrfy = function (next, connection) { | ||
plugin.should_we_deny(next, connection, 'vrfy'); | ||
}; | ||
} | ||
@@ -536,3 +536,3 @@ exports.hook_noop = function (next, connection) { | ||
plugin.should_we_deny(next, connection, 'noop'); | ||
}; | ||
} | ||
@@ -545,3 +545,3 @@ exports.hook_data = function (next, connection) { | ||
plugin.should_we_deny(next, connection, 'data'); | ||
}; | ||
} | ||
@@ -554,3 +554,3 @@ exports.hook_queue = function (next, connection) { | ||
plugin.should_we_deny(next, connection, 'queue'); | ||
}; | ||
} | ||
@@ -564,5 +564,5 @@ exports.hook_reset_transaction = function (next, connection) { | ||
plugin.should_we_deny(next, connection, 'reset_transaction'); | ||
}; | ||
} | ||
exports.hook_unrecognized_command = function (next, connection, cmd) { | ||
exports.hook_unrecognized_command = function (next, connection, params) { | ||
const plugin = this; | ||
@@ -572,7 +572,13 @@ | ||
// in case karma is in config/plugins before tls | ||
if (params[0].toUpperCase() === 'STARTTLS') return next(); | ||
// in case karma is in config/plugins before AUTH plugin(s) | ||
if (connection.notes.authenticating) return next(); | ||
connection.results.incr(plugin, {score: -1}); | ||
connection.results.add(plugin, {fail: 'cmd:('+cmd+')'}); | ||
connection.results.add(plugin, {fail: `cmd:(${params})`}); | ||
return plugin.should_we_deny(next, connection, 'unrecognized_command'); | ||
}; | ||
} | ||
@@ -629,3 +635,3 @@ exports.ip_history_from_redis = function (next, connection) { | ||
}); | ||
}; | ||
} | ||
@@ -657,3 +663,3 @@ exports.hook_mail = function (next, connection, params) { | ||
return plugin.should_we_deny(next, connection, 'mail'); | ||
}; | ||
} | ||
@@ -682,3 +688,3 @@ exports.hook_rcpt = function (next, connection, params) { | ||
return plugin.should_we_deny(next, connection, 'rcpt'); | ||
}; | ||
} | ||
@@ -698,3 +704,3 @@ exports.hook_rcpt_ok = function (next, connection, rcpt) { | ||
return plugin.should_we_deny(next, connection, 'rcpt'); | ||
}; | ||
} | ||
@@ -715,3 +721,3 @@ exports.hook_data_post = function (next, connection) { | ||
return plugin.should_we_deny(next, connection, 'data_post'); | ||
}; | ||
} | ||
@@ -726,3 +732,3 @@ exports.increment = function (connection, key, val) { | ||
if (asnkey) plugin.db.hincrby(asnkey, key, 1); | ||
}; | ||
} | ||
@@ -757,3 +763,3 @@ exports.hook_disconnect = function (next, connection) { | ||
return next(); | ||
}; | ||
} | ||
@@ -774,3 +780,3 @@ exports.get_award_loc_from_note = function (connection, award) { | ||
return; | ||
}; | ||
} | ||
@@ -804,3 +810,3 @@ exports.get_award_loc_from_results = function (connection, loc_bits) { | ||
return obj; | ||
}; | ||
} | ||
@@ -833,3 +839,3 @@ exports.get_award_location = function (connection, award_key) { | ||
connection.logdebug(plugin, 'unknown location for ' + award_key); | ||
}; | ||
} | ||
@@ -849,3 +855,3 @@ exports.get_award_condition = function (note_key, note_val) { | ||
return wants; | ||
}; | ||
} | ||
@@ -938,3 +944,3 @@ exports.check_awards = function (connection) { | ||
} | ||
}; | ||
} | ||
@@ -967,3 +973,3 @@ exports.apply_award = function (connection, nl, award) { | ||
if (award < 0) { connection.results.add(plugin, {fail: trimmed}); } | ||
}; | ||
} | ||
@@ -983,3 +989,3 @@ exports.check_spammy_tld = function (mail_from, connection) { | ||
connection.results.add(plugin, {fail: 'spammy.TLD'}); | ||
}; | ||
} | ||
@@ -996,3 +1002,3 @@ exports.check_syntax_RcptTo = function (connection) { | ||
connection.results.add(plugin, {fail: 'rfc5321.RcptTo'}); | ||
}; | ||
} | ||
@@ -1011,3 +1017,3 @@ exports.assemble_note_obj = function (prefix, key) { | ||
return note; | ||
}; | ||
} | ||
@@ -1064,3 +1070,3 @@ exports.check_asn = function (connection, asnkey) { | ||
}); | ||
}; | ||
} | ||
@@ -1074,3 +1080,3 @@ exports.init_ip = function (dbkey, rip, expire) { | ||
.exec(); | ||
}; | ||
} | ||
@@ -1086,3 +1092,3 @@ exports.get_asn_key = function (connection) { | ||
return 'as' + asn.asn; | ||
}; | ||
} | ||
@@ -1096,2 +1102,2 @@ exports.init_asn = function (asnkey, expire) { | ||
.exec(); | ||
}; | ||
} |
{ | ||
"name": "haraka-plugin-karma", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "A heuristics scoring and reputation engine for SMTP connections", | ||
@@ -32,3 +32,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"eslint": ">=3", | ||
"eslint": ">=4", | ||
"eslint-plugin-haraka": "*", | ||
@@ -35,0 +35,0 @@ "haraka-test-fixtures": "*", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1596
88396
12