How to use redis as authentication database on dovecot 2.4.1
Sir, dovecot is great, thanks. I want to use redis as authentication database on dovecot 2.4.1, but failed.
Dict key-value database (Redis, memcached, etc.) is listed on v2.3, but was removed on 2.4.1.
As https://doc.dovecot.org/2.4.1/core/config/auth/databases/lua.html , I was trying to auth via lua, like -- local redis = require('redis') -- on a lua file, but dovecot reported - module redis not found. I was trying to apt install dovecot-lua lua5.3 luarocks luaredis , but not work.
Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: passdb-lua: script_init() failed: lua_pcall(/etc/dovecot/conf.d/auth_redis.lua) failed: /etc/dovecot/conf.d/auth_redis.lua:1: module 'redis' not found: Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no field package.preload['redis'] Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file '/usr/local/share/lua/5.4/redis.lua' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file '/usr/local/share/lua/5.4/redis/init.lua' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file '/usr/local/lib/lua/5.4/redis.lua' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file '/usr/local/lib/lua/5.4/redis/init.lua' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file '/usr/share/lua/5.4/redis.lua' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file '/usr/share/lua/5.4/redis/init.lua' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file './redis.lua' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file './redis/init.lua' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file '/usr/local/lib/lua/5.4/redis.so' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file '/usr/lib/x86_64-linux-gnu/lua/5.4/redis.so' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file '/usr/lib/lua/5.4/redis.so' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file '/usr/local/lib/lua/5.4/loadall.so' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: no file './redis.so' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: stack traceback: Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: [C]: in function 'require' Oct 02 11:02:54 debian dovecot[43745]: auth: Fatal: /etc/dovecot/conf.d/auth_redis.lua:1: in main chunk Oct 02 11:02:54 debian dovecot[43743]: master: Error: service(auth): command startup failed, throttling for 2.000 secs
How to use redis as authentication database on dovecot 2.4.1? How to add redis.so to let dovecot's lua support redis connection?
Thanks.