Ensure that spam is routed to each user's Junk Email folder

Exchange Online

Applies to: Exchange Online Protection

Topic Last Modified: 2016-07-15

Important:

This topic only applies to Exchange Online Protection (EOP) customers who host mailboxes on-premises in a hybrid deployment. Exchange Online customers whose mailboxes are fully-hosted in Office 365 do not need to run these commands.

The default anti-spam action for EOP customers is to move spam messages to the recipients’ Junk Email folder. In order for this action to work with on-premises mailboxes, you must configure Exchange Transport rules on your on-premises Edge or Hub servers to detect spam headers added by EOP. These Transport rules set the spam confidence level (SCL) used by the SclJunkThreshold property of the Set-OrganizationConfig cmdlet to move spam into the Junk Email folder of each mailbox.

To add transport rules to ensure spam is moved to the Junk Email folder by using Windows PowerShell

Access the Exchange Management Shell for your on-premises Exchange server. To learn how to open the Exchange Management Shell in your on-premises Exchange organization, see Open the Shell.

Run the following command to route content-filtered spam messages to the Junk Email folder:

Where NameForRule is the name for the new rule, for example, JunkMailInSenderBlockList.

If you do not want to use the Move message to Junk Email folder action, you can choose another action in your content filter policies in the Exchange admin center. For more information, see Configure your spam filter policies. For more information about these fields in the message header, see Anti-spam message headers.