This applies to Outlook 2010 and newer, including Outlook 365, 2021, 2019, 2016.
Office users who use run-a-script rules are discovering their scripts are currently disabled (as is Start Application), thanks to a security update. When the update is installed, any existing run-a-script and run application rules will be disabled.
To fix, you need to set the EnableUnsafeClientMailRules value in the registry then restart Outlook.
Outlook 2016 and newer
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Security
DWORD: EnableUnsafeClientMailRules
Value: 1
Outlook 2013
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Security
DWORD: EnableUnsafeClientMailRules
Value: 1
Outlook 2010
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Security
DWORD: EnableUnsafeClientMailRules
Value: 1
If you don't want to edit the registry yourself, you can use this ready-to-use .reg file.
Outlook 2016/2019/2021/365 Outlook 2013
Outlook 2010
One option is to convert the run-a-script to an ItemAdd macro. Depending on the conditions in your rule, converting it to an ItemAdd macro may be as simple as adding the application startup macro, renaming the script, and adding an If statement. For information on using ItemAdd macros, see How to use an ItemAdd Macro.
Just sharing this. You can do very cool things with this!
Execute PowerShell Scripts from Your Smartphone | Dmitry's Blog: Cloud, PowerShell and beyond (wordpress.com)
My organisation doesn't allow to set this in registry.
Is there any other workaround for this?
I want to save an attachment from a mail which I receive daily to a folder on a network drive folder.
Please help!
No, there is no other way if you can't run scripts. Sorry.
any idea why its called EnableUnsafeClientMailRules
What exactly is unsafe about it
It is disabled because it can do things outside of outlook (start application is disabled too). While it is hard to install an outlook macro, there was an exploit that used run application.
Detect and remediate the Outlook rules and custom forms injections attacks. - Office 365 | Microsoft Docs
Thank you for your quick response
How we can do the same thing with Office 365 ?
Thanks in advance
Office 365 desktop software is office 16 - just use the 2-16 keys.
Thank you. This is great!
Changed the registry and it works like you said for Office 2019. Thank you! Wonder why MSFT has not added a default rule of Forward with a Template
They have reply with template - not sure why they didn't think about Forward.
I spoke prematurely. run a script is now there and the script selection dialog shows up but I cannot select a script - the dialog is empty.
Does the macro you want to use with a rule have a name formatted like this - specifically the part in the () ?
public sub macroname(item as mailitem)
hello im trying to find the "HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Security" path on the registry editor, problem is there is no "Security" folder, this version of outlook is newly installed today, could this be the issue? please help if you can this is the only reason i bought outlook!
if the folder does not exist, you need to add it.
I changed the registry value but it is not appearing for me....anything I should add?
You need to restart Outlook after setting the key.