Email Record: Data structures and algorithms