Dissertation for Part II of the Cambridge Computer Science Tripos. See gitmaildir repository for implementation project.