Email system completion

WIP but stable.