Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Exchange / How to Blacklist/Block Sender Domain or an Email Address on Exchange?

June 3, 2019 ExchangePowerShell

How to Blacklist/Block Sender Domain or an Email Address on Exchange?

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 (in addition to the RBL Exchange filters we considered earlier), 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).

Contents:
  • Sender Filtering Agent in Exchange
  • Blocking Emails with the Exchange Transport Rules
  • How to Block a Sender in Exchange Mailbox?

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 info@emailing.com,admin@bad-domain.org

You can block all senders from certain domains:

Set-SenderFilterConfig -BlockedDomainsAndSubdomains spammers.com,masssend.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@contoso.com"}

Or

Set-SenderFilterConfig -BlockedDomainsAndSubdomains @{Add="block_me.net","spammers.com","fb.com"}

To remove the specific email addresses from the Exchange blacklist, run these commands:

Set-SenderFilterConfig -BlockedSenders @{Remove="spam_user@contoso.com","some@gmail.com"}

This will remove only the addresses you have specified but not the whole list.

Or:

Set-SenderFilterConfig –BlockedDomainsAndSubdomains @{Remove="block_me.net","spammers.com"}

Tip. You can also block a whole IP subnet or a specific IP address:

Add-IPBlockListEntry -IPAddress 232.4.2.0

Blocking Emails with the Exchange Transport Rules

An Exchange administrator can block emails from a certain senders or domains using Exchange transport rules. You can create them in ECP. Open the Exchange Admin Center and select Mail flow.

exchange admin center mail flow

Create a new rule. Add the condition The sender -> is the person or domain is and specify the sender email addresses or domains to be blocked.

configuring blocking sender domain rule in exchange

If you want to block all external emails, select the option that The sender is located… -> Outside the organization. Click More options.

transport rule for sender outside the organization
Then add the action (Add Action) -> Block the message. You can block an email and send an explanation to the sender (Reject the message and include an explanation) or NDR with the error code or delete the email message without sending any notification.

exchange transport rule - Reject the message and include an explanation

Specify the rule priority and save it.

You can also create a transport rule using PowerShell:

New-TransportRule -Name 'Block Spammers' -Comments 'Rule to block spammers' -Priority '0' -Enabled -FromAddressContainsWords 'info@badcontoso.com' -DeleteMessage $true

How to Block a Sender in Exchange Mailbox?

You can block senders for the mailbox of the specific user instead of the whole Exchange organization. The list of trusted and blocked users can be set in OWA (Options -> block or allow). To block an email address, just add these addresses or domains to the Blocked Senders list and save the changes.

owa - blocked senders

The same can be done in Outlook. In the Outlook 2016 go to the Home tab, click the Junk drop-down list and select Junk E-mail Options.

outlook 2016 configure junk emals sender list

On the Blocked Senders tab, add the email addresses or domains you don’t want to receive emails from to the list.

outlook blocked senders

An Exchange administrator can manage the list of blocked domains and email addresses of a certain mailbox using PowerShell:

Get-MailboxJunkEmailConfiguration –Identity jrobinson | FL BlockedSendersandDomains

You can add a new sender address to the Junk list:

Set-MailboxJunkEmailConfiguration -Identity jrobinson –BlockedSendersandDomains @{Add="spam_user@contoso.com"}

Or you can remove the specific email address from the list of blocked senders:

Set-MailboxJunkEmailConfiguration -Identity jrobinson –BlockedSendersandDomains @{Remove="spam_user@contoso.com"}

In the same way, you can manage the sender whitelist in Exchange.

0 comment
0
Facebook Twitter Google + Pinterest
previous post
How to Install and Configure SMTP Server on Windows Server 2016/2012 R2?
next post
Remote Desktop HTML5 Web Client on Windows Server 2016 RDS

Related Reading

Checking Windows Activation Status on Active Directory Computers

June 27, 2022

Configuring Multiple VLAN Interfaces on Windows

June 24, 2022

How to Disable or Enable USB Drives in...

June 24, 2022

FAQ: Licensing Microsoft Exchange Server 2019/2016

June 14, 2022

How to Approve and Deploy Updates in WSUS?

June 14, 2022

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows 7
  • Windows Server 2019
  • Windows Server 2016
  • Windows Server 2012 R2
  • PowerShell
  • VMWare
  • Hyper-V
  • MS Office

Recent Posts

  • How to Deploy Windows 10 (11) with PXE Network Boot?

    June 27, 2022
  • Checking Windows Activation Status on Active Directory Computers

    June 27, 2022
  • Configuring Multiple VLAN Interfaces on Windows

    June 24, 2022
  • How to Disable or Enable USB Drives in Windows using Group Policy?

    June 24, 2022
  • Adding Domain Users to the Local Administrators Group in Windows

    June 23, 2022
  • Viewing a Remote User’s Desktop Session with Shadow Mode in Windows

    June 23, 2022
  • How to Create a Wi-Fi Hotspot on your Windows PC?

    June 23, 2022
  • Configuring SSH Public Key Authentication on Windows

    June 15, 2022
  • How to Run a Program as a Different User (RunAs) in Windows?

    June 15, 2022
  • FAQ: Licensing Microsoft Exchange Server 2019/2016

    June 14, 2022

Follow us

woshub.com

ad

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Configuring Anti-Spam Protection on Exchange 2013, 2016 – RBL Providers
  • New-MailboxRepairRequest: Fixing Corrupted Mailboxes in Exchange 2016/2013/2010
  • How to Configure DKIM on Exchange Server 2010/2013
  • Outlook 2016: Manual Setup Exchange Account
  • Get-MessageTrackingLog: Search Message Tracking Logs on Exchange Server
  • How to Import and Export Mailbox to PST in Exchange 2016/2013/2010?
  • Managing Exchange Mailbox Inbox Rules with PowerShell
Footer Logo

@2014 - 2018 - Windows OS Hub. All about operating systems for sysadmins


Back To Top