Skip to content

Instantly share code, notes, and snippets.

View smfreegard's full-sized avatar

Steve Freegard smfreegard

  • Fort Systems Ltd.
  • Chichester, UK
View GitHub Profile
var lynx = require('lynx');
var metrics = new lynx('localhost', 8125);
var hostname = require('os').hostname();
// Connections per second
// Connections by source port (25, 80, ...)
exports.hook_lookup_rdns = function (next, conn) {
// Ignore connections from localhost
if (conn.remote_ip === '127.0.0.1' ||
conn.remote_ip === '::1')
@smfreegard
smfreegard / auth_mysql.js
Last active October 1, 2015 12:03 — forked from Dexus/auth_mysql.js
auth_mysql - not tested
// Authentication against a MySQL server
var net_utils = require('./net_utils');
var mysql = require('mysql');
var crypto = require('crypto');
exports.register = function() {
this.inherits('auth/auth_base');
}
exports.hook_capabilities = function(next, connection) {
[root@mail1-ec2 Haraka]# diff -uNr plugins.js.orig plugins.js
--- plugins.js.orig 2012-04-14 15:22:47.575558052 +0000
+++ plugins.js 2012-04-16 17:56:01.915136250 +0000
@@ -30,6 +30,7 @@
this.full_paths = full_paths;
this.config = config;
this.hooks = {};
+ this.server = {}; // set by server.js
};