User Tools

Site Tools


reference:lua_smtp_mx_control

Differences

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

Link to this comparison view

Next revision
Previous revision
reference:lua_smtp_mx_control [2013/03/27 11:08] – created paulreference:lua_smtp_mx_control [2023/07/28 16:41] (current) paul
Line 1: Line 1:
-======Lua SMTP Relay Control======+======Lua SMTP MX Control======
  
-Every time VPOP3 is going to send messages using direct MX sending, it runs a script called **mxout.lua** in the VPOP3 directory.+Every time VPOP3 is going to send messages using direct MX sending, it runs a script called **mxout.lua** which can be created/edited in Settings -> Scripts (or in the VPOP3 directory in VPOP3 v6.6 or earlier).
  
 =====Messages to be sent===== =====Messages to be sent=====
Line 28: Line 28:
   * Reason - this is logged as the reason if the SkipSend value is true.   * Reason - this is logged as the reason if the SkipSend value is true.
  
 +=====Remote Server Settings=====
 +If you need to tweak how VPOP3 connects to remote servers you can write a **ServerDetails** function. VPOP3 calls this function before sending each message.
  
 +(This function was [[https://bugtracker.pscs.co.uk/view.php?id=968|added in VPOP3 v6.5]])
 +
 +The function signature is:
 +**ServerDetails(Parameters, HeaderLines, Actions)**
 +
 +The Parameters object contains details of the message being sent:
 +  * authsender - the authenticated sender (if any) that sent the message to VPOP3
 +  * originator - the email address that sent the message to VPOP3
 +  * server - the mail server being connected to
 +  * domain - the domain the message is being sent to
 +  * length - the size of the message being sent
 +  * connnid - the VPOP3 Connection/Sender ID
 +  * connection - the VPOP3 Connection/Sender name
 +
 +The function returns an Actions object saying what to do with the message. If nothing else, the function should return the Actions parameter.
 +
 +The Actions object contains 9 or more values:
 +  * tryESMTP - boolean to say whether VPOP3 should try to use ESMTP when connecting. If false, VPOP3 will just try SMTP. The default is true, where VPOP3 will attempt ESMTP and try to fallback to SMTP if the remote server doesn't support ESMTP
 +  * tryTLS - boolean to say whether VPOP3 should use TLS if the remote server claims to support it
 +  * HELOname - the text name to use when VPOP3 sends the HELO or EHLO command
 +  * useBATV - whether VPOP3 should use BATV translation when sending the message
 +  * timeouts - a list of timeouts for the session
 +  * returnAddressModifier - should the return address be modified by VPOP3
 +  * defaultReturnAddress - the return address to use if VPOP3 modifies it
 +  * nullReturnAddress - the return address to use if VPOP3 should send a null return address
 +  * allowDSN - boolean to indicate whether VPOP3 should use DSN if the remote server claims to support it
 +
 +Starting with VPOP3 v6.17 it also contains:
 +  * forceTLS - 1/0 to indicate that STARTTLS connection is forced. Connection fails if STARTTLS is not supported or fails
 +  * verifyCert - 1/0 to indicate that the TLS certificate should be verified after connection. The connection will fail if verification fails
 +  * checkCertName - wildcard string to check against the TLS certificate CN. The connection will fail if the CN doesn't match (case insensitive)
 +  * checkCertThumbprint - string to check against the TLS certificate SHA-1 thumbprint. The connection will fail if the thumbprint doesn't match (case insensitive)
 +
 +Example - don't use SSL when connecting to 'mail.broken.com'
 +
 +  function ServerDetails(params, headers, actions)
 +    if params["server"] == "mail.broken.com" then
 +      actions["tryTLS"] = 0
 +    end
 +    return actions
 +  end
 +  
 +
 +=====ParseURL=====
 +(VPOP3 8.0 and later)
reference/lua_smtp_mx_control.1364382531.txt.gz · Last modified: 2018/11/14 10:44 (external edit)