All this time I never realized the subject-thread plugin was nothing more than a stupid checkbox. The actual thread-by-subject code lives in the core mail library.