Thursday, December 07, 2006

How Bayes Spam Filters Work

I just got sent a really nice article on how Bayes spam filters (aka bayesian analysis) work. I've excerpted part of it here, as I think it's quite insightful:

Recognizing spam is not as easy as it might seem. For example, Yahoo! Groups put ads at the end of every e-mail, but if your users subscribe to such a group, they probably want to get the e-mail anyhow. Most users would just as soon discard any e-mail containing the word “Viagra,” but if you’re a pharmaceutical company, that might not be a wise policy. Press releases look a whole lot like spam, but discarding them would be a real problem for a working journalist.

Early spam-fighting products relied largely on keyword filtering to spot dubious messages, on the theory that words like “Viagra” and “FREE Offer” and “unsubscribe” only appeared in spam. There are two problems with this approach. First, unlikely though it may be, such words do appear in legitimate e-mail as well. Second, spammers quickly caught on and started sending mail with creative spellings such as “V1agra” and “FREEE Offer” and “un$ubscribe.”

The spam-fighting landscape changed dramatically in August 2002, when Paul Graham published his article “A Plan for Spam” on the Internet (www.paulgraham.com/spam.html). Graham proposed a method of detecting spam by what’s known as Bayesian statistical analysis. While you should go read the article for details, the basic idea is surprisingly simple. Start with a large corpus of spam and a large corpus of “ham” (good e-mail), say several thousand messages of each. Now count the individual words that appear in each corpus. What you’re looking for is words that tend to appear more often in spam than ham, or vice versa. For example, these days the word “Abacha” in my mail occurs exclusively in spam (of the Nigerian swindle variety), while the word “galleys” turns up only in ham (when my editors want me to review galley proofs). By looking at every word in every message, you can build up an extensive list of words and their probabilities of occurring in spam messages. Some words (like “Abacha” and “galley”) have a very high or very low probability of occurring in spam, while others (like “the” or “home”) are distributed pretty evenly.

When a new message arrives, the Bayesian algorithm compares the words in the message to those already in your corpus, looking for the most interesting (defined as having a high or low probability of occurring in spam) 15 or 20 words. Looking at the probabilities of those individual words, you can come up with a probability that the message containing the words is spam. If that probability is high enough, you can be nearly sure that the message was, in fact, spam.

Soon after Graham published his results, Bayesian spam filters started appearing—first on the client and in POP3 proxies, and then later on the server. Bayesian filters now boast a spam recognition rate of 95 percent or better in many settings. The experimental CRM-114 implementation (crm114.sourceforge.net) refines the Bayesian notion for a recognition rate over 99 percent.

The nice thing about Bayesian filters is that it doesn’t really matter what the spammers do; as long as their mail is different from real mail, the filter will learn to recognize it. Word substitutions, for example, end up working against the spammer; the likelihood that a message containing “V1agra” is spam is nearly 100 percent, and after the first few times that goes by, a good Bayesian filter will automatically stamp messages containing that word as spam.

Friday, December 01, 2006

SpamAssassin Benchmarks - Fighting Spam Faster

I've been working to combat the recent wave of spam we've all been experiencing - waves upon waves of St0ck Reports, and Vlnnagra and Home M0ortgage Appr0vals. In doing so, I've done some benchmarks on SpamAssassin with its various options that some Google searchers might find ineresting:

The following numbers were produced on a test server of mine - a Gateway E-9315R server, 3.0Ghz Xeon, 512MB RAM, 80GB SATA, Fedora Core 3, running Postfix 2, MailScanner, and SpamAssassin.
  • All features turned on: 4.8 messages/min
  • Bayes filtering disabled: 19.1 messages/min
  • SpamAssassin disabled, but RBL still turned on: 74 messages/min
  • RBL+XBL, Pyzor, Razor and DCC disabled in spam.assassin.prefs: 76 messages/min
  • RBL+XBL disabled in MailScanner.conf (line commented out: Spam List = ORDB-RBL SBL+XBL): 320 messages/min
  • RBL+XBL disabled, but SpamAssassin turned back on: 64 messages/min
It's pretty clear that Spamassassin, Bayes and RBL are each pretty serious CPU hogs, but RBL is more network I/O bound than CPU bound.

I'm pretty tired of those spammer bastards cutting my communication lines (a subject most Scientologists feel strongly about, as communication is pretty much the most core element in Scientology), so I'm definitely looking for creative ways to process mail fast, but also more effectively. Comments welcome!

Tuesday, November 28, 2006

Live Spaces - Scientology VM Blog

How about this one:

http://scientology-vm.spaces.live.com/

MSN, or the artist formerly known as Hotmail, is now offering blogs under the "live.com" guise. This one goes over Scientology Volunteer Ministers and what they're doing around the world.

Looks clumsy to deal with, but at least th Volunteer Ministers content is good.

Monday, November 20, 2006

Still lamenting lack of Flockdom

Now that there's Scientology Media all over the place, I have all manner of things to blog about. However, this just makes me all the more peeved that I can't use my newfound Flock to blog with. Blogging is such an integral communications tool these days - it's a lot like the first time I was able to to one-click e-mails so that I didn't have to hassle my way back into Outlook to send an e-mail. Well, now that I'm blogging all the time, I just want to be able to BLOG THIS when I find something of interest, otherwise it's rapidly forgotten in the 12.8 Trillion pages of the Internet. Anyone know of any other good BLOG THIS type tools for Firefox that will work with Blogger beta?

Saturday, November 18, 2006

Tom & Katie - Scientology Wedding: Mission Accomplished

From People Mag:
Tom & Katie Marry! | Tom Cruise, Katie Holmes
It's official: Tom Cruise and Katie Holmes are now husband and wife. The couple exchanged vows Saturday in front of more than 150 guests at the Odescalchi Castle in Lake Bracciano, Italy, their rep, Arnold Robinson, confirms to PEOPLE.

"The wedding was absolutely beautiful," says a guest.

With thousands of fans, photographers and TV cameras watching from afar, Cruise and Holmes were joined by family – Katie's dad Martin walked her down the aisle – and a slew of celeb pals, including Will and Jada Pinkett Smith, Brooke Shields and Chris Henchy, Victoria Beckham, Jennifer Lopez and Marc Anthony, and Jim Carrey and Jenny McCarthy, among others.

The sunset ceremony was performed by a Scientology minister, according to a statement from their reps. The wedding party included Cruise's children, Isabella and Connor, the best man was Cruise's best friend, David Miscavige – the head of the Church of Scientology – and Katie's sister Nancy Blaylock served as the matron of honor.

Friday, November 17, 2006

Slide show of 49 famous Scientologists

Thought this one was nifty:
Back
12 of 49
Next
Scientologist: Beck Hansen, musician


It's a slide show of 49 famous Scientologists.

AMD Quad-Cores

Just found this one on dailytech.com:
core. Beginning in Q3’2007 AMD is expected to release its first Stars quad-core processors. The new quad-core processors are based on AMD’s Agena and Agena FX cores. Targeting AMD’s 4x4 platform is the Agena FXAgena FX will only be available on Socket 1207+ and offer dual processor functionality. The vanilla Agena core will be available on single processor socket AM
2+ platforms.


As a pretty die-hard AMD supporter, I still find it hard to believe that these first quad-core processors will be all the way until Q3 2007, what with quad-core Xeons about to come out, Quad-Core Core2 CPUs already shipping, etc. What's with the wait?