Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Spam of all colors via Mail and SpamAssassin Internet
For about a year, I just used Apple Mail's junk filtering to get rid of spam. However, when I'm on the road I use GPRS service on my cell phone to download mail, and it's really annoying to have to download spam at 38k4 or slower (and pay for the privilege!) just so it can be thrown away. So now in addition to the built in junk mail filtering, I also use Spamassassin on the server to move the messages to my junk folder without having to download them first.

Unlike Mail, Spamassassin assigns a spamminess value to each message. I decided to turn these values into colors, in order to be able to peruse my junk folder for false positives more easily. It works like this.

Open the Preferences in the Mail application, and select Rules. Then, add rules that look for the X-Spam-Level header. This header isn't in the default list, so you'll have to add it first using "Edit header list...". Select "Begins with" and then add a number of *'s. I use five for my first rule. Then under actions, choose "Set color" "of background" to something that indicates a low level of spamminess, such as yellow. Then add additional lines with more asterisks and more severe colors. I use orange for ten asterisks and red for fifteen. Make sure that the rules that match more *'s come later in the rule list.

The result is that anything that probably isn't spam doesn't receive a special background color. Anything with a score of five or higher is highlighted in yellow. Most false positives are in this category, so I open the message if there is any doubt whether the message may be legitimate. A score of 10 or higher means orange highlighting, and 15 or higher red. There are very few false positives (legitimate messages flagged as spam) in these categories, so I just look at the subject and sender and only when I'm pretty sure it's a legitimate message I open it. No benefit of the doubt in these categories.

Note that Mail will also sort messages based on color (under View, Sort by). This makes scanning the junk mail folder for false positives even easier.

  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)

Spam of all colors via Mail and SpamAssassin | 5 comments | Create New Account
Click here to return to the 'Spam of all colors via Mail and SpamAssassin' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Spam of all colors via Mail and SpamAssassin
Authored by: MattHaffner on Aug 18, '04 11:50:24AM

Great hint!

One problem I'm finding though is that I can't edit a rule that has X-Spam-Level as a criteria. Neither double-clicking or clicking on the Edit button has any affect.

Is this a real Mail bug? I'm using 10.3.5 (Mail 1.3.9 v 619).

[ Reply to This | # ]
Spam of all colors via Mail and SpamAssassin
Authored by: alani on Aug 18, '04 02:19:34PM

Hmmm, you started out talking about your cell phone, but you only got as far as explaining how to filter in

The hard part for most people is going to be getting SpamAssassin running with their IMAP/POP servers.

If they get past that hump, then they can use server-based filtering (e.g., Procmail) to put anything SpamAssassin tags as spam into a location other than their inboxes -- assuming the cell phone is only downloading the inboxes.

Anyway, it's a longer discussion, but I thought I'd post the concept. There's a bunch of postings in the Apple discussion boards. Look under the Unix section and search for fetchmail, procmail, and spamassassin.

[ Reply to This | # ]
Spam of all colors via Mail and SpamAssassin
Authored by: iljitsch on Aug 19, '04 01:25:47PM

MattHafner: strange, I have no problems. Maybe it's something else? (The name or something.)

alani: I didn't find setting up SpamAssasin with my vanilla FreeBSD imapd all that complicated. (Although it took me a while to realize that "ham" means non-spam. At first I thought it was a special type of spam.) And I gather that more and more ISPs run SpamAssassin or something similar for their customers.

And if you're interested in procmail you're going to love my next hint. :-)

[ Reply to This | # ]
More Spam Headers
Authored by: jprickitt on Aug 20, '04 10:30:00AM

I looked through the long Headers (shift-command-L) and saw other headers like X-Spam-Status, X-Spam-Flag, and X-Spam-Report. You could experiment with these in the same way.

X-Spam-Flag looks like a good one to use, because the value was clear: YES. Easy to match. X-Spam-Status looked possible to use. The value contained "hits=" and a number with a decimal after it. I figure I can set the low level rule to look for "hits=2" or "hits=3" or "hits=4" etc.

X-Spam-Report had interesting info, showing exactly which rules it matched and what scores it was given based on that. Example: 0.2 BODY: A WHOLE LINE OF YELLING DETECTED Maybe there's a way to use this info.

By the way, I didn't see the headers the poster mentioned. Maybe a different version of SpamAssassin? Mine shows 2.43

[ Reply to This | # ]
More Spam Headers
Authored by: sjk on Aug 20, '04 01:10:30PM
2.43 was released in October 2002; grab a newer version from the Apache SpamAssassin Project website.

[ Reply to This | # ]