Ensure that Spam is Routed to Each User's Junk Email Folder
Applies to: Exchange Online Protection
Topic Last Modified: 2013-11-20
|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 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.
|These steps assume that the SclJunkThreshold property (of the Set-OrganizationConfig cmdlet) has a value of 4. If this value is changed to a value above 6, such as 7 or 8, the SetScl value in the following cmdlets must be set to 9. For more information about how different SCL ratings are interpreted by the service, see Spam Confidence Levels.|
Access the Exchange Management Shell for your on-premises Exchange server. For information about accessing and using the Shell with Exchange 2013, see 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 Content Filter Policies.