This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
reference:user_routing_script [2011/10/05 15:24] – paul | reference:user_routing_script [2023/03/27 11:32] (current) – paul | ||
---|---|---|---|
Line 1: | Line 1: | ||
======User Routing Script====== | ======User Routing Script====== | ||
- | If there is a user_redirect.lua | + | If there is a < |
- | If that file doesn' | + | If that script |
When the user_redirect.lua script is run there are several global variables set: | When the user_redirect.lua script is run there are several global variables set: | ||
Line 34: | Line 34: | ||
* Subject - the subject of the message | * Subject - the subject of the message | ||
- | An example script might be | + | |
+ | Please note - the only help we will give with Lua with our free support is to clarify the Lua interface (eg function signatures etc), we will not give help with Lua in general or help you to write or debug your own Lua scripts. We can help with that, but it will be on a chargeable basis depending on the complexity of the issue. Contact us for more information. | ||
+ | =====Examples===== | ||
+ | |||
+ | ====Don' | ||
< | < | ||
--Don' | --Don' | ||
- | if (string.find(Sender, | + | if string.find(Sender, |
- | ShouldForward = false | + | ShouldForward = false; |
end | end | ||
</ | </ | ||
+ | ====If the sender is user@domain.com forward to person@mycompany.com==== | ||
+ | |||
+ | |||
+ | < | ||
+ | --If the sender is user@domain.com forward to person@mycompany.com | ||
+ | if string.lower(Sender) == " | ||
+ | Forwards = " | ||
+ | UseForwards = true; | ||
+ | ShouldForward = true; | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | ====If the time is currently in the morning, override the assistant to send to someone else==== | ||
+ | |||
+ | < | ||
+ | now = os.date(" | ||
+ | if now.hour < 12 then | ||
+ | Assistants = " | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | ====If the current time is between 10:00 on 2nd March 2023 and 17:00 on 5th March 2023, then forward==== | ||
+ | |||
+ | < | ||
+ | now = os.date(" | ||
+ | if (now >= " | ||
+ | Forwards = " | ||
+ | UseForwards = true; | ||
+ | ShouldForward = true; | ||
+ | end | ||
+ | </ |