Intelligent Message Filter, Content Filter, can do more...

WinDeveloper IMF Tune
WinDeveloper IMF Tune
  • Home
  • Anti-Spam
  • Exchange 2003, 2007, 2010, 2013 Junk Email Folder

Exchange 2003, 2007, 2010, 2013 Junk Email Folder

Alexander Zammit

Alexander Zammit Photo

Alexander Zammit has been developing server applications for over 15 years. Most of his works involve Exchange integrated applications, including a FAX server, a mail security product and anti-spam products.

Cast your Vote
Poor Excellent

Starting from the Exchange 2003 Intelligent Message Filter, an annoying problem with managing the Junk Folder enablement switch surfaced. The Exchange 2007 Content Filter inherited the same problem. Finally after many years, Exchange 2010 gave this story a happy ending!

Updated 6th February 2013 to include Exchange 2013

Way back in 2005, the year when ExchangeInbox.com was started, I dedicated 3 articles discussing the anti-spam functionality provided in Exchange 2003.

Bringing Together the Exchange Anti-SPAM Cocktail

Enabling/Disabling the Junk Email Folder

Centralizing Junk Email Folder Administration

At the time I was encountering 10s of support problems most of which could be resolved with a better understanding of how the Exchange 2003 filtering worked. The most common problems revolved around the fact that the Exchange 2003 Intelligent Message Filter (IMF) and the Outlook client side filter were independent of each other.

To compound the confusion, there existed two switches for enabling the Junk Folder functionality. One enabled the Outlook client side filter move-to-Junk and the other enabled the server side (based on IMF SCL ratings) move-to-Junk operation.

The two switches have been inherited by subsequent Exchange 2007, 2010 and 2013 releases. Indeed the situation did not change much, except for one important detail i.e. the introduction of new cmdlets in Exchange 2010 that address the biggest pain point.

Note: These cmdlets are also included in Exchange 2013.

Junk Folder Enablement

Before moving further let make sure everyone understands what we are talking about. Asking you to read 3 articles is a little too much, however you should at least understand the issues discussed in Enabling/Disabling the Junk Email Folder. The points made for Exchange 2003, are also true for Exchange 2007, 2010 and 2013.

The most challenging aspect is the fact that the Junk Folder enablement switch is per mailbox. This automatically leads to the key question: How do I centrally enable/disable the Junk Folder for all mailboxes?

Since we are dealing with two filters this question has to be answered twice, once for each of:

  • Outlook client-side junk filter
  • Exchange server-side IMF/Content Filter

The solution for the Outlook client side junk filter was and continues to be very simple, use Group Policy. The tricky part has always been the enablement/disablement of the server side filter Junk Folder functionality. Indeed neither Exchange 2003 nor Exchange 2007 provided an out-of-the-box solution for managing this setting centrally. The options were to either log onto the mailboxes manually and set/clear the checkbox or get hold of some script that would do this operation for us in batch.

As for Exchange 2003 we answered these questions in Centralizing Junk Email Folder Administration.

Here are the scripts for Exchange 2003:

Glen's Exchange Dev Blog - Setting Outlook 2003 Junk Email Options Programmatically

Evan Dodds - IMF and the Junk E-mail folder in Outlook

...and Exchange 2007:

Glen's Exchange Dev Blog - Turning on Filter Junk Email in Exchange 2007 via an OWA Script

Exchange 2010/2013 MailboxJunkEmailConfiguration

As from Exchange 2010 this void was filled with the MailboxJunkEmailConfiguration cmdlets.

Turing on the Junk Folder for the User1 mailbox is simply a matter of entering this cmdlet at the Exchange Management Shell:
Set-MailboxJunkEmailConfiguration -Identity User1 -Enabled $true

...to disable it:
Set-MailboxJunkEmailConfiguration -Identity User1 -Enabled $false

And to enable it for all users in the specified Mailbox Database:
Get-Mailbox -Database <Mailbox Database Name> | Set-MailboxJunkEmailConfiguration -Enabled $true

Of course you can also use the Get-MailboxJunkEmailConfiguration to read the current settings.

Apart for managing the enablement switch, using these cmdlets we can also manage other per mailbox anti-spam settings such as the list of blocked and trusted senders. However I leave these for you to discover.

What about Set-OWAVirtualDirectory?

Before concluding it is worth mentioning another cmdlet, the Set-OWAVirtualDirectory. This was introduced in Exchange 2007 and many thought that its JunkEmailEnabled parameter could be used to control the Junk Folder enablement status. Unfortunately this was not the case. This cmdlet only controls the visibility of the Junk Email settings in OWA but does not change the actual settings.

Final Tips

Those of you who did not experience the pain of managing the Junk Folder enablement switch in Exchange 2003 and Exchange 2007 cannot fully appreciate why these new cmdlets deserved their own dedicated article. Many of us hoped to have this functionality in Exchange 2007. However we had to wait until Exchange 2010 to finally write a happy ending.

References

Bringing Together the Exchange Anti-SPAM Cocktail

Enabling/Disabling the Junk Email Folder

Centralizing Junk Email Folder Administration

Glen's Exchange Dev Blog - Setting Outlook 2003 Junk Email Options Programmatically

Evan Dodds - IMF and the Junk E-mail folder in Outlook

Glen's Exchange Dev Blog - Turning on Filter Junk Email in Exchange 2007 via an OWA Script

Exchange anti-spam myths revealed

Set-MailboxJunkEmailConfiguration

Get-MailboxJunkEmailConfiguration

User Comments - Page 1 of 1

Add New Comment...

LG Jr 10 Nov 2011 11:25
I want to know if there is a way that the Junk Email folder does not show at all when a user opens up their Outlook 2010?? I know how to disable the filtering portion but can we make that folder completely disappear?
Alexander Zammit 27 Oct 2011 23:05
Have you also disabled the Outlook client side filter (through GPO)?
Doesn't Work 27 Oct 2011 17:49
Doesn't Work:

Enabled : False
TrustedListsOnly : False
ContactsTrusted : False

Yet I still get crap in the Junk Email folder. All my users do.
error 6 Apr 2011 12:33
If a user already has addresses on the allowed list, you will get the error:

You can't add an e-mail address that belongs to your organization to the rule.
CategoryInfo: NotSpecified: (0:Int32)
[Set-MailboxJunkEmailConfiguration], DataSourceOperationException
FullyQualifiedErrorId : D19FC1E8,Microsoft.Exchange.Management.StoreTasks.SetMailboxJunkEmailConfiguration


To get around this, run this command:
Set-MailboxJunkEmailConfiguration -Identity "User Name" -TrustedSendersAndDomains @() -Enabled $False

For your entire mail server, the command is:
Get-Mailbox | Set-MailboxJunkEmailConfiguration -TrustedSendersAndDomains @() -Enabled $False

Alexander Zammit 10 Jan 2011 15:34
Please note that Glen has an important update to the Exchange 2007 OWA Junk Enablement Script here:

http://gsexdev.blogspot.com/2010/10/making-owa-canarys-sing-using-cookies.html
John Browne 1 Oct 2010 05:28
Hi,

I'm getting this error when i run it. Any Ideas?

You can't add an e-mail address that belongs to your organization to the rule.
CategoryInfo: NotSpecified: (0:Int32)
[Set-MailboxJunkEmailConfiguration], DataSourceOperationException
FullyQualifiedErrorId : D19FC1E8,Microsoft.Exchange.Management.StoreTasks.SetMailboxJunkEmailConfiguration

Superb thread just what i was looking for.

cheers
Alexander Zammit 9 Sep 2010 12:36
The Junk threshold is not available from the Console.

You have to use the shell cmdlet:
Set-OrganizationConfig

For details check video:
http://www.exchangeinbox.com/article.aspx?i=135

It was produced for Exchange 2007 but it is also valid for Ex2010.

Another relevant article is this one:
http://www.exchangeinbox.com/article.aspx?i=104

Dave 9 Sep 2010 10:33
Even though to content filter explicitly says "Reject" There seems to be no option for "move to spam"...
Dave 9 Sep 2010 10:32
So essentially if you enable the content filter in exchange 2007/2010 and enable junk mail filtering in a user's OWA account then mail above the set SCL level will go to their junk mail folder?
zauzza 15 Apr 2010 09:17
thank u very much reallyyy
Alexander Zammit 15 Apr 2010 09:15
For Exchane 2007 there is no out-of-the-box solution. The best way to avoid logon to each mailbox is to use the script.
zauzza 15 Apr 2010 09:08
dear Alexander,

From what I understood here is that there is no way to enable junk email filtering in OWA from within Exchange 2007 and that each user has to log in and change it manually.wright???
because my boss is convinced that there is some way to do so for all users from within exchange 2007.
please reply me asap
thanks in advance
Copyright © 2005 - 2014 All rights reserved. ExchangeInbox.com is not affiliated with Microsoft Corporation