Closed acharkizakaria closed 7 years ago
Just do this in your pluign by using
exports.hook_init_master = exports.hook_init_child = function (next) {
server.notes.interfaces = localAddresses();
return next();
}
That way it will only run once at start-up and available to all plugins via server.notes.interfaces
Thanks you @smfreegard for the quick answer, I will try it..
Works like a charm, thanks again @smfreegard.
Hi guys, I want to use the list of the local ips in some conditions inside a plugin that using the 'send_email' hook, is there any defined constant contain this info?
I could get the addresses using several ways, e.g :
But I think it will be better do define the list elsewhere so we don't have to retrieve the ips in every call of the plugin. (Define a global variable when the sever starting up for example).
If there's no variable contain this information, I'm not sure if the 'haraka-net-utils' is the right place to add this function.