User Tools

Site Tools


IMAP4 Server Scripting

(Added in V6.12)

DoCapability function

When the IMAP4 CAPABILITY command is received, VPOP3 generates a capability string based on settings, then calls

DoCapability(ipaddr, capabilities)
  • ipaddr = IP address of the client computer
  • capabilities = generated capabilities (a space is added at the beginning and end to make finding words simpler)

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.


function DoCapability(ipaddr, caps)
  --Remove IDLE from the list of capabilities
  caps = string.gsub(caps, " IDLE ", " ")
  return caps

DoListResult function

			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)
  • foldername = the name of the folder
  • attributes = the attributes which will be returned for the list
  • extended = extra information to be returned for the list (eg CHILDINFO data)

The function should return a three values

  1. boolean to indicate whether the folder response should be sent (true) or hidden (false)
  2. new attributes
  3. new extended data

If the folder response is sent, it is formatted as: * (<attributes>) “/” “<foldername>”<extended>


function DoListResult(folder, attributes, extended)
-- do nothing
  return true, attributes, extended
reference/imap4_server_script.txt · Last modified: 2018/11/14 10:45 by