Skip to content

Instantly share code, notes, and snippets.

@baudehlo
Last active February 4, 2016 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baudehlo/7e937f01c25004021a19 to your computer and use it in GitHub Desktop.
Save baudehlo/7e937f01c25004021a19 to your computer and use it in GitHub Desktop.
diff --git a/plugins/dkim_verify.js b/plugins/dkim_verify.js
index 9da9b9c..5769bed 100644
--- a/plugins/dkim_verify.js
+++ b/plugins/dkim_verify.js
@@ -19,7 +19,7 @@ exports.hook_data_post = function(next, connection) {
if (err) {
connection.logerror(self, 'error=' + err);
}
- if (!results) return next();
+ if (!results) return;
results.forEach(function (res) {
connection.auth_results(
'dkim=' + res.result +
@@ -49,7 +49,7 @@ exports.hook_data_post = function(next, connection) {
connection.logdebug(self, JSON.stringify(results));
// Store results for other plugins
txn.notes.dkim_results = results;
- return next();
}, ((plugin.timeout) ? plugin.timeout - 1 : 0));
+ txt.message_stream.once('end', next);
txn.message_stream.pipe(verifier, { line_endings: '\r\n' });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment