Skip to main content

Category File

Last updated October 2021

msys.db.executeExecute a query that is not expected to return data
ac:esmtp_capability_addAdd a capability to the EHLO response
ac:esmtp_capability_removeRemove a capability string from the EHLO response
ac:inbound_session_countReturn the current inbound session count to this listener for the connecting IP
msys.cloudmark.analyzeAnalyze a message using Cloudmark
msys.cloudmark.add_af_dataPass data for use with the Cloudmark ActiveFilter.
msys.cloudmark.scoreScan messages using Cloudmark
msys.cloudmark.score_afSet the Cloudmark ActiveFilter score threshold
msys.cloudmark.set_af_mode_discardSet the Cloudmark ActiveFilter mode to DISCARD.
msys.cloudmark.set_af_mode_keepSet the Cloudmark ActiveFilter mode to KEEP.
msys.cloudmark.set_af_mode_movemsgSet the Cloudmark ActiveFilter mode to MOVEMSG.
msys.cloudmark.set_af_msi_addressSet the address for the Cloudmark ActiveFilter MSI Messages.
msys.apn.apn_status_classifierDetermine whether the delivery status code represents a permanent or temporary failure
client:do_requestPerform an HTTP request
client:get_bodyGet the body of an HTTP response
client:get_headersGet HTTP headers
client:get_statusReturn the status of an HTTP request
sess:request_add_headerAdd a header to an HTTP session
sess:request_delete_headerDelete a header from an HTTP session
sess:request_finalizeFinalize changes to an HTTP request
sess:request_set_bodySet the body of an HTTP session
msys.httpclnt.http_status_classifierDetermine the delivery status of the "DLV_Response_Status" variable
msys.http.client.newCreate an HTTP client
client:parse_headersParse the headers of an HTTP response
client:set_headerSet an HTTP header
client:set_timeoutSet the timeout for an HTTP client
c:closeClose a curl object
c:performPerform the file transfer
c:setoptSet the option value of a curl object
curl.escapeURL encode a string
curl.newCreate a cURL object
curl.unescapeUnescape URL encoding in strings
msys.core.dns_get_domainGet a domain record
msys.core.get_now_tsGet the current time
msys.core.mail_queue_delay_domainAdd a domain record to the delayed queue
msys.core.string_newCreate an ec_string
msg:codeGet or set the message code
msg:get_envelope2Get envelope values
msg:headerManipulate message headers
msg:listener_addrGet the recv_via IP and/or PORT.
msg:reception_peerGet the recv_from IP and/or PORT.
msg:context_deleteDelete a context variable
msg:context_existsCheck if a context variable exists
msg:context_exists_and_getCheck if a context variable exists and get it
msg:context_getGet a context variable
msg:context_setSets a context variable
msgpart:unlinkRemove the part (and its children) from the MIME tree
msys.core.io_wrapper_openOpen a handle to a resource
msys.castCast an object to the specified class
msys.configSet or get configuration values
msys.dnsLookupPerform a DNS lookup
msys.expandMacroExpand macros (such as sieve, spf and custom_logger macros)
msys.getClassMetaTableReturn the metatable for the named class
msys.httpsrv.registerRegister a Lua function as an HTTP endpoint
msys.idn.to_idnAttempts to convert the domain to the IDN format
msys.idn.to_utf8Converts an IDN formatted string to unicode
msys.lockThe current running OS level thread obtains a lock on the named mutex
msys.parseRFC2822AddressesParse the address string per the address parsing rules defined in RFC2822
msys.readfileRead the entire contents of the specified file or URI
msys.registerAuthRegister an authentication/authorization scheme that can be used for SMTP or control channel authentication
msys.registerControlRegister a command with the control channel subsystem
msys.registerModuleRegister a Lua module with the system.
msys.runInInstRun a function in a specific event loop
msys.runInPoolRun a function in a separate threadpool
msys.sleepWhen called in the scheduler thread, suspend the current session for the specified duration
msys.snmpTrapIssue an SNMP trap
msys.typeReturn the type name of the supplied parameter
msys.unlockRelease a lock obtained via msys.lock
session:request_url_getGet the request URL
session:response_status_set_stdSet the HTTP status for the session response
json.decodeCreate a JSON object from a JSON string
json.encodeConvert a Lua variable or an expression for use with a JSON object
json.newCreate an empty JSON object
json.strerrorReturn the description of a JSON error code
msg.batch_idReturn the human-readable ec_message.batch_id
msg.conn_idReturn the human-readable ec_message.conn_id
msg.idReturn the human-readable
msg:address_headerReturns address components as an array
msg:bindingSet or get the message binding
msg:binding_groupSets the binding_group to the named binding, if one is provided.
msg:bodySet the message body (minus headers) if provided
msg:body_matchStreaming interface to a PCRE search of a message body (minus headers)
msg:body_replaceStreaming interface to a PCRE replacement of a message body (minus headers)
msg:buildCreate a message
msg:discardSilently discard a message
msg:forwardForward the current message to recipients other than the original recipients
msg:get_delivery_methodReturn the delivery method for a message
msg:get_message_sizeReturn the size of a message
msg:injectUse this function to send mail
msg:is_mcmtDetermine whether a message is a MCMT message
msg:mailfromSets the 'MAIL FROM' email address if one is provided
msg:makeBoundaryGenerates a unique boundary string
msg:makeContainerCreates a new, unlinked, container message part
msg:makePartCreates a new, unlinked, singleton (or leaf) message part
msg:mimeReturns the top of the MIME tree for the message, a message part
msg:rawSet or returns the message content and the message length
msg:raw_matchStreaming interface to a PCRE search of the message content
msg:raw_replaceStreaming interface to a PCRE replacement of message content
msg:rcpttoSets the 'RCPT TO' email address if one is provided
msg:routing_domainSet or return the routing domain for a message
msg:textReturn the transfer decoded text for the body
msg:textReplace the entire message body
msg:text_matchStreaming PCRE search across the transfer-decoded, UTF-8 text version of the message body
msg:text_replaceStreaming interface to a PCRE replacement of textual content from the message body
msgpart:addFirstChildAdds a child as the first child on this part
msgpart:addLastChildAdds a child as the last child on this part
msgpart:address_headerParse each instance of the named header for RFC2822 addresses
msgpart:body_matchStreaming interface to a PCRE search of a message body part (minus headers)
msgpart:body_replaceStreaming interface to a PCRE replacement of a message body part (minus headers)
msgpart:content_typeReturns a table of content type related information
msgpart:headerReturn an array of header values for the given name
msgpart:headerUnset the header name of the current message part
msgpart:headerIf mode is replace (or unspecified): first deletes all other headers of that name before appending the new value to the message headers
msgpart:insertAfterInsert this part into the MIME tree after the given parameter
msgpart:insertBeforeInsert this part into the MIME tree before the given parameter
msgpart:raw_matchStreaming interface to a PCRE search of the current message part
msgpart:raw_replaceStreaming interface to a PCRE replacement message part content
msgpart:textThe entire message body part is replaced by the supplied text
msgpart:textReturns the transfer decoded text for the message part, in UTF-8
msgpart:text_matchStreaming a PCRE search across the transfer decoded UTF-8 text version of the message body part
msgpart:text_replaceStreaming interface to a PCRE replacement of textual content from the message body parts
msys.asyncOkCheck if the current execution environment is suitable for suspend/resume operations
msys.audit.connectionsReturn the number of connections that have occurred for a CIDR block within a configured time window
msys.audit.inbound_session_countCount connections currently established from the specified cidr to the specified service
msys.audit.receptionsReturn the number of receptions that have occurred for a CIDR block within a configured time window
msys.audit.rejectionsReturn the number of rejections that have occurred for a CIDR block within a configured time window
msys.audit_series.addAdjust the counter for the current time window of a named series
msys.audit_series.countReturn the total associated with the named series
msys.audit_series.defineDefine an audit series
msys.audit_series.remove_itemRemove a counter from a named series
msys.av.enginesReturn a list of configured engine names in a table
msys.av.scanPerform a virus scan using the named engine
msys.av.scan_partPerform a virus scan on a specific message part using the named engine
msys.base64.decodeDecode a base64 encoded string
msys.base64.encodeBase64-encode a string
msys.bounce.classifyCreate a bounce classification for a message
msys.bounce.classify_smtp_responseCreate a bounce classification from SMTP response text and the domain name
msys.brightmail.scanUse Brightmail to scan messages
msys.cidr.defineDefine a named CIDR object
msys.cidr.queryLook up address against the named CIDR
msys.cidr.reloadRefresh CIDRs of type datasource and rbldnsd
msys.commtouch.diagnoseScan messages using Commtouch
msys.counter.addAdd to the current value of the specified counter
msys.counter.incIncrement a counter
msys.counter.openCreate a counter object
msys.counter.readRead the specified counter
msys.counter.resetReset a counter
msys.counter.unlinkUnlink a counter
msys.db.fetch_rowIf successful, return the first row of the query result as a table
msys.db.queryQuery a datasource the current message from the session context
msys.dumper.DumperDump information about an object
msys.expurgate.scanScan using the Eleven antivirus engine
msys.gauge_cache.decDecrement the value associated with keystring in the named cache
msys.gauge_cache.defineCreate a cache that can be used to maintain a set of counters
msys.gauge_cache.getLook up the value associated with keystring in the named cache
msys.gauge_cache.incIncrement the value associated with keystring in the named cache
msys.gauge_cache.remove_itemRemove the value associated with keystring from the named cache
msys.gcm.gcm_classify_errorDetermine the delivery status of the "DLV_Response_Status" variable
msys.gcm.gcm_get_result_error_codeGet the error code from the response results error
msys.pcre.matchPerform a PCRE regex match operation
msys.pcre.replacePerform a PCRE replace operation
msys.pcre.splitPerform a PCRE split operation
msys.os.statvfs_readRequest a snapshot of the stream
msys.os.statvfs_subscribeProvide a "stream" for file system statistics (statvfs) updates
msys.qp.decodeDecode a quoted-printable message
msys.qp.encodeQuoted-printable encode a string
msys.rfc3464.compute_delivery_statusGenerate RFC3464 compliant delivery status headers
msys.rfc3464.compute_delivery_status_stringGenerate RFC3464 compliant delivery status headers
msys.rfc3464.create_mdnGenerate an MDN from a message
msys.rfc3464.extract_delivery_statusReturn a table of parsed email headers
msys.rfc3464.send_mdnGenerate and enqueue an MDN
msys.symantec_beik.scanScan using BEIK
msys.threadpool.countReturn the current number of thread pools
msys.threadpool.findFind a thread pool name from a job class ID or a job class ID from a thread pool name
msys.threadpool.statReturn stats regarding a threadpool
msys.timer.afterexecute closure after a given time
msys.timer.atexecute closure at a given time
msys.timer.everyexecute closure every interval
msys.tls_params.setSet a tls parameter string on a per connection basis the domain responsible for the current message a message using a Domain Key
msys.validate.opendkim.get_num_sigsReturn the number of DKIM signatures
msys.validate.opendkim.get_sigGet a signature from a DKIM object
msys.validate.opendkim.get_sig_canonsFetch the canonicalizers used for a signature
msys.validate.opendkim.get_sig_domainFetch the signing domain from a DKIM_SIGINFO object
msys.validate.opendkim.get_sig_errorstrFetch the error associated with a DKIM signature
msys.validate.opendkim.get_sig_flagsFetch the flags associated with a DKIM signature
msys.validate.opendkim.get_sig_hdrsignedDetermine whether a given header was signed
msys.validate.opendkim.get_sig_identityFetch the identity associated with a DKIM signature
msys.validate.opendkim.get_sig_keysizeFetch the size of the key used to generate a signature
msys.validate.opendkim.get_sig_selectorFetch the selector associated with a DKIM signature
msys.validate.opendkim.get_sig_signalgReturn the signing algorithm as a string
msys.validate.opendkim.signSign a message using OpenDKIM
msys.validate.opendkim.verifyVerify a DKIM signature
thread.mutexcreate a new mutex
vctx:add_recipientAdd an address to the recipient list for the inbound session
vctx:disconnectDisconnect the session associated with the current validation context
vctx:getGet the value of a context variable
vctx:recipient_listReturn or set the current recipient list
vctx:remove_recipientRemove an address from the recipient list
vctx:setSet the value of a context variable
vctx:set_codeSet the inbound disposition and response message
vctx:tarpitIssue a time cost on the inbound session
doc:rootReturn the root node of an XML document
doc:tostringOutput a DOM document as a string
doc:xpathPerform an XPath query
node:addchildAdd a child node
node:attributeSet or get the attribute of a node
node:childrenReturn an iterator of all child nodes
node:contentsGet or set a text node
node:docReturn the document object that contains the specified node
node:nameReturn the name of a node
node:tostringOutput a node as a string
node:unlinkUnlink an XML node from its DOM container
xml.parsexmlCreate an XML document object

This section details all Lua functions. Functions are ordered alphabetically by name.


Many Lua functions act as wrappers for C code which means that the calling code needs to take steps to ensure safety. When calling a C API, make sure that all the arguments are valid as an unexpected nil may crash the system or have other undesirable results. Additionally, the data structures returned from C APIs are often shared between C and Lua. The most important consequence of this is that arrays coming from C APIs must only be accessed with existing indices, as opposed to Lua which simply returns nil on out-of-bounds access. Failure to do this on a Lua table connected to a C array will cause the system to fail.

Was this page helpful?