From your comment you probably don't want to cluster, but rather to categorise (presumably spam vs non-spam). For this you should get familiar with a machine learning toolkit. The tf-idf business may possibly be helpful for pre-processing though.
If you are happy with Java, then Mallet and LingPipe are very straightforward to use. All such toolkits will do the term document matrix construction stuff, but will represent the very sparse data that results much more efficiently and also allow you to apply a variety of classification models. I've also had good luck with BMLR, but that will require that you construct the input data yourself, though it's not particularly tricky.
If you are keen to stay in clustering mode then most databases have a full text search module that allows you identify similar records according to tf-idf or related methods. Dealing with that similarity function directly might be more helpful for subsequent clustering. Better yet, you could just use Lucene which is available in various languages.