GitHub PullRequestReviewCommentEvent at 2014-02-05 18:33:28
Repository: Haraka
Actor: msimerson
Payload: {"comment":{"url":"https://api.github.com/repos/baudehlo/Haraka/pulls/comments/9471944","id":9471944,"diff_hunk":"@@ -0,0 +1,173 @@\n+/*\n+** delay_deny\n+**\n+** This plugin delays all pre-DATA 'deny' results until the recipients are sent\n+** and all post-DATA commands until all hook_data_post plugins have run.\n+** This allows relays and authenticated users to bypass pre-DATA rejections.\n+*/\n+\n+var constants = require('./constants');\n+\n+exports.hook_deny = function (next, connection, params) {\n+    /* params\n+    ** [0] = plugin return value (constants.deny or constants.denysoft)\n+    ** [1] = plugin return message\n+    */\n+\n+    var pi_name     = params[2];\n+    var pi_function = params[3];\n+    var pi_params   = params[4];\n+    var pi_hook     = params[5];\n+\n+    var plugin = this;\n+    var transaction = connection.transaction;\n+\n+    // Don't delay ourselves...\n+    if (pi_name == 'delay_deny') return next();\n+\n+    // Load config\n+    var cfg = this.config.get('delay_deny.ini');\n+    var skip;\n+    if (cfg.main.excluded_plugins) {\n+        skip = cfg.main.excluded_plugins.split(/[;, ]+/);\n+    };\n+\n+    // See if we should skip this delay\n+    if (skip && skip.length) {\n+        // Skip by <plugin name>\n+        if (skip.indexOf(pi_name) !== -1) {\n+            connection.logdebug(plugin, 'not delaying excluded plugin: ' + pi_name);\n+            return next();\n+        }\n+        // Skip by <plugin name>:<hook>\n+        if (skip.indexOf(pi_name + ':' + pi_hook) !== -1) {\n+            connection.logdebug(plugin, 'not delaying excluded hook: ' + pi_hook +\n+                                      ' in plugin: ' + pi_name);\n+            return next();\n+        }\n+        // Skip by <plugin name>:<hook>:<function name>\n+        if (skip.indexOf(pi_name + ':' + pi_hook + ':' + pi_function) !== -1) {\n+            connection.logdebug(plugin, 'not delaying excluded function: ' + pi_function +\n+                                      ' on hook: ' + pi_hook + ' in plugin: ' + pi_name);\n+            return next();\n+        }\n+    }\n+\n+    switch(pi_hook) {\n+        // Pre-DATA connection delays\n+        case 'lookup_rdns':\n+        case 'connect':\n+        case 'ehlo':\n+        case 'helo':\n+            if (!connection.notes.delay_deny) {","path":"plugins/delay_deny.js","position":null,"original_position":62,"commit_id":"67833e04df04badcf6f13a5ade6ae20fb65e7635","original_commit_id":"eb34f103f294bd8a7d27c5415531ee62838c8e82","user":{"login":"msimerson","id":261635,"avatar_url":"https://gravatar.com/avatar/f65de8c89a9acee50957c9cd09811eb8?d=https%3A%2F%2Fidenticons.github.com%2Ff8385ee05b21b6374382d329241586e4.png&r=x","gravatar_id":"f65de8c89a9acee50957c9cd09811eb8","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},"body":"Fixed.","created_at":"2014-02-05T18:33:28Z","updated_at":"2014-02-05T18:33:28Z","html_url":"https://github.com/baudehlo/Haraka/pull/416#discussion_r9471944","pull_request_url":"https://api.github.com/repos/baudehlo/Haraka/pulls/416","_links":{"self":{"href":"https://api.github.com/repos/baudehlo/Haraka/pulls/comments/9471944"},"html":{"href":"https://github.com/baudehlo/Haraka/pull/416#discussion_r9471944"},"pull_request":{"href":"https://api.github.com/repos/baudehlo/Haraka/pulls/416"}}}}