User Tools

Site Tools


reference:send_admin_message

Differences

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

Link to this comparison view

Last revisionBoth sides next revision
reference:send_admin_message [2012/07/18 16:20] – created simonreference:send_admin_message [2013/02/21 13:28] – [Keywords] paul
Line 20: Line 20:
   * **{mailboxquota}** - the total number of megabytes allocated for the recipient's mailbox quota. Note: this value will be 0, where no quota has been set.   * **{mailboxquota}** - the total number of megabytes allocated for the recipient's mailbox quota. Note: this value will be 0, where no quota has been set.
   * **{lua}...{/lua}** - will execute an embedded [[Lua scripting|Lua script]].   * **{lua}...{/lua}** - will execute an embedded [[Lua scripting|Lua script]].
 +
 +=====Using Lua=====
 +On of the options of this facility lets you specify a Lua script in the message to send. This script lets you customise the message for each user.
 +
 +See the [[Lua scripting]] page for details on the VPOP3 Lua implementation.
 +
 +When a Lua script in the administrator message is run, it has certain global variables set:
 +
 +  * **Username** - contains the username of the user currently being processed
 +  * **MessageCount** - contains the number of messages in the user's inbox
 +  * **MailboxSize** - contains the size of the user's whole mailbox (in bytes)
 +  * **MailboxQuota** - contains the user's mailbox quota setting (in bytes - 0 means no limit)
 +  * **LDAP** - this is a table containing the LDAP attributes for this user - the attribute names are in upper case - eg LDAP.CN is the user's 'display name'
 +(The variable names are case sensitive)
 +
 +Anything that the script 'prints' gets sent to the user
 +
 +An example Lua script used in the message sending facility might be
 +
 +  {lua}
 +  if MailboxQuota ~= 0 then
 +    print ("You are currently using " .. MailboxSize .. " bytes of your allowed " .. MailboxQuota .. " bytes in your mailbox")
 +  end
 +  {/lua}
 +  
 +If the Lua script sets the global variable 'DontSend' (case sensitive) to '1' then VPOP3 won't send the message to this particular user.
 +
reference/send_admin_message.txt · Last modified: 2018/11/14 10:45 by 127.0.0.1