Table of Contents

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)

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

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)

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>

e.g.

function DoListResult(folder, attributes, extended)
-- do nothing
  return true, attributes, extended
end