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_userscript: dlua_scriptReturns 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_scriptuser: mail_userPushes a mail user on top of stack.
void dlua_push_mailbox(struct dlua_script *script, struct mailbox *box) script: dlua_scriptmailbox: mailboxPushes a mailbox on top of stack.
void dlua_push_mail(struct dlua_script *script, struct mail* mail) script: dlua_scriptmail: mailPushes a mail on top of stack.
dovecot.storage dovecot.storage.STATUS_MESSAGESdovecot.storage.STATUS_RECENTdovecot.storage.STATUS_UIDNEXTdovecot.storage.STATUS_UIDVALIDITYdovecot.storage.STATUS_UNSEENdovecot.storage.STATUS_FIRST_UNSEEN_SEQdovecot.storage.STATUS_KEYWORDSdovecot.storage.STATUS_HIGHESTMODSEQdovecot.storage.STATUS_PERMANENT_FLAGSdovecot.storage.FIRST_RECENT_UIDdovecot.storage.STATUS_HIGHESTPVTMODSEQdovecot.storage.MAILBOX_FLAG_READONLYdovecot.storage.MAILBOX_FLAG_SAVEONLYdovecot.storage.MAILBOX_FLAG_DROP_RECENTdovecot.storage.MAILBOX_FLAG_NO_INDEX_FILESdovecot.storage.MAILBOX_FLAG_KEEP_LOCKEDdovecot.storage.MAILBOX_FLAG_IGNORE_ACLSdovecot.storage.MAILBOX_FLAG_AUTO_CREATEdovecot.storage.MAILBOX_FLAG_AUTO_SUBSCRIBEdovecot.storage.MAILBOX_SYNC_FLAG_FULL_READdovecot.storage.MAILBOX_SYNC_FLAG_FULL_WRITEdovecot.storage.MAILBOX_SYNC_FLAG_FASTdovecot.storage.MAILBOX_SYNC_FLAG_NO_EXPUNGESdovecot.storage.MAILBOX_SYNC_FLAG_FIX_INCONSISTENTdovecot.storage.MAILBOX_SYNC_FLAG_EXPUNGEdovecot.storage.MAILBOX_SYNC_FLAG_FORGE_RESYNCdovecot.storage.MAILBOX_ATTRIBUTE_PREFIX_DOVECOTString constant vendor/vendor.dovecot/.
dovecot.storage.MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVTString constant vendor/vendor.dovecot/pvt/.
dovecot.storage.MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVT_SERVERString 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 Settings 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.homeHome directory (if available).
mail_user.usernameUser's name.
mail_user.uidSystem UID.
mail_user.gidSystem GID.
mail_user.serviceService type (IMAP/POP3/LMTP/LDA/...).
mail_user.session_idCurrent session ID.
mail_user.session_create_timeWhen session was created.
mail_user.nonexistentDoes user exist?
mail_user.anonymousIs user anonymous?
mail_user.autocreatedWas user automatically created internally for some operation?
mail_user.mail_debugIs debugging turned on?
mail_user.fuzzy_searchDoes fuzzy search work for this user?
mail_user.dsyncingIs 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.attributeFull mailbox name.
mailbox.nameMailbox name.
mailbox.attribute Full mailbox name.
mailbox.name Mailbox name.
mailbox_status mailbox_status.mailboxFull name of mailbox.
mailbox_status.messagesNumber of messages.
mailbox_status.recentNumber of \Recent messages.
mailbox_status.unseenNumber of \Unseen messages.
mailbox_status.uidvalidityCurrent UID validity.
mailbox_status.uidnextNext UID.
mailbox_status.first_unseen_seqFirst sequence number of unseen mail.
mailbox_status.first_recent_uidFirst UID of unseen mail.
mailbox_status.highest_modseqHighest modification sequence.
mailbox_status.highest_pvt_modseqHighest private modification sequence.
mailbox_status.permanent_flagsSupported permanent flags as a bitmask.
mailbox_status.flagsSupported flags as a bitmask.
mailbox_status.permanent_keywordsAre permanent keywords supported?
mailbox_status.allow_new_keywordsCan new keywords be added?
mailbox_status.nonpermanent_modseqsAre modification sequences temporary?
mailbox_status.no_modseq_trackingAre modification sequences being tracked?
mailbox_status.have_guidsDo GUIDs exist?
mailbox_status.have_save_guidsCan GUIDs be saved?
mailbox_status.have_only_guid128Are GUIDs only 128 bits?
mailbox_status.keywordsTable of current keywords.
mail tostring()None yet.
mail.mailboxMailbox object.
mail.seqSequence number (can change).
mail.uidUID (immutable).