in reply to analyzing spam patterns

There are Template::Extract and Template::Reverse which employ some heuristics to find the common and the templated parts given a corpus of text. Personally, I haven't used either to see what quality their results are.