(WIP) Mail rewrite