How to whitelist a domain or email in Exchange 2010

If you have the Edge Transport Role installed on an Exchange 2010, mail may be rejected with the following error:

My.User@domain.com mail.domain.com #<mail.domain.com #5.7.1 smtp; 550 5.7.1 Message rejected as spam by Content Filtering.> #SMTP#

Don’t ask me why Microsoft has buried this feature! From what I can tell, the only way to whitelist in Exchange 2010 is through the Powershell – not the GUI.  Thanks to Chris Caldwell for the fix.

Specific Address
1
2
3
$list = (Get-ContentFilterConfig).BypassedSenders
$list.add("new.mail@address.com")
Set-ContentFilterConfig -BypassedSenders $list
$list = (Get-ContentFilterConfig).BypassedSenders
$list.add("new.mail@address.com")
Set-ContentFilterConfig -BypassedSenders $list
Entire Domain
1
2
3
$list = (Get-ContentFilterConfig).BypassedSenderDomains
$list.add("domain.com")
Set-ContentFilterConfig -BypassedSenderDomains $list
$list = (Get-ContentFilterConfig).BypassedSenderDomains
$list.add("domain.com")
Set-ContentFilterConfig -BypassedSenderDomains $list
 Verify
1
Get-ContentFilterConfig
Get-ContentFilterConfig
Adding or Removing additional domains You can enter several domains/addresses at one time by seperating with a common, as Fredrik notes in the comments below (i.e.  *.domain.com,*.domaina.com,*.domainb.com,*.domainc.com).  However, in certain circumstances you may wish to remove only one item from the entire list.  To do this, use the MULTIVALUED PROPERTY.   Here is an example:
1
Set-ContentFilterConfig -BypassedSenderDomains @{Remove="domain.com"}
Set-ContentFilterConfig -BypassedSenderDomains @{Remove="domain.com"}


14 Comments

  1. Thanks for this, it took me a while to find this one!

  2. thijs

    Thanks for sharing

  3. Thanks for this one. I just couldn’t believe Microsoft left this one out of the GUI.

  4. thanks for this, works great.

  5. Thanks for posting this. Solved our problem.

  6. Thanks, exactly what I needed.

  7. Jeremy Alexander

    Thanks for posting this. Microsoft left a LOT out of the gui on this version of Exchange, but once you can find the command(s) to be entered it all works very reliably.

  8. Is there a way to add more than one domain to the list at a time? I spent a good amount of time adding the domains (without the list function) only to find out it only saved the last domain I entered. Time to start over.

    • danisrael

      Doug, I’m not sure. Try the conventional PowerShell command structure and see. You can always look to see if it takes properly. Sorry don’t have the answer for you.

  9. Fredrik

    Doug,
    The alternative is to comma separate the domains:

    Set-ContentFilterConfig -BypassedSenderDomains *.domain.com,*.domaina.com,*.domainb.com,*.domainc.com

    How do I remove a domain from the filter using ps command?

  10. danisrael

    DougFredrik,

    I amended the post to show the add/remove multivalued command. There is a link to Microsoft’s TechNet for the command…but essentially use:

    Set-ContentFilterConfig -BypassedSenderDomains @{Remove=”domain.com”, “domain2.com”,” domain3.com”}

  11. It is possible to add exceptions in the GUI.

    Organization Configuration -> Hub Transport -> Anti-Spam -> Content Filtering -> Exceptions

    • danisrael

      H, this will add/delete to/from the “BypassedRecipients” collection, but not to the “BypassedSendersDomains.” Is there a way to manipulate it for domains?

  12. Munzhino

    Thanks, worked for us…

Leave a Reply to KC Freels Cancel reply

Your email address will not be published.

Please answer this qeustion: