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"}


Comments

  1. Dquote says:

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

  2. thijs says:

    Thanks for sharing

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

  4. Frank says:

    thanks for this, works great.

  5. Mike says:

    Thanks for posting this. Solved our problem.

  6. KC Freels says:

    Thanks, exactly what I needed.

  7. Jeremy Alexander says:

    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. Doug says:

    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.

    1. danisrael says:

      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 says:

    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 says:

    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. H says:

    It is possible to add exceptions in the GUI.

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

    1. danisrael says:

      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 says:

    Thanks, worked for us…