I'm looking to create a Rule in Outlook 365 that will automatically move any signed or encrypted emails received in my primary Inbox folder to another folder (Inbox-Enc is the destination folder that I created).

I can't seem to find the proper criteria to set as part of the Rule creation process (either via the Rules Templates Microsoft offers or via building a Rule from scratch), and was wondering if anyone else had accomplished this, either through a Rule creation or via some other method that works. Thanks!


You need to filter on Message Class. More specifically, the ones that interest you are:

enter image description here

The rule should then check for a Message Class string that contains "IPM.Note.SMIME".

But there is one problem : Outlook rules do not have such a condition.

The solution is to create a rule that is based on a VBA macro.
A model macro (that I never tested) is as follows:

Sub filter(Item As Outlook.MailItem)
    On Error Resume Next
    If InStr(1, UCase(Item.MessageClass), "IPM.NOTE.SMIME") <> 0 Then
        Set Folders = Session.GetDefaultFolder(olFolderInbox).Folders
        Set Folder = Folders.Item("folder-name")
        Item.Move Folder
    End If
End Sub

For more information see the post How to filter Outlook email using a Rule with a VBA script?

  • Thanks for this info @harrymc. In working through the process of implementing it, I have discovered that the security settings in my Outlook client don't allow the Action option "Run a script". I have found the registry key to modify to enable this, but I need to determine first if applying this change is even possible with the GPOs in my organization. Just wanted to acknowledge your answer and while I believe it will work, I'll get back after I get the policy question(s) answered. Thanks again! – Jason A Nov 29 '19 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.