User Tools

Site Tools


reference:lua_smtp_relay_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_relay_control [2014/03/05 13:20] – [Global Variables] paulreference:lua_smtp_relay_control [2025/08/14 10:24] (current) paul
Line 10: Line 10:
   * sendername - this is the name you gave to the message sender configuration in VPOP3   * sendername - this is the name you gave to the message sender configuration in VPOP3
  
-In VPOP3 5 and later, there is an read/write global variable+In VPOP3 5 and later, there is read/write global variable
   * UseBATV - this is a boolean value saying whether to [[http://en.wikipedia.org/wiki/Bounce_Address_Tag_Validation|BATV]] encode the return path address   * UseBATV - this is a boolean value saying whether to [[http://en.wikipedia.org/wiki/Bounce_Address_Tag_Validation|BATV]] encode the return path address
  
Line 18: Line 18:
   * MaxRecipientsPerMessage - The maximum number of recipients to send each message to   * MaxRecipientsPerMessage - The maximum number of recipients to send each message to
   * ConnectedServer (read only) - The server name which VPOP3 has connected to (set just before the ServerConnected function call)   * ConnectedServer (read only) - The server name which VPOP3 has connected to (set just before the ServerConnected function call)
 +
 +In VPOP3 8.8 and later, there is a read/write global variables
 +  * VerifyCertificate - this is a boolean value saying whether to verify the SSL certificate when connecting in SSL/TLS or STARTTLS mode. If the certificate verification fails (certificate/hostname mismatch or not verifying to a root) then the connection will terminate
 =====Initialisation===== =====Initialisation=====
 When VPOP3 starts the send process, it calls the function **Start** which takes no parameters, and has no return value. This can be used for initialisation, or for changing read/write global variables When VPOP3 starts the send process, it calls the function **Start** which takes no parameters, and has no return value. This can be used for initialisation, or for changing read/write global variables
  
 +In VPOP3 v6.7 and later, after VPOP3 has connected to an SMTP relay server, it calls the function **ServerConnected** which takes no parameters and has no return value. The **ConnectedServer** global variable is set just before this function call.
 =====Return Code Handling===== =====Return Code Handling=====
 Starting in version 5.0.0, VPOP3 will call the function **ReturnCodeHandler** every time it receives a return code from the ISP's server.  Starting in version 5.0.0, VPOP3 will call the function **ReturnCodeHandler** every time it receives a return code from the ISP's server. 
Line 92: Line 96:
 end; end;
 </code> </code>
 +
 +=====Return Path Modification=====
 +
 +In VPOP3 v8.8 and later, a function is called as each message is sent, allowing the Lua script to rewrite the Return Path (MAIL FROM) address. This can be useful for implementing things such as SRS or other sender rewriting
 +
 +The function signature is:
 +**ModifyReturnPath(Computed-Mail-From, Mail-From, Original-Mail-From, Auth-Sender, Recipients, Creation-Time, Headers, Size, Sender-IP-Address, Subject, All-Recipients)**
 +  * Computed-Mail-From - the Return Path after being processed by VPOP3 (eg using 'Return Path Settings' in the Mail Sender). This is the Return Path that will be used if the Lua script doesn't give an alternative
 +  * Mail-From - the Return Path prior to the Return Path Settings acting on it. This can take account of Mappings to change it
 +  * Original-Mail-From - the original Return Path when the message was sent
 +  * Auth-Sender - the authenticated VPOP3 user who sent the message
 +  * Recipients - a table of recipients to whom this message will be sent at this time
 +  * Creation-Time - the time the outgoing message was created in VPOP3. In ISO-8601 format
 +  * Headers - a table of the message headers
 +  * Size - the message size
 +  * Sender-IP-Address - the IP address of the message sender (or blank if created by VPOP3)
 +  * Subject - the message subject
 +  * All-Recipients - a table of all the recipients the message was sent to. This may contain more recipients than the 'Recipients' table, because the message may already have been sent to some recipients, or Domain Filtering may have removed some recipients from this send attempt
 +
 +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).
reference/lua_smtp_relay_control.1394025602.txt.gz · Last modified: 2018/11/14 10:44 (external edit)