User Tools

Site Tools


reference:user_delivery_script

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
Next revisionBoth sides next revision
reference:user_delivery_script [2015/03/10 09:56] – [User Delivery Script] paulreference:user_delivery_script [2016/04/15 15:41] – [User Delivery Script] paul
Line 6: Line 6:
 If that script doesn't exist, but there is a delivery.lua script, that Lua script will be used instead. If that script doesn't exist, but there is a delivery.lua script, that Lua script will be used instead.
  
-The script contains one function "DeliverMessage"This function is called with no parameters, but will have access to global variables containing information about the message and can modify global variables to alter the way the message delivery is handled.+The script can contain two functions "PreDeliver" and "DeliverMessage"These functions are called with no parameters, but will have access to global variables containing information about the message and can modify global variables to alter the way the message delivery is handled
 + 
 +(Prior to v6.20, only the **DeliverMessage** function is used) 
 + 
 +**PreDeliver** is called at the beginning of the delivery process, after Message Rules have been handled. It can modify any globals, but only the Quarantine, Forwards, HeaderMods, ForwardingSenderAddress and ForwardingSenderText globals are read after it has been called. Any other changes will be processed after the **DeliverMessage** function is called. 
 + 
 +If the message is quarantined or Message Rules have indicated that it is not to be delivered to any folders, then it will not be delivered further so **DeliverMessage** will not be called. 
 + 
 +**DeliverMessage** is called in the middle of the delivery process, as long as the message is still being delivered into at least one message folder.
  
 =====Global Variables set before DeliverMessage function is called===== =====Global Variables set before DeliverMessage function is called=====
reference/user_delivery_script.txt · Last modified: 2018/11/14 10:45 by 127.0.0.1