haraka / haraka-plugin-redis

redis support for Haraka plugins
https://www.npmjs.com/package/haraka-plugin-redis
MIT License
3 stars 12 forks source link

I am not able to connect to redis with custom plugin #42

Closed ravivgolov closed 6 months ago

ravivgolov commented 6 months ago

Hello

I have followed the guide, this is my plugin:

const outbound = require('/usr/lib/node_modules/Haraka/outbound');

exports.register = function () {
    this.inherits('redis');
    this.cfg = this.config.get('my-plugin.ini');
    // populate plugin.cfg.redis with defaults from redis.ini
    this.merge_redis_ini();

    // cluster aware redis connection(s)
    this.register_hook('init_master', 'init_redis_plugin');
    this.register_hook('init_child',  'init_redis_plugin');
}

Console:

[INFO] [-] [greylist] connected to redis://127.0.0.1:6379/11
[INFO] [-] [redis] connected to redis://127.0.0.1:6379
[INFO] [-] [custom] using server.notes.redis
[INFO] [-] [redis] connected to redis://127.0.0.1:6379

I have installed the haraka-plugin-redis via npm, and configured the redis.ini to the default: [server] host=127.0.0.1 port=6379

msimerson commented 6 months ago

You have the connection:

[INFO] [-] [custom] using server.notes.redis

It worked.

ravivgolov commented 6 months ago

I made more changes, now i can see [INFO] [-] [custom] connected to redis://127.0.0.1:6379