0

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!

1 Answers1

0

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?

harrymc
  • 498,455