Moves email search functionality to EmailDAO.