SpamMover for MS Exchange 2007

Updated: 1-April-2008



Purpose

This application moves into a predefined folder in the user's mailbox any message that carries an X-header or subject line marking it as spam, as added by such tools as SpamAssasin or GFI Mail Essentials. These marked messages can be forwarded to anither e-mail address or deleted instead of moved. Any amount of rules can be configured.
SpamMover can create a folder named Spam (or whatever you prefer) in each Exchange mailbox automatically. 
The application is an Exchange store event sink.



Benefits

- You can set up SpamMover on per-mailbox basis or as "store-wide" application, i.e. it will work on each user's mailbox in the certain Exchange 2007 mailbox store 

- You do not need to configure Spam rules on each workstation that runs Outlook

- The application is server-centric, so you do not need to install any extra software on the client side 

- Even being deleted by user accidentally, Spam folder will be restored automatically when incoming message is received.



Installation

On your Exchange 2007 Server computer:

1. Create a new mailbox-enabled user account. Mailbox alias must be SMTEST.
You should create this account for test purposes only, so you can delete it after you satisfy yourself with the fact that the application is actually works.
 
2. Create or select another mailbox-enabled user account (let's name it "SMAdmin") that is a member of the Domain Admins and Domain Users security groups. That account must have full permissions on the all mailbox stores. Open Exchange Management Shell and execute
	Get-MailboxDatabase | add-adpermission -user SMAdmin -accessRights GenericAll

3. Log on as SMAdmin to your Exchange 2007 Server computer.

4. Create C:\Program Files\SpamMover2007\ directory.
Download SpamMover2007-Demo.zip archive file to this directory and extract all files.

5. Run C:\Program Files\SpamMover\SpamMover2007Setup.exe. Click Install button in COM+ object frame. Make sure the following rules exist in the Rules list:
#  Condition            Action       Target
1  Subject: [SPAM]      move to      SPAM 
2  X-Spam-Flag: YES     move to      SPAM 

6. In Per-Mailbox registration frame select SMTEST mailbox (see step #1) and mark it. Click  the Change. The list will be refreshed. Make sure that SMTEST is still checked.

7. (Optional, in a cluster environment only.) Modify the cluster name in the Cluster Name frame. Click the Change button.

8. Click the Exit button.



Testing (We are testing the rules described at step #5 of Installation section)

Filtering based on Subject field.

1. Send a message with subject field "[Spam] SMtest" to SMTEST.

2. Using Outlook, open SMTEST mailbox. Make sure Spam folder has been created on the same level as the other main folders like Inbox, Outbox etc. You will see that the message you just sent is placed in the Spam folder.

3. Send a message that DOES NOT contain "[SPAM]" in the subject field to SMTEST.

4. Make sure the message you just sent is placed in the Inbox folder of SMTEST mailbox.

5. When finished, you can delete SMTEST account.

Filtering based on X-header

1. Send a message that contains "X-Spam-Flag: YES" header to SMTEST.

2. Using Outlook, open the SMTEST mailbox. Make sure the Spam folder has been created on the same level as the other main folders like Inbox, Outbox etc. Also make sure the message you just sent is placed in the Spam folder. 

3. Send a message that DOES NOT contain "X-Spam-Flag: YES" header to SMTEST

4. Make sure the message you just sent is placed in the Inbox folder of  SMTEST mailbox.

5. When finished, you can delete the SMTEST account and mailbox.


We have tested SpamMover2007 with Outlook 2003/2007 and Exchange 2007 SP1 on Microsoft Windows Server 2003 R2 Enterprise x64 edition SP2. It can work on Microsoft Windows Server 2008 also.



Comparison Expressions

Let's suppose that your spam software (Symantec Mail Security, for example) adds an X-Header if the SCL (Spam Confidence Level) value of a message is greater than 3 (or whatever you set the value at). The X-Header that is added is this:
   X-SMSMSE-SCL: x 
where x is the SCL value of the message. You need to move to the spam folder any message with an SCL value of 4 or higher. To get this result, place the following in the "Spam header" field:
   X-SMSMSE-SCL: {>3}
This syntax is also acceptable:
   X-SCL:{>4 <11}
   X-CustomHeader:{>3.9 <11.1}
   X-Spam-Status: No, hits={>-4.9}
Note that you can set only one {...} expression per "Spam header" field. 



Wildcards

You can use two wildcard expressions: "{?}" and "{*}" in the "Spam header or IMF SCL score" field.
"{?}" is used to represent a single character and "{*}" represents any number of characters.
Examples:
if you wish to move/forward/delete any message whose Subject line begins with "RE:" or "FW:", you should populate SMTP header and Value fields with the following expressions:
SMTP header        Value
Subject:           {?}{?}:{*}

If you wish to move/forward/delete any message from yahoo.com, you should populate SMTP header and Value fields with the following expressions:
SMTP header        Value
Return-Path:       {*}@yahoo.com{*}




Uninstallation

1. Start C:\Program Files\SpamMover2007\SpamMover2007Setup.exe

2. Uncheck all items in the list in Per-Mailbox registration frame and click the Change button.

3. Uncheck all items in the list in Store-wide registration frame and click the Change button.

4. Click the Uninstall button in COM+ object frame.

5. Press the Exit button.



About this demo version. 

SpamMover demo version works only for mailboxes whose names include "TEST". Examples:
      SpamMover1TEST
      Test2SM
Other mailboxes are unavailable. Also you can not register this demo version for all maiboxes at once (store-wide). The full product version has no limitations. 



Feel free to send me your comments and criticism.

Thank you,

Victor Ivanidze,

IvaSoft
http://www.ivasoft.com
mailto://SpamMover2007@ivasoft.com

