This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.

Dovecot Lua support

Since v2.3.0 dovecot supports Lua scripting. Dovecot supports lua 5.0 or newer. See also:

lib-lua

Dovecot provides a lib-lua internal helper as part of libdovecot.so. It has facilities for loading scripts from various sources, and also helps with reusing scripts by keeping track of which scripts are loaded. Each script has it's own memory pool, which is guaranteed to be released when script is unloaded.

When script is loaded, script_load function is called if found. This can return non-zero to indicate that the script has a problem.

C API

Register dovecot variable. This item can also be extended by context specific tables, like authentication database adds dovecot.auth.

Pushes an Dovecot Event to stack.

Lua API

Functions within dovecot variable that do generic logging

Event functions are available from v2.3.4 on

Creates a new event for dovecot

object event

Note:

Functions:

mail-lua

Available from v2.3.4 on

mail-lua is a plugin that can be loaded to provide API for mail storage Lua plugins. Mail-lua provides a common script to be used in mail storage instead of per-plugin scripts.

C API

Register storage Lua interface to script context

Returns script context if available. If FALSE is returned, no Lua script has been loaded, and you should optionally deal this yourself.

Pushes a mail user on top of stack.

Pushes a mailbox on top of stack.

Pushes a mail on top of stack.

Lua API

When mail user is created, a script is loaded if present as mail_lua_script and mail_user_created is called if present in script.

On deinitialization, mail_user_deinit_pre is called first, if present, followed by mail_user_deinit.

dovecot.storage

Following constants are specified

object mail_user

Meta:

Functions:

Variables:

object mailbox

Meta:

Functions:

Variables:

table mailbox status

Variables:

object mail

Meta:

Functions:

Variables:

Design/Lua (last edited 2018-11-27 06:54:06 by MarttiRannanjarvi)