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

Both sides previous revisionPrevious revision
Next revision
Previous revision
reference:lua_smtp_mx_control [2025/08/14 09:27] paulreference:lua_smtp_mx_control [2026/02/24 15:49] (current) – [Lua SMTP MX Control] paul
Line 3: Line 3:
 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). 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).
  
 +====Global Variables====
 +Starting with v8.8, the following global variables are defined:
 +
 +  * ConnectionId - the numeric Sender/Connection ID
 +  * ConnectionName - the text Sender/Connection name
 =====Messages to be sent===== =====Messages to be sent=====
 For every message which is to be sent VPOP3 calls a function in that script called **CheckFile**. For every message which is to be sent VPOP3 calls a function in that script called **CheckFile**.
Line 96: Line 101:
  
 The function can return a single string value which is the new Return Path to use (if it doesn't return anything, then the 'Computed-Mail-From' value will be used). The function can return a single string value which is the new Return Path to use (if it doesn't return anything, then the 'Computed-Mail-From' value will be used).
 +
 +=====Return Code Handling=====
 +Starting in version 8.8, VPOP3 will call the function **ReturnCodeHandler** every time it receives a return code from the onward MX server. 
 +
 +The function signature is:
 +**ReturnCodeHandler(LastCommand, FullResponse)**
 +  * LastCommand - the last SMTP command sent by VPOP3
 +  * FullResponse - the latest full response from the ISP. Note that if the ISP gives a multi-line response, this value contains the full response, not just one line of it
 +
 +The function optionally returns a string which contains the new full response. This must start with a numeric SMTP return code.
 +
 +This function is intended to be used if the ISP returns inappropriate return codes. For instance, some ISPs return '4xx' return codes for 'bad recipient', which makes VPOP3 retry sending the message when they should really return a '5xx' return code to tell VPOP3 not to retry the message, and just generate a delivery failure report.
reference/lua_smtp_mx_control.1755163656.txt.gz · Last modified: 2025/08/14 09:27 by paul