(Added in V6.12)
When the IMAP4 CAPABILITY command is received, VPOP3 generates a capability string based on settings, then calls
DoCapability(ipaddr, capabilities)
The function should return a new capabilities string. To do nothing, return the 'capabilities' argument. You can remove capabilities from the string by using string modification functions. We do not recommend adding capabilities as they will not be supported by the rest of the IMAP4 service, so could lead to email client problems.
e.g.
function DoCapability(ipaddr, caps) --Remove IDLE from the list of capabilities caps = string.gsub(caps, " IDLE ", " ") return caps end
if (m_Lua.Call("DoListResult", false, f->first, strFlags, strExtra)) { m_Lua.GetReturnIndexString(1, strFlags); m_Lua.GetReturnIndexString(2, strExtra); }
When the IMAP4 LIST command is received, for each folder to be returned by the command, VPOP3 calls
DoListResult(foldername, attributes, extended)
The function should return a three values
If the folder response is sent, it is formatted as:
* (<attributes>) “/” “<foldername>”<extended>
e.g.
function DoListResult(folder, attributes, extended) -- do nothing return true, attributes, extended end
(Added in version 8.7)
When a connection is established, this lets the script define the encryption mode for this connection
GetEncryption(ipaddr, server addr, server port, default encryption mode)
returns a single number of the new encryption mode
e.g. This will set SSL/TLS for connections to port 993 (bind the service to both ports 143 and 993, and set the encryption mode for None/STARTTLS or STARTTLS, which will still apply to connections to port 143)
function GetEncryption(client, svr, svrport, enc) if (svrport==993) then enc = 1; end return enc; end