Hi, I’m currently trying to implement this. However, I don’t manage to obtain the client_id
in my lua-script.
Here is the content of “/opt/mailcow-dockerized/data/conf/dovecot/extra.conf”:
imap_id_retain = yes
imap_id_log = *
passdb {
driver = lua
args = file=/etc/dovecot/lua/badimapid.lua blocking=yes
}
Logging (imap_id_log = *) works, the dovecot log has entries like:
imap(thorsten@iap.physik.tu-darmstadt.de)<226><pWFZx9siRt+CUwMp>: ID sent: name=Thunderbird, version=115.15.0
Here is the content of the lua-script file:
function auth_passdb_lookup(req)
req.log_info('badimapid info: user="'..req.user..'", client_id="'..req.client_id..'"')
return dovecot.auth.PASSDB_RESULT_NEXT, ""
end
function script_init()
return 0
end
function script_deinit()
end
In principle, req.client_id should contain the client id string according to https://doc.dovecot.org/2.3/configuration_manual/authentication/lua_based_authentication/
However, dovecot log reads:
auth-worker(163): Error: conn unix:auth-worker (pid=162,uid=401): auth-worker<27>: lua(thorsten@iap.physik.tu-darmstadt.de): db-lua: lua_pcall(auth_passdb_lookup, 1, 2) failed: /etc/dovecot/lua/badimapid.lua:2: attempt to concatenate a nil value (field 'client_id')
Why is client_id
nil?
Thanks, Thorsten