![Exchange Exchange](https://usysadmin.com/wp-content/uploads/2022/01/exchange.jpeg)
Exchange Server allows you to block (reject) emails from the unwanted sender domains or certain email addresses. This allows you to configure extra spam protection, if some spam mail outs are pass through your anti-spam system.
An Exchange administrator can block the delivery of emails sent from the certain external domains or addresses to the user mailboxes using ECP graphical interface or PowerShell (EMS).
Sender Filtering Agent in Exchange
You can enable sender filtering using the Sender Filter agent. Enable the sender filtering agent first:
Set-SenderFilterConfig -Enabled $true
If you need to filter only external senders, run this command:
Set-SenderFilterConfig -ExternalMailEnabled $true
Now you can specify the list of email addresses to be blocked. For example:
Set-SenderFilterConfig -BlockedSenders block@unwanteds.com,reject@spammers.org,trash@garbages.net
You can block all senders from certain domains:
Set-SenderFilterConfig -BlockedDomainsAndSubdomains unwanted.com,spammers.org,garbages.net
To get the list of blocked email addresses, run the command:
Get-SenderFilterConfig |fl BlockedSenders,BlockedDomains,BlockedDomainsAndSubdomains
If you want to add new items to the list of blocked domains/addresses, use:
Set-SenderFilterConfig -BlockedSenders @{Add="spam_user@spammers.org"}
Or
Set-SenderFilterConfig -BlockedDomainsAndSubdomains @{Add="unwanteds.com","spammers.org","garbages.net"}
To remove the specific email addresses from the Exchange blacklist, run these commands:
Set-SenderFilterConfig -BlockedSenders @{Remove="block@unwanteds.com","reject@spammers.org","trash@garbages.net"}
This will remove only the addresses you have specified but not the whole list.
Or:
Set-SenderFilterConfig –BlockedDomainsAndSubdomains @{Remove="unwanteds.com","spammers.org","garbages.net"}
Tip. You can also block a whole IP subnet or a specific IP address:
Add-IPBlockListEntry -IPAddress 1.2.3.4
Be the first to comment