User Tools

Site Tools


reference:user_routing_script

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
reference:user_routing_script [2018/11/14 10:45]
127.0.0.1 external edit
reference:user_routing_script [2021/02/19 09:51] (current)
paul
Line 42: Line 42:
 <​code>​ <​code>​
 --Don'​t forward any messages from any *@localdomain.com addresses --Don'​t forward any messages from any *@localdomain.com addresses
-if (string.find(Sender,​ "​@localdomain%.com$"​))+if string.find(Sender,​ "​@localdomain%.com$"​) ​then
   ShouldForward = false;   ShouldForward = false;
 end end
 </​code>​ </​code>​
  
-====If ​ the sender is user@domain.com forward to person@mycompany.com====+====If the sender is user@domain.com forward to person@mycompany.com====
  
  
 <​code>​ <​code>​
 --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) == "​user@domain.com"​)+if string.lower(Sender) == "​user@domain.com" ​then
   Forwards = "​person@mycompany.com";​   Forwards = "​person@mycompany.com";​
   UseForwards = true;   UseForwards = true;
   ShouldForward = true;   ShouldForward = true;
 +end
 +</​code>​
 +
 +====If the time is currently in the morning, override the assistant to send to someone else====
 +
 +<​code>​
 +now = os.date("​*t"​);​ --https://​www.lua.org/​pil/​22.1.html
 +if now.hour < 12 then
 +  Assistants = "​otheraddress@example.com"​
 end end
 </​code>​ </​code>​
  
reference/user_routing_script.txt ยท Last modified: 2021/02/19 09:51 by paul