Convert mail related test cases into new api.