[REF] mail: migrate to new API

I think you're right. Note it is a big WIP, learning how to migrate to the new API.