Ensure that spam is routed to each user's Junk Email folder
Applies to: Exchange Online Protection
Topic Last Modified: 2016-07-14
|This topic only applies to Exchange Online Protection (EOP) customers. Exchange Online customers 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 two Exchange Transport rules on your on-premises Edge or Hub servers to detect spam headers added by EOP. These Transport rules will set the SCL used by the SclJunkThreshold property (of the Set-OrganizationConfig cmdlet) to move spam into the Junk Email folder of each mailbox. To add these transport rules, you must run the following cmdlets.
Access the Exchange Management Shell for your on-premises Exchange server. For information about accessing and using the Exchange Management Shell with Exchange 2013, see Using PowerShell with Exchange 2013 (Exchange Management Shell).
Run the following command to route content-filtered spam messages to the Junk Email folder:
New-TransportRule "NameForRule" -HeaderContainsMessageHeader "X-Forefront-Antispam-Report" -HeaderContainsWords "SFV:SPM" -SetSCL 6
Run the following command to route messages marked as spam prior to reaching the content filter to the Junk Email folder:
New-TransportRule "NameForRule" -HeaderContainsMessageHeader "X-Forefront-Antispam-Report" -HeaderContainsWords "SFV:SKS" -SetSCL 6
If you do not want to use the Move message to Junk Email folder action, you may choose another action via your content filter policies in the Exchange admin center. For more information, see Configure your spam filter policies.