SPAM programming contest

You are to write a program that reads a mail message (with headers) from standard input and decides whether it is spam or not. Your code should make a binary decision, which it should reflect in its exit status: 0 means non-spam; 1 means spam. You should not produce any actual output under normal use (feel free to define command-line switches that cause your program to generate output or display additional behaviors for development and debugging purposes; we just won't use those during the competition).

In addition to your code you should produce 10 spam and 10 non-spam email messages. We will use these messages to drive the competition. You should keep your messages secret until the turn-in date.


The TA and I have attempted to assign teams of roughly comparable experience and ability. If you have a problem working with someone on your team, please approach me privately.

  1. Warren Fong, Eric Hughes, David Lu, Matt Pandina
  2. Scott Cragg, Jason Friedman, Aaron Rolett, Rich Sarkis
  3. Peter Ordal, Jason Smith, Matt Storch, Tom Weingarten
  4. David Ganzhorn, Jonathan Norwood, Leila Seghatoleslami, Vlad Vanyukov
  5. Mike Bevilacqua-Linn, Joe Gester, Rod Hilton

Due Dates

Code and mail messages must be turned in to the TA by midnight, Sunday, February 8. Challenges to message categorizations (see below) must be made by midnight, Monday February 9. We will have a head-to-head contest in class on Tuesday February 10 to see which team prevails. Click here for turn-in details.


You will receive

Each spam message you create for the contest must be clearly recognizable as spam by an independent, unbiased judge. Each non-spam message must be clearly recognizable as non-spam. All 100 messages (20 from each of five teams) will be made public on Monday, February 9, by noon. You should read them through that afternoon. If you believe another team has unfairly characterized a message, you may challenge it. Your challenge must take the form of email to the TA, received by the deadline above. The TA will rule on challenges before class on Tuesday. If you challenge a message and the TA agrees that it was improperly characterized, it will be removed from (all) scoring, and your team will be awarded three points. If you a challenge a message and the TA rules against you, the message will stay in the competition and your team will lose three points. You may challenge as many messages as you like.


  1. Real-world spam notwithstanding, I expect all messages written for this class to merit nothing worse than a PG-13 rating: no porn, no hate mail, nothing that even hints of harrassment.

  2. There are some very good open-source spam filters out there. I can't stop you from studying their code. I strongly encourage you, however to study their ideas without studying their code. You'll learn more that way. (And for the record, the grades for this assignment will not depend on who “wins” and “loses” our contest; my hope is that everyone will do reasonably well and therefore get a good grade.) I expect you to write your own filter code. As noted elsewhere, you must explicitly acknowledge anything you copy.

Last Change: 12 January 2011 / Michael Scott's email address