UPDATE : A more advance flow is described in this new blog.
I use Microsoft Outlook.com for my private mail for many years now, and over the years I receive more and more spam. In most cases Outlook.com redirects all spam to my Junk folder, which is good. But in some cases Outlook.com also redirects legitimate messages to my Junk folder, and this force me to scan my Junk folder on legitimate messages every few days (default retention policy of Outlook.com let Junk items expire in 10 days).
If I find legitimate/”no-junk” mails between dozens of junk mails in my Junk folder, I can, for example, add the sender to the “Save sender list” so that it will not be forwarded to the Junk folder the next time. But I don’t what to check my Junk folder every few days, what I wanted to realize was to filter the Junk mail (delete mail that contains certain keywords or part of a sentence) and if a mail is legitimate that it will be automatically forwarded to my Inbox folder.
I tried to find an automatic solution for this. During my search and tries I found out the following:
- Outlook.com Rules cannot be applied to the Junk folder, only on the Inbox (but you can run it manually in your Outlook Desktop application and select the Junk folder)
- The Junk mail / Spam filter runs before the Outlook.com Rules
- You cannot disable Junk mail to be forwarding to Junk Folder in Outlook.com
- Some Outlook.com rules created in your Desktop application applies only in the Desktop application itself and not in the webmail interface or on other clients like on your phone. (therefor create rules only in your online webinterface)
I found the solution to realize this in Microsoft Flow / Power Automate. Everyone with a Microsoft Account (Outlook.com / Hotmail.com / Live.com) have access to the free version of it, and you can perfectly use it to apply Mail rules as I will show you below.
Open a browser and navigate to https://flow.microsoft.com. Login with your private Microsoft Account (in my case my @outlook.com account).
If this is the first time you use Microsoft Flow / Power Automate, select your country/region and click Get started
Click My Flows
Click + New and select Automated – From blank
Give your new flow a name, in my case Move Junk to Inbox (with filter). In Choose your flow’s trigger search for Outlook.com and select When a new email arrives (V2). Click Create
If this is the first time you use a flow for your Outlook.com mail, you need to create a connection to Outlook.com first. To do so, click Sign in
Sign in with your Microsoft Account (Outlook.com account).
Once the connection with Outlook.com is created, the Inbox folder is selected. To change the folder, click the Folder icon on the right.
Select Junk Email
Now it’s time to configure an action on this trigger. Click + New step
Click Condition (Control)
First we need to configure the Condition, in this case this will be the “Spam Filter”. Select Choose a value
You can select various types of Dynamic content, for creating this “Spam Filter”, most of the time I use Body or Subject. In this case I will use Body
Then you can select contains and then a value where you receive Junk mail about (see my examples above). You can create multiple conditions, but if you create more that one condition, make sure the Or statement is selected.
Now it’s time to configure an action if the conditions match the criteria. Under If yes, click Add an action.
Search for Outlook.com and select Delete email.
In the Message Id field, select Message Id
Final step is to Add an action if the Condition did not match. Under If no, click Add an action
Search for Outlook.com and select Move email
As Message Id, select Message Id. For the Folder, select Inbox
And that is all you have to do.
You can add up to 10 lines per condition, if you want to add more conditions, you can add a second “condition set” as an action on the If no condition.