User Tools

Site Tools


reference:imap4_server_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
reference:imap4_server_script [2015/03/23 14:58] – created paulreference:imap4_server_script [2025/06/23 11:51] (current) paul
Line 7: Line 7:
  
   DoCapability(ipaddr, capabilities)   DoCapability(ipaddr, capabilities)
-  +
   * ipaddr = IP address of the client computer   * ipaddr = IP address of the client computer
   * capabilities = generated capabilities (a space is added at the beginning and end to make finding words simpler)   * capabilities = generated capabilities (a space is added at the beginning and end to make finding words simpler)
Line 19: Line 19:
     return caps     return caps
   end   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)
 +
 +  * 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
 +  - boolean to indicate whether the folder response should be sent (true) or hidden (false)
 +  - new attributes
 +  - 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  
 +  
 +  
 +====GetEncryption function====
 +(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)
 +
 +  * ipaddr - client IP address
 +  * server addr - server IP address (eg if different IP addresses have bindings)
 +  * server port - server port (eg if different ports have bindings)
 +  * default encryption mode - 0 = no encryption/STARTTLS, 1 = SSL/TLS, 3 = Force STARTTLS
 +
 +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 
reference/imap4_server_script.1427122731.txt.gz · Last modified: 2018/11/14 10:44 (external edit)