Iowa State University IT

Coping with Spam Using Apple OS X Mail (MAG 345)

1 What is Spam?

Spam is a slang term for unsolicited commercial email. 

2 Why Do I Get Spam?

It's simple; because your email address is widely distributed, it gets put into electronic mailing lists. If you have put your email address on a webpage, used it to post to an online forum or newsgroup, or included it when filling out a form on a commercial website, more than likely your address will wind up in a commercial mailing list. Some Windows viruses are believed to harvest email addresses from the files of the machines they infect and send them to spammers. Besides that, the addresses of staff members at Iowa State University are public records by Iowa law and must be made available to anyone who asks. And yes, unless you specifically tell it not to, the university can sell your student email address to selected mailers.

3 How Can I Make Spam Go Away?

You will probably never be able to completely eliminate spam from your inbox. Even the best of filters will only catch part of the junk mail sent to you. Even if you change your email address, it will only give you a brief respite until your new address is harvested from somewhere on the web. However, there are steps you can take to reduce the amount of spam you receive.

Unsubscribe from groups you are no longer using

Some of the spam you receive probably is not precisely spam. If you signed up for something on a webpage, such as requesting information or downloading or registering a software package you purchased, you may have inadvertently asked them to send you mail — and that is not spam. If you really have subscribed to a newsletter and you no longer want to receive it, unsubscribe from it. Check the text of the message; there is often an unsubscribe link or an email address to send a message to be removed from the list. However, do not try this on unsolicited email messages, since less scrupulous spammers will simply use your unsubscribe request as an indication that your email address is active and send you more spam.

Use an alternative email address in commercial webpages

Instead of using your primary email address to sign in to commercial webpages, establish another account with one of the free providers like Yahoo, Netscape, or Hotmail, and use that address instead. (Yahoo is especially good, as it allows you to create hundreds of unique addresses.) That way, you will keep your spam separate from the real messages. Be polite, though; log in to those accounts periodically and delete the spam.

Use filters in your email client

Most of the email clients you can use to read email give you filters to sort your mail into different mailboxes based on sender, subject, and other criteria. Those filters can be used to make spam go away as well.

To help your mail client in this quest, Iowa State has provided a "spam tagging" system called PerlMX. PerlMX examines all the messages that come to @iastate.edu addresses from outside the university and calculates the probability that the message is spam. That information is placed in a special header that you will not normally see, but which most mail clients use to filter the email into spam and non-spam categories.

4 Using Filters with Mac OS X Mail

Mac OS X Mail has a Junk Mail filtering option built in that uses Bayesian filtering. It is a "trainable" filter, that is, you tell it which messages are legitimate and which are spam. Gradually it learns your mail mix and after a while, it becomes very accurate. Junk mail messages are filtered into the "Junk" mailbox, and can even be automatically deleted. Or you can open the Junk folder, read messages that have been misfiled, and move them back into the In mailbox. In addition to the built-in junk filters, you can also use custom filters that you create.

4.1 Built-in Junk Mail Feature

4.1.1 Training Mail's Junk Filters

When first installed, Mail has a generic idea of what spam is. It will move messages it believes to be junk into the Junk mailbox. To increase the accuracy of the filters, you must train Mail in what you believe is or is not spam. When you first start using Mail, it will be in Training mode. In that mode, it leaves spam messages in the Inbox, but displays them in the message list in light brown instead of black so you can tell the difference. Your responsibility is to train Mail as to what is spam and what isn't.

To identify a message as spam, highlight the message title in the Inbox message list and click the "Junk" icon in the Inbox window. You may also press <Shift/Command/J> or choose Message -> Mark -> As Junk Mail. You can hold down the Command key and click multiple messages to junk several messages in one operation. If a message isn't junk but Mail says it is, highlight it and click the "Not Junk" button, press <Shift/Command/J>, or choose Message -> Mark -> As Not Junk Mail.

After a few days, Mail will get pretty good at guessing what you think is spam and what isn't. At that point, it's time for Mail to graduate out of Training mode. Choose Preferences from the Mail menu and click the "Junk Mail" icon, then click the button for "Move it to the Junk mailbox (Automatic)". Mail will ask if you would like the spam currently in your Inbox to be moved to the Junk folder; click "Yes" and close the Preferences window. Now the spam will be automatically moved to the Junk mailbox as it comes in.

Periodically, you should check the Junk folder to see if any legitimate messages have been misfiled. If there are, highlight them and click the "Not Junk" button. The messages will be returned to the Inbox and Mail will learn that messages like those are not junk. In addition, the sender of the message will be added to your Previous Recipients list and future messages from that address will not be marked as Junk.

4.1.2 Automatically Deleting Junk Mail

By default, Mail simply sends spam to the Junk mailbox, but doesn't do anything else with it. You can tell Mail to discard this mail automatically after the mail has been there for some time.

  1. Select Mail -> Preferences.
  2. Click the Accounts icon.
  3. Click the Special Mailboxes tab.
  4. Choose a time period under "Erase messages in the junk mailbox when". Choices are:
    Never (the default)
    One day old
    One week old
    One month old
    Quitting Mail (erases messages when you quit Mail)
  5. Close the Preferences window and click "Save" to save the changes.

4.1.3 Adjusting the Whitelist

A whitelist is a list of addresses that you accept mail from, no matter what the mail looks like. Mail uses the Address Book and the Previous Recipients list as a whitelist and accepts mail from any address appearing in either place. It will also accept any mail message in which your full name appears in the To address. To change these settings, do this:

  1. Select Mail -> Preferences.
  2. Click the "Junk Mail" icon.
  3. Click the appropriate check boxes listed below:
    Sender of message is in my Address Book
    Sender of message is in my Previous Recipients
    Message is addressed using my Full Name
  4. Close the Preferences window and click "Save" to save the changes.

4.2 Additional Filters

To file a message you have received into a folder or delete it automatically, do the following:

  1. To create a filter to move a message to a mailbox, that mailbox must already exist. If it does not, select Mailbox -> New and enter a name for the new mailbox.
  2. If the message is in the Junk mailbox, highlight it and select Message -> Not Junk. Return to the In mailbox by selecting Mailbox -> Go to -> In.
  3. In the In mailbox, highlight the message and select Mail -> Preferences.
  4. Click on the "Rules" button, then click "Add Rule".
  5. Under Description, enter a meaningful description for the filter.
  6. Mail will automatically select filtering on the From address, using the address in the highlighted message. The filter can also be based on the To, Any Recipient, or Subject lines (as well as more esoteric criteria). To select something else, click on the arrow button to the right of "From" and choose from the drop-down menu.
  7. If you select "Subject", make sure the subject line doesn't contain any specific information (like a date). Mail normally checks to see if the string given appears in the Subject line; it's not an exact match, so edit out anything that won't appear again.
  8. Under "Perform the following action" you can select many options including "Move Message", "Delete Message", and "Run Applescript". Choose "Move Message" to transfer the message to a new mailbox.
  9. If you selected "Move Message", choose the mailbox to which to move the message from the "No mailbox selected" menu at the right.
  10. Click OK.

4.3 Using PerlMX Headers Explicitly

Iowa State has provided a "spam tagging" system called PerlMX. PerlMX examines all the messages that come to @iastate.edu addresses from outside the university and calculates the probability that the message is spam. That information is placed in a special header that you will not normally see, but which most mail clients use to filter the email into spam and non-spam categories.

While Mail's junk mail filtering is pretty good, some people prefer to use the PerlMX scores directly like this:

  1. Select Mail -> Preferences.
  2. Click the Rules icon, then click Add Rule.
  3. Under Description, enter "ISU PerlMX".
  4. Click the "From" button and select "Edit Header List".
  5. Under Header enter "X-PerlMX-Spam".
  6. Click "Add Header", and then click "OK".
  7. Click the "From" button again and choose "X-PerlMX-Spam".
  8. In the field to the right of "Contains", enter "Gauge=XXXXX". This will filter on a PerlMX score of 50% (one X for each 10 percent); add or subtract letters as appropriate.
  9. Under "Perform the following actions:" choose "Move Message" in the left menu and "Junk" in the right menu.
  10. Click OK.

If you feel you need more granularity than every 10 percent, you'll need to create filters for the next 10 percent up and for each of the gauges below that percentage. Suppose you'd like to set the threshold at 47%. You'll need separate filters for the X-Perlmx-Spam header containing "Gauge=XXXXX", "Gauge=XXXXIIIIIIIII", "Gauge=XXXXIIIIIIII", and "Gauge=XXXXIIIIIII". Since the PerlMX headers are not an exact science anyway, this may be more effort than it's worth.

5 Assistance

For more assistance, contact the Solution Center by phone at 515.294.4000, on the web at http://www.it.iastate.edu/help/, by email at solution@iastate.edu, or in person at 195 Durham Center.