Share via

How do I import a list of blocked Sender to Outlook server?

John Noble 0 Reputation points
2026-04-25T15:50:39.1266667+00:00

Office 365, W11 with all updates.

I exported a .txt file of blocked senders from Outlook Classic. I'd like to import that file to Outlook on the web so those emails are blocked at the server. Any step by step list to follow on how to make it happen? Nothing in Outlook Help speaks to it. Thanks in advance,

Outlook | Web | Outlook on the web for business | Settings
0 comments No comments

2 answers

Sort by: Most helpful
  1. John Noble 0 Reputation points
    2026-04-25T19:48:03.2233333+00:00

    Thanks. Seems a worthy tool (uploading a Block list) that Outlook (all versions) should incorporate. That and when manually Blocking, offer a choice of Server or Client.

    At my age, I'm not inclined trying to be a "coder" with my luck, I'd break the damn thing.


  2. Kai-L 12,845 Reputation points Microsoft External Staff Moderator
    2026-04-25T17:36:12.69+00:00

    Dear @John Noble,

    Good day, and I appreciate the detailed description of your issue. From my research, there is no direct "Import" button in Outlook on the web (or in the new Outlook) to upload a .txt file of blocked senders. The Blocked Senders list you exported from Classic Outlook is stored per mailbox (client-side + synced to the server).

    That said, there are two practical ways to achieve what you’re trying to do:

    Option 1. Quickest for a small list (Manual or Semi-Manual)

    1. Open Outlook on the web (outlook.office.com).
    2. Click the gear icon (Settings)
    3. Go to Mail > Junk email.
    4. Under Blocked senders and domains, click Add.
    5. Paste or type the addresses/domains one by one (or comma-separated in some cases).
    6. Click Save.

    This is fine if your list is small (under 50–100 entries). For hundreds of entries, it becomes tedious.

     

    Option 2. Best for larger lists - Use PowerShell

    Since you want the blocks to apply at the server level (so they work everywhere, including Outlook on the web and mobile), the most efficient way is to use Exchange Online PowerShell. Steps:

    1.Connect to Exchange Online PowerShell

    Install-Module -Name ExchangeOnlineManagement   # (only once) 
    Connect-ExchangeOnline
    

    (Sign in with your Global Admin or Exchange Admin account.)

    2.Import the List (for one specific user)

    Assuming your .txt file has one email address or domain per line:

    $blockedList = Get-Content -Path "C:\Temp\BlockedSenders.txt"
     
    foreach ($entry in $blockedList) {
        if ($entry.Trim() -ne "") {
            Set-MailboxJunkEmailConfiguration -Identity "******@yourdomain.com" `
                -BlockedSendersAndDomains @{Add = $entry.Trim()}
    

    Replace:

    • "C:\Temp\BlockedSenders.txt" > your actual file path
    • "******@yourdomain.com" > the mailbox you want to update

    3.Verify the Import

    Get-MailboxJunkEmailConfiguration -Identity "******@yourdomain.com" |
    Select-Object -ExpandProperty BlockedSendersAndDomains
    

    This will show you the full list of blocked senders/domains.

    Optional:
    If you want these senders blocked for all users in the organization (recommended for spam), use the Tenant Allow/Block List. You can do this in the Microsoft 365 Defender portal.

    Go to security.microsoft.com, search for Threat policies > Tenant Allow/Block Lists > Add.

    I hope this information is helpful. Please follow these steps and let me know if it works for you. If not, we can work together to resolve this. Thank you for your patience and understanding. If you have any questions or need further assistance, please feel free to share them in the comments so I can continue to support you. I'm looking forward to your reply.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.