WinDeveloper IMF Tune
WinDeveloper IMF Tune

Exchange 2003, 2007, 2010 Junk Email Folder

Alexander Zammit

Alexander Zammit Photo

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

Cast your Vote
Poor Excellent

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

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 and 2010 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.

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 and Exchange 2010.

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:

  • the Outlook client side junk filter
  • the server side Exchange 2003 IMF/Exchange 2007 Content Filter/Exchange 2010 Content Filter

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

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.

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 MailboxJunkEmailConfiguration

Exchange 2010 finally filled this void with the Get-MailboxJunkEmailConfiguration/Set-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...

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 - 2010 All rights reserved. ExchangeInbox.com is not affiliated with Microsoft Corporation