Share via


Manage sender filtering

Applies to: Exchange Server 2013

Sender filtering is provided by the Sender Filter agent. The Sender Filter agent relies on the MAIL FROM: SMTP header to determine what action, if any, to take on an inbound email message.

When sender filtering functionality is enabled on an Exchange server, sender filtering functionality filters all messages that come through all Receive connectors on that computer.

What do you need to know before you begin?

  • Estimated time to complete each procedure: 5 minutes

  • You need to be assigned permissions before you can perform this procedure or procedures. To see what permissions you need, see the "Anti-spam features" entry in the Anti-spam and anti-malware permissions topic.

  • You can only use the Shell to perform this procedure.

  • By default, anti-spam features aren't enabled in the Transport service on a Mailbox server. Typically, you only enable the anti-spam features on a Mailbox server if your Exchange organization doesn't do any prior anti-spam filtering before accepting incoming messages. For more information, see Enable anti-spam functionality on Mailbox servers.

  • For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard shortcuts in the Exchange admin center.

Tip

Having problems? Ask for help in the Exchange forums. Visit the forums at Exchange Server.

Use the Shell to enable or disable sender filtering

To disable sender filtering, run the following command:

Set-SenderFilterConfig -Enabled $false

To enable sender filtering, run the following command:

Set-SenderFilterConfig -Enabled $true

Note

When you disable sender filtering, the underlying Sender Filter agent is still enabled. To disable the Sender Filter agent, run the command: Disable-TransportAgent "Sender Filter Agent".

How do you know this worked?

To verify that you have successfully enabled or disabled sender filtering, do the following:

  1. Run the following command:

    Get-SenderFilterConfig | Format-List Enabled
    
  2. Verify the value displayed is the value you configured.

Use the Shell to configure blocked senders and domains

To replace the existing values, run the following command:

Set-SenderFilterConfig -BlockedSenders <sender1,sender2...> -BlockedDomains <domain1,domain2...> -BlockedDomainsAndSubdomains <domain1,domain2...>

This example configures the Sender Filter agent to block messages from kim@contoso.com and john@contoso.com, messages from the fabrikam.com domain, and messages from northwindtraders.com and all its subdomains.

Set-SenderFilterConfig -BlockedSenders kim@contoso.com,john@contoso.com -BlockedDomains fabrikam.com -BlockedDomainsAndSubdomains northwindtraders.com

To add or remove entries without modifying any existing values, run the following command:

Set-SenderFilterConfig -BlockedSenders @{Add="<sender1>","<sender2>"...; Remove="<sender1>","<sender2>"...} -BlockedDomains @{Add="<domain1>","<domain2>"...; Remove="<domain1>","<domain2>"...} -BlockedDomainsAndSubdomains @{Add="<domain1>","<domain2>"...; Remove="<domain1>","<domain2>"...}

This example configures the Sender Filter agent with the following information:

  • Add chris@contoso.com and michelle@contoso.com to the list of existing senders who are blocked.

  • Remove tailspintoys.com from the list of existing sender domains that are blocked.

  • Add blueyonderairlines.com to the list of existing sender domains and subdomains that are blocked.

Set-SenderFilterConfig -BlockedSenders @{Add="chris@contoso.com","michelle@contoso.com"} -BlockedDomains @{Remove="tailspintoys.com"} -BlockedDomainsAndSubdomains @{Add="blueyonderairlines.com"}

How do you know this worked?

To verify that you have successfully configured blocked senders, do the following:

  1. Run the following command:

    Get-SenderFilterConfig | Format-List BlockedSenders,BlockedDomains,BlockedDomainsAndSubdomains
    
  2. Verify the values displayed are the values you configured.

Use the Shell to enable or disable blocking messages with blank senders

To enable or disable blocking message with blank senders, run the following command:

Set-SenderFilterConfig -BlankSenderBlockingenabled <$true | $false>

This example configures the Sender Filter agent to block messages that don't specify a sender in the MAIL FROM: SMTP command:

Set-SenderFilterConfig -BlankSenderBlockingEnabled $true

How do you know this worked?

To verify that you have successfully enabled or disabled blocking messages with blank senders, do the following:

  1. Run the following command:

    Get-SenderFilterConfig | Format-List BlankSenderBlockingEnabled
    
  2. Verify the value displayed is the value you configured.