haraka / haraka-plugin-karma

Karma plugin - A heuristics based reputation engine for Haraka
https://www.npmjs.com/package/haraka-plugin-karma
MIT License
8 stars 7 forks source link

Karma prevents max_unrecognized_commands from dropping connection #20

Closed smfreegard closed 7 years ago

smfreegard commented 7 years ago

To reproduce, have the max_unrecognized_commands plugin installed then intentionally send 10 unrecognized commands:

[INFO] [12006FF9-D9E7-453D-85D3-110E4E673FB4] [max_unrecognized_commands] max: 10, count: 10, fail:Unrecognized command: asd,, Unrecognized command: asd,, Unrecognized command: asd,, Unrecognized command: asd,, Unrecognized command: asd,, Unrecognized command: asd,, Unrecognized command: asd,, Unrecognized command: asd,, Unrecognized command: asd,, Unrecognized command: asd,, Unrecognized command: ,
[INFO] [12006FF9-D9E7-453D-85D3-110E4E673FB4] [max_unrecognized_commands] Closing connection. Too many bad commands.
[INFO] [12006FF9-D9E7-453D-85D3-110E4E673FB4] [core]  hook=unrecognized_command plugin=max_unrecognized_commands function=hook_unrecognized_command params="" retval=DENYDISCONNECT msg="Too many bad commands"
[INFO] [12006FF9-D9E7-453D-85D3-110E4E673FB4] [core]  hook=deny plugin=karma function=hook_deny params=904 retval=OK msg=""
[INFO] [12006FF9-D9E7-453D-85D3-110E4E673FB4] [core] deny(soft?) overriden by deny hook
[INFO] [12006FF9-D9E7-453D-85D3-110E4E673FB4] [core]  hook=unrecognized_command plugin=karma function=hook_unrecognized_command params="" retval=DENY msg="very bad karma score: -18"
500 very bad karma score: -18
msimerson commented 7 years ago

That's a feature. If you don't prefer that behavior, add max_unrecognized_commands to karma.ini[deny_excludes].plugins.