mail_lua
| Value | Named Filter |
|---|---|
| See Also | |
| Changes |
|
Named filter for initializing mail_lua plugin settings.
Example:
mail_lua {
lua_file = /etc/dovecot/user.lua
lua_settings {
extra_param = %{userdb:extra_param}
}
}
Appearance
Note: This is pre-release documentation.
Please access https://doc.dovecotpro.com/latest/ for documentation on released versions.
mail-lua) mail-lua is a plugin that can be loaded to provide API for mail storage Lua plugins.
See Lua.
mail_lua| Value | Named Filter |
|---|---|
| See Also | |
| Changes |
|
Named filter for initializing mail_lua plugin settings.
Example:
mail_lua {
lua_file = /etc/dovecot/user.lua
lua_settings {
extra_param = %{userdb:extra_param}
}
}
This component registers two providers. Note that these providers have very limited functionality at this moment.
%{lua_file(<path>,<function>,...)} Executes the script at given path, and if it's successful, use the string result. If values are provided after function name, they are passed to the Lua function as parameters. Pipeline value is always added last, if present.
Example:
mail_plugins {
mail_lua = yes
}
mail_home = %{user|lua_file("/etc/dovecot/get_home.lua","get_home")}-- This is not a good way to do this, provided here for example
-- purposes only. Do not use this.
local function get_home(user)
return "/home/" .. user
end%{lua_call(<function>,...)} Executes Lua function in the lua_file, and if successful, use the string result. If values are provided after function name, they are passed to the Lua function as parameters. Pipeline value is always added last, if present.
Example:
mail_plugins {
mail_lua = yes
}
mail_lua {
lua_file = /etc/dovecot/mail.lua
}
mail_home = %{user|lua_call("get_home")}-- This is not a good way to do this, provided here for example
-- purposes only. Do not use this.
local function get_home(user)
return "/home/" .. user
end