Search K
Appearance
Appearance
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.
See mail-lua plugin.
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()
.
void dlua_register_mail_storage(struct dlua_script *script)
script
: dlua_script
to add mail storage.Register storage Lua interface to script context.
bool mail_lua_plugin_get_script(struct mail_user *user, struct dlua_script **script_r)
user
: mail_user
script
: dlua_script
Returns script context if available. If FALSE is returned, no Lua script has been loaded, and you should optionally deal this yourself.
void dlua_push_mail_user(struct dlua_script *script, struct mail_user *user)
script
: dlua_script
user
: mail_user
Pushes a mail user on top of stack.
void dlua_push_mailbox(struct dlua_script *script, struct mailbox *box)
script
: dlua_script
mailbox
: mailbox
Pushes a mailbox on top of stack.
void dlua_push_mail(struct dlua_script *script, struct mail* mail)
script
: dlua_script
mail
: mail
Pushes a mail on top of stack.
dovecot.storage
dovecot.storage.STATUS_MESSAGES
dovecot.storage.STATUS_RECENT
dovecot.storage.STATUS_UIDNEXT
dovecot.storage.STATUS_UIDVALIDITY
dovecot.storage.STATUS_UNSEEN
dovecot.storage.STATUS_FIRST_UNSEEN_SEQ
dovecot.storage.STATUS_KEYWORDS
dovecot.storage.STATUS_HIGHESTMODSEQ
dovecot.storage.STATUS_PERMANENT_FLAGS
dovecot.storage.FIRST_RECENT_UID
dovecot.storage.STATUS_HIGHESTPVTMODSEQ
dovecot.storage.MAILBOX_FLAG_READONLY
dovecot.storage.MAILBOX_FLAG_SAVEONLY
dovecot.storage.MAILBOX_FLAG_DROP_RECENT
dovecot.storage.MAILBOX_FLAG_NO_INDEX_FILES
dovecot.storage.MAILBOX_FLAG_KEEP_LOCKED
dovecot.storage.MAILBOX_FLAG_IGNORE_ACLS
dovecot.storage.MAILBOX_FLAG_AUTO_CREATE
dovecot.storage.MAILBOX_FLAG_AUTO_SUBSCRIBE
dovecot.storage.MAILBOX_SYNC_FLAG_FULL_READ
dovecot.storage.MAILBOX_SYNC_FLAG_FULL_WRITE
dovecot.storage.MAILBOX_SYNC_FLAG_FAST
dovecot.storage.MAILBOX_SYNC_FLAG_NO_EXPUNGES
dovecot.storage.MAILBOX_SYNC_FLAG_FIX_INCONSISTENT
dovecot.storage.MAILBOX_SYNC_FLAG_EXPUNGE
dovecot.storage.MAILBOX_SYNC_FLAG_FORGE_RESYNC
dovecot.storage.MAILBOX_ATTRIBUTE_PREFIX_DOVECOT
String constant vendor/vendor.dovecot/
.
dovecot.storage.MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVT
String constant vendor/vendor.dovecot/pvt/
.
dovecot.storage.MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVT_SERVER
String constant vendor/vendor.dovecot/pvt/server/
.
mail_user
tostring()
mail_user.plugin_getenv()
Signature | mail_user.plugin_getenv(key) | ||||||
---|---|---|---|---|---|---|---|
Arguments |
|
Returns key from user plugin settings or userdb environment.
mail_user.var_expand()
Signature | mail_user.var_expand(template) | ||||||
---|---|---|---|---|---|---|---|
Arguments |
|
Expands mail user variables (see Config variables
).
mail_user.mailbox()
Signature | mail_user.mailbox(name[, flags]) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Arguments |
|
Allocates a mailbox.
mail_user.metadata_get()
Signature | mail_user.metadata_get(key) | ||||||
---|---|---|---|---|---|---|---|
Arguments |
|
Returns given metadata key for the user.
mail_user.metadata_set()
Signature | mail_user.metadata_set(key, value) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Arguments |
|
Sets user metadata key to value.
mail_user.metadata_unset()
Signature | mail_user.metadata_unset(key) | ||||||
---|---|---|---|---|---|---|---|
Arguments |
|
Unsets value, same as calling mailbox.metadata_set()
with value = nil
.
mail_user.metadata_list()
Signature | mail_user.metadata_list(key[, key, ...]) | ||||||
---|---|---|---|---|---|---|---|
Arguments |
|
Lists all keys for the mailbox metadata under prefix.
mail_user.home
Home directory (if available).
mail_user.username
User's name.
mail_user.uid
System UID.
mail_user.gid
System GID.
mail_user.service
Service type (IMAP/POP3/LMTP/LDA/...).
mail_user.session_id
Current session ID.
mail_user.session_create_time
When session was created.
mail_user.nonexistent
Does user exist?
mail_user.anonymous
Is user anonymous?
mail_user.autocreated
Was user automatically created internally for some operation?
mail_user.mail_debug
Is debugging turned on?
mail_user.fuzzy_search
Does fuzzy search work for this user?
mail_user.dsyncing
Is user being dsynced?
mailbox
tostring()
mailbox.open()
Opens the mailbox.
mailbox.close()
Closes the mailbox.
mailbox.free()
Releases mailbox (must be done).
mailbox.sync()
Signature | mailbox.sync([flags]) | ||||||
---|---|---|---|---|---|---|---|
Arguments |
|
Synchronizes the mailbox (should usually be done).
mailbox.status()
Signature | mailbox.status(item[, item, ...]) | ||||||
---|---|---|---|---|---|---|---|
Arguments |
| ||||||
Returns | mailbox_status table |
Returns requested mailbox status items as table.
mailbox.metadata_get()
Signature | mailbox.metadata_get(key) | ||||||
---|---|---|---|---|---|---|---|
Arguments |
|
Returns given metadata key for the mailbox.
mailbox.metadata_set()
Signature | mailbox.metadata_set(key, value) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Arguments |
|
Sets mailbox metadata key to value.
mailbox.attribute
Full mailbox name.
mailbox.name
Mailbox name.
mailbox.attribute
Full mailbox name.
mailbox.name
Mailbox name.
mailbox_status
mailbox_status.mailbox
Full name of mailbox.
mailbox_status.messages
Number of messages.
mailbox_status.recent
Number of \Recent messages.
mailbox_status.unseen
Number of \Unseen messages.
mailbox_status.uidvalidity
Current UID validity.
mailbox_status.uidnext
Next UID.
mailbox_status.first_unseen_seq
First sequence number of unseen mail.
mailbox_status.first_recent_uid
First UID of unseen mail.
mailbox_status.highest_modseq
Highest modification sequence.
mailbox_status.highest_pvt_modseq
Highest private modification sequence.
mailbox_status.permanent_flags
Supported permanent flags as a bitmask.
mailbox_status.flags
Supported flags as a bitmask.
mailbox_status.permanent_keywords
Are permanent keywords supported?
mailbox_status.allow_new_keywords
Can new keywords be added?
mailbox_status.nonpermanent_modseqs
Are modification sequences temporary?
mailbox_status.no_modseq_tracking
Are modification sequences being tracked?
mailbox_status.have_guids
Do GUIDs exist?
mailbox_status.have_save_guids
Can GUIDs be saved?
mailbox_status.have_only_guid128
Are GUIDs only 128 bits?
mailbox_status.keywords
Table of current keywords.
mail
tostring()
None yet.
mail.mailbox
Mailbox object.
mail.seq
Sequence number (can change).
mail.uid
UID (immutable).