Previous Next  Up  Table of Contents  SpamSieve Home

5.5.7   Setting Up a Spam Filtering Drone

As described in the Correct All Mistakes section, you need to tell SpamSieve about messages that it misclassified so that it can learn from them. Also, the sooner you correct SpamSieve the better. This presents a problem if you’re going to be away from your Mac for a while, e.g. if you’re on a trip and using your iPhone or Web mail. With the normal setup, you can leave SpamSieve running on your Mac at home, and it will clean the spam out of your inbox, but aside from remote-controlling your Mac there’s no way to train SpamSieve.

The drone setup lets you run SpamSieve on one Mac and train it from other Macs, PCs, or iPhones. This setup requires Apple Mail, and it’s based on a tutorial from MacMerc.

Here’s an outline of how it works:

To setup the spam filtering drone:

  1. Make sure that all the computers are set to connect to your mail account via IMAP, iCloud/MobileMe, or Exchange.

    Note: These instructions assume that you have a single account. If you have multiple accounts, see “Instructions for Multiple Accounts” at the bottom of this section.

  2. This optional step will hopefully keep SpamSieve running if there’s a power failure while you’re away from your drone Mac. Open System Preferences. In the Users & Groups pane, set Mail as a login item for your account. Under Login Options, enable automatic login. In the Energy Saver pane, set it to Restart automatically after a power failure. (This option is not available on all Macs.)

  3. Follow the normal SpamSieve setup procedure in the Setting Up Apple Mail section, with one change: in Step 2, create the new Spam mailbox in your server account instead of in On My Mac.

  4. Create two more mailboxes in your server account: TrainGood and TrainSpam.

  5. Open Script Editor and paste in the following script:

    on perform_mail_action(_info)
        tell application "Mail"
            set _mailbox to mailbox "TrainSpam" of account "AccountName"
            repeat with _message in messages of _mailbox
                set _source to _message's source
                tell application "SpamSieve" to add spam message _source
                set _message's mailbox to mailbox "Spam" of account "AccountName"
            end repeat
        end tell
    end perform_mail_action
    

    Change the two occurrences of AccountName to the name (description) of your mail account. Save the script somewhere on your Mac, and call the file RemoteSpamTraining.scpt.

  6. Go to Mail’s Preferences window and create a new rule at the top of the list called Remote Spam Training. The conditions should say:

    Account AccountName

    The actions should say:

    Run AppleScript […]RemoteSpamTraining.scpt

    Rather than typing the path to the script file, you can click the Choose… button and select the file that you created in Step 5.

  7. Open Script Editor and paste in the following script:

    on perform_mail_action(_info)
        tell application "Mail"
            set _mailbox to mailbox "TrainGood" of account "AccountName"
            repeat with _message in messages of _mailbox
                set _source to _message's source
                tell application "SpamSieve" to add good message _source
                set _message's mailbox to mailbox "INBOX" of account "AccountName"
            end repeat
        end tell
    end perform_mail_action
    

    Change the two occurrences of AccountName to the name (description) of your mail account. Save the script somewhere on your Mac, and call the file RemoteGoodTraining.scpt.

  8. Go to Mail’s Preferences window and create a new rule at the top of the list called Remote Good Training. The conditions should say:

    Account AccountName

    The actions should say:

    Run AppleScript […]RemoteGoodTraining.scpt

    Rather than typing the path to the script file, you can click the Choose… button and select the file that you created in Step 7.

Instructions for Multiple Accounts

If you have more than one mail account, you’ll need to repeat the steps for each account, with the following changes:

In Step 3, create one Spam mailbox for each account. Create one SpamSieve rule per account (called, e.g. SpamSieve AccountA). Set the conditions of the rule so that it only matches messages from that account. Set the action to move the messages to the Spam mailbox for that account.

In Step 4, create two training mailboxes in each account.

In Step 5, create one remote spam training script per account, e.g. RemoteSpamTrainingAccountA.scpt.

In Step 6, choose the particular script for that account.

In Step 7, create one remote good training script per account, e.g. RemoteGoodTrainingAccountA.scpt.

In Step 8, choose the particular script for that account.

Previous Next  Up  Table of Contents  SpamSieve Home