{"action":"created","issue":{"url":"https://api.github.com/repos/baudehlo/Haraka/issues/896","labels_url":"https://api.github.com/repos/baudehlo/Haraka/issues/896/labels{/name}","comments_url":"https://api.github.com/repos/baudehlo/Haraka/issues/896/comments","events_url":"https://api.github.com/repos/baudehlo/Haraka/issues/896/events","html_url":"https://github.com/baudehlo/Haraka/pull/896","id":65388242,"number":896,"title":"new plugin: limit","user":{"login":"msimerson","id":261635,"avatar_url":"https://avatars.githubusercontent.com/u/261635?v=3","gravatar_id":"","url":"https://api.github.com/users/msimerson","html_url":"https://github.com/msimerson","followers_url":"https://api.github.com/users/msimerson/followers","following_url":"https://api.github.com/users/msimerson/following{/other_user}","gists_url":"https://api.github.com/users/msimerson/gists{/gist_id}","starred_url":"https://api.github.com/users/msimerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msimerson/subscriptions","organizations_url":"https://api.github.com/users/msimerson/orgs","repos_url":"https://api.github.com/users/msimerson/repos","events_url":"https://api.github.com/users/msimerson/events{/privacy}","received_events_url":"https://api.github.com/users/msimerson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-31T07:37:15Z","updated_at":"2015-03-31T12:57:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/baudehlo/Haraka/pulls/896","html_url":"https://github.com/baudehlo/Haraka/pull/896","diff_url":"https://github.com/baudehlo/Haraka/pull/896.diff","patch_url":"https://github.com/baudehlo/Haraka/pull/896.patch"},"body":"### limits for\r\n* connection concurrency\r\n* recipients\r\n* unrecognized commands\r\n* errors\r\n\r\n### test failures\r\nthis requires the nosql module in a separate \r\n\r\n### future plans:\r\n* remove recipient limits from karma\r\n* add auth attempt limits to rate_limit #754\r\n* remove connection concurrency from karma and rate_limit\r\n* deprecate max_unrecognized_commands plugin\r\n* deprecate rcpt_to.max_count"},"comment":{"url":"https://api.github.com/repos/baudehlo/Haraka/issues/comments/88073695","html_url":"https://github.com/baudehlo/Haraka/pull/896#issuecomment-88073695","issue_url":"https://api.github.com/repos/baudehlo/Haraka/issues/896","id":88073695,"user":{"login":"smfreegard","id":550490,"avatar_url":"https://avatars.githubusercontent.com/u/550490?v=3","gravatar_id":"","url":"https://api.github.com/users/smfreegard","html_url":"https://github.com/smfreegard","followers_url":"https://api.github.com/users/smfreegard/followers","following_url":"https://api.github.com/users/smfreegard/following{/other_user}","gists_url":"https://api.github.com/users/smfreegard/gists{/gist_id}","starred_url":"https://api.github.com/users/smfreegard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smfreegard/subscriptions","organizations_url":"https://api.github.com/users/smfreegard/orgs","repos_url":"https://api.github.com/users/smfreegard/repos","events_url":"https://api.github.com/users/smfreegard/events{/privacy}","received_events_url":"https://api.github.com/users/smfreegard/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T12:57:07Z","updated_at":"2015-03-31T12:57:07Z","body":"Ok - there's a few issues with this:\r\n\r\n- The lookup_rdns, and disconnect hooks need to run before any other plugins (as other plugins might return OK and prevent this from running), so this will been to be listed at the very top of the `config/plugins` file *BUT* you want the unrecognized_command hook to run *last* (e.g. at the bottom of `config/plugins`) as you want other plugins that implement commands via the hook to avoid this by returning OK otherwise you'll end up always counting valid STARTTLS or AUTH commands as unrecognized incorrectly.   Basically you're going to have to split this into two plugins and document it as such for this to work correctly.\r\n\r\n- The concurrency code has numerous issues if you were to run it under Redis and even more if you had multiple Haraka instances sharing a Redis instance.   If you stop Haraka, then any concurrent connections that were running at the time will not be decremented and you'll quickly end up blocking valid hosts indefinitely.   Additionally when running in-memory, you'll want to make sure that the counter can't go negative (I've seen this happen in my own code, haven't been able to trace it as yet)."}}