This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
reference:send_admin_message [2012/07/18 16:20] – created simon | reference:send_admin_message [2018/11/14 10:45] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 20: | Line 20: | ||
* **{mailboxquota}** - the total number of megabytes allocated for the recipient' | * **{mailboxquota}** - the total number of megabytes allocated for the recipient' | ||
* **{lua}...{/ | * **{lua}...{/ | ||
+ | |||
+ | =====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 ' | ||
+ | (The variable names are case sensitive) | ||
+ | |||
+ | Anything that the script ' | ||
+ | |||
+ | 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 ' | ||
+ |