Vault is not Working in smtp_server_auth_plain

i was struggling all day to fix this, and i wasn’t able to do it for some reason :

kumo.on(‘smtp_server_auth_plain’, function(authz, authc, password, conn_meta)
– Reject empty passwords
if password == ‘’ then
return false
end

– Authenticate against Vault
local success, result = pcall(function()
– Load secret from Vault
local secret = kumo.secrets.load({
vault_mount = ‘kv’,
vault_path = ‘smtp-auth/’ .. authc
})

-- Return the password field if it's a table
if type(secret) == 'table' and secret.password then
  return secret.password
else
  return secret
end

end)

– If successful and password matches
if success and result and result == password then
return true
end
return false
end)

Are you able to connect and retrieve the data from vault manually? What error message are you seeing?