WinDeveloper O365 Mailer FREE for 1 Year

WinDeveloper IMF Tune
WinDeveloper IMF Tune

Automatic Junk E-mail Folder Cleanup

Alexander Zammit

Alexander Zammit Photo

A Software Development Consultant with over 20 years of experience. Many of his projects involved Exchange integrated applications, including a FAX server, a mail security product and anti-spam products.

  • Published: Nov 23, 2005
  • Category: Anti-Spam
  • Votes: 5.0 out of 5 - 10 Votes
Cast your Vote
Poor Excellent

The Junk E-mail folder is a great spam filtering tool. Unfortunately many users forget emptying it, enabling spam to waste valuable storage space. Luckily automatic Junk E-mail cleanup is available, ready to be enabled.

A few months ago, in the article What's in the Junk Email Folder?, I evangelized the importance of Junk E-mail verification and warned against deleting spam blindly. No matter what marketing may try to make you believe, no spam filter can truly guarantee zero false positives. This was the basic line of thought behind that article.

Today I look at the same issue from a different perspective. E-mails sitting in the Junk E-mail folder, after a few weeks quickly become as good as deleted. It is not uncommon to find organizations where a good chunk of the mailbox storage quota is eaten up by spam. Effective Junk E-mail cleanup helps minimizing this waste. So whether or not spam is being verified, the Junk E-mail folder should be emptied regularly.

The Exchange Mailbox Manager is the right tool for us to setup automatic Junk E-mail cleanup. A lot of documentation covering the Mailbox Manager (see references) is already available. Thus today I will focus on configuring this specifically for Junk E-mail cleanup.

First, we start by setting up a Mailbox Manager recipient policy as follows:

  1. From the Exchange System Manager browse to:
    <Organization> | Recipients | Recipient Policies

  2. Right-Click the Recipient Policies Node and select:
    New | Recipient Policy

  3. In the New Policy dialog that opens, set the 'Mailbox Manager Settings' checkbox and click OK

    New Policy

  4. The property sheet for the new policy opens. On the General page, enter the policy display name 'Junk E-mail Cleanup'

    Policy General Property Page

  5. Next click on the Modify button.

  6. The dialog that opens enables us to identify the user mailboxes to which the policy is to be applied. In this example we will cleanup all user mailboxes. Thus the 'Find Exchange Recipients' dialog is configured as follows:

    • At the top, set the combo-box to Find Exchange Recipients

    • On the General page set the check-box for 'Users with Exchange mailbox' and clear all other checkboxes.

      Find Exchange Recipients

    • On the Storage page we select 'Mailboxes on any server'. Alternatively from here we could also choose mailboxes located on a specific server or within a specific store.

      Mailbox Storage

    • On the Advanced page we could specify more conditions to further identify a specific set of user mailboxes. In this example we will keep things simple and won't configure any further conditions.

    • Once ready click on the Find Now button. This will fetch the resulting set of users identified by these settings.

  7. Click OK to close the 'Find Exchange Recipients' dialog. The General property page will now show the LDAP query just constructed.

  8. Next Select the Mailbox Manager Settings (Policy) page.

    Mailbox Manager Settings Page

  9. From the combo-box at the top, select the type of operation to be performed on executing the policy. Here we select Delete Immediately. Other operations such as 'Generate report only' may also be useful especially for testing.

  10. Next we identify the mailbox folder to be processed i.e. the Junk E-mail folder. This is not included in the standard list. Thus we click on the Add button to create an entry for it.

  1. The Folder Retention Settings dialog opens, configure this as follows:

    Folder Retention Settings

    • Folder: Junk E-mail

    • Select the Age Limit checkbox and set the days to: 30

    • Clear the Message Size checkbox

    With these settings we are simply instructing the Mailbox Manager to clear all spam older than 30 days without any regard to message size. You may want to reduce/increase the retention period as necessary. My idea is that an e-mail, even if legitimate, is of little value if read one month late. Of course here you have to strike a balance.

  2. Click OK to add the Junk E-mail folder settings.

  3. In the list of folders we now simply clear all checkboxes, except for the one just created.

  4. Mailbox users may be kept informed of the policy functionality by enabling the 'Send notification mail to user after processing' checkbox. In this way users may also be reminded to verify the Junk E-mail folder content.

  5. Exclusion of specific message classes is also possible. Still this is not relevant to Junk E-mail folder processing. Thus enabling this option is unnecessary.

  6. Click OK to save the new policy.

At this point you may want to create other Mailbox Manager policies. This is especially useful when different Junk E-mail retention settings are necessary. In this case, keep in mind that a mailbox is only processed by one Mailbox Manager Policy.

Once the policies are configured, the Mailbox Manager must be enabled. This is done through the Exchange server object as follows:

  1. Open the server properties from:
    <Organization> | Servers | <Server Name>

    Server Mailbox Management Enablement

  2. Select the Mailbox Management page.

  3. Specify the processing schedule through the 'Start mailbox management process' combo-box. In this case we go for 'Run Saturday at Midnight'.

  4. Under Reporting we specify 'Send detail report to administrator'

  5. Finally we click on Browse in order to identify the administrator address.

  6. While we are at the server object properties, we may also want to enable event logging. Do this from the Diagnostics Logging page.

    Diagnostic Logging

  7. Select the MSExchangeSA service.

  8. Select Mailbox Management Category.

  9. At the bottom set the logging level as needed.

  10. Click OK to save changes.

If you have multiple mailbox servers you will want to also enable the Mailbox Manager on these servers as well.

That completes the Mailbox Manager configuration. To quickly force the policies to be run, right-click the server object and select 'Start Mailbox Management Process'.

Start Mailbox Management Process


What's in the Junk Email Folder?

How to use recipient policies to control mailboxes in Exchange 2000 and Exchange 2003

User Comments - Page 1 of 1

John 7 Aug 2016 16:39
I need to know how to do this in exchange server 2010.
Alexander Zammit 1 Jul 2011 06:14
Check this:

It was written for Exchange 2007 but I think it is still valid for Exchange 2010
Exchange 2010? 1 Jul 2011 05:46
Any updated version of this for Exchange 2010?
Copyright © 2005 - 2023 All rights reserved. is not affiliated with Microsoft Corporation