User Tools

Site Tools


reference:user_delivery_script

This is an old revision of the document!


User Delivery Script

If there is a <username>/delivery.lua script, this Lua script can override VPOP3's message delivery options. You can edit this either in the Settings → Scripts page in the settings. This script affects how VPOP3 will handle how messages being delivered to this user are handled.

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.

Global Variables set before DeliverMessage function is called

  • User - the username the message is to be delivered to
  • Subject - the subject of the message
  • Originator - the email address of the message sender
  • Filename - the temporary name of the file containing the message to be delivered
  • MessageSize - the size of the message to be delivered
  • Held - whether the message is to be delivered as held
  • Seen - whether the message is to be delivered as marked read
  • Flagged - whether the message is to be delivered as flagged/starred
  • Keywords - a table containing a list of keywords to be associated with the message
  • Folders - a table containing a list of folders for the message to be delivered to
  • SpamScore - the VPOP3 spam filter's score assigned to the message

Global Variables which can be set by the function

  • Held - whether the message is to be delivered as held
  • Seen - whether the message is to be delivered as marked read
  • Flagged - whether the message is to be delivered as flagged/starred
  • Keywords - a table containing a list of keywords to be associated with the message
  • Folders - a table containing a list of folders for the message to be delivered to

Note that the script can do other things as well, such as saving the message contents elsewhere (using the 'Filename' variable) or calling an external program, or whatever. If the script doesn't alter the global variables, the message will be delivered just as if the script hadn't been called.

reference/user_delivery_script.1425981345.txt.gz · Last modified: 2018/11/14 10:44 (external edit)